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M/C,iBAAIwE,GACA,OAAOC,EAAAA,EAAAA,UAAS,GAADjmB,OAAIkmB,EAAAA,QAAIC,QAAO,sBAClC,CAOA,sBAAIsN,GACA,MAAO,CACH,sFACA,sKAER,CAOA,mBAAIC,GACA,MAAO,CACH,uDACA,8GACA,4FACA,iGACA,uMACFprB,KAAI,CAACukB,EAAM8G,KAAQ,CACjBC,KAAMD,EAAM,EACZ9G,UAER,CAEA,uBAAIgH,GACA,MAAO,CACH,CACIxe,GAAI,EACJye,OAAQ,oBACRC,YACI,6IACJC,KAAM,gBACNC,WAAW,EACXC,iBAAiB,GAErB,CACI7e,GAAI,EACJye,OAAQ,gDACRC,YACI,0QAEJC,KAAM,aACNE,iBAAiB,GAErB,CACI7e,GAAI,EACJye,OAAQ,mBACRC,YACI,8KACJC,KAAM,OACNE,iBAAiB,GAErB,CACI7e,GAAI,EACJye,OAAQ,iBACRC,YACI,wGACJC,KAAM,QACNC,WAAW,EACXC,iBAAiB,GAErB,CACI7e,GAAI,EACJye,OAAQ,wBACRC,YACI,iIACJC,KAAM,QACNC,WAAW,EACXC,iBAAiB,GAG7B,CAOA,OAAIC,GACA,MAAO,CACH,CACIC,QAAS,WACT7M,UAAW,CACP,CACIlS,GAAI,EACJgf,SACI,uDACJ7M,QAAS,CACL,2JACA,2HACA,gKACA,wGAGR,CACInS,GAAI,EACJgf,SAAU,wCACV7M,QAAS,CACL,gGAGR,CACInS,GAAI,EACJgf,SAAU,mBACV7M,QAAS,CACL,4EAGR,CACInS,GAAI,EACJgf,SACI,iDACJ7M,QAAS,CACL,oOAKhB,CACI4M,QAAS,sBACT7M,UAAW,CACP,CACIlS,GAAI,EACJgf,SAAU,yCACV7M,QAAS,CACL,6IACA,kEACA,wIAGR,CACInS,GAAI,EACJgf,SACI,yDACJ7M,QAAS,CACL,iGAGR,CACInS,GAAI,EACJgf,SAAU,sCACV7M,QAAS,CACL,2OAGR,CACInS,GAAI,EACJgf,SAAU,+BACV7M,QAAS,CACL,8FAKhB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AgB8E,OAAOixG,EAAc,6CAGrD,GADApyG,KAAKssG,OACDtsG,KAAK6rG,QACL,KAER,CACJ,EAEAT,EAAOlnG,UAAUwoG,UAAY,WACzB,MAAQ1sG,KAAK6rG,SAAWX,GAAclrG,KAAK8rG,SACvC9rG,KAAKssG,MAEb,EAKAlB,EAAOlnG,UAAUooE,KAAO,WACpB,GAAItsE,KAAK6rG,QACL,OAAO,KAEX,IAAIzvG,EAAO4D,KAAK8rG,OACZttG,EAASwB,KAAKxB,SACd6zG,EAAWryG,KAAKq+B,QAAQrK,WAAWx1B,GAAUpC,GAAQ,MAAU,EAAI,IACvE,OAAOi2G,QAA2CA,EAAW,IACjE,EACOjH,CACX,CA/yB4B,GAszB5B,SAASe,GAASsB,GACd,OAASA,GAAa,IAAMA,GAAa,KACpCA,GAAa,IAAMA,GAAa,EACzC,CA8BA,SAASvC,GAAcx7E,GACnB,OAASA,GAAK,GAAUA,GAAK,IACnB,KAANA,GACM,MAANA,GACCA,GAAK,MAAUA,GAAK,MACf,OAANA,GACM,OAANA,CACR,CAKA,SAASy7E,GAAiBz7E,GACtB,OAASA,GAAK,IAAUA,GAAK,IACnB,KAANA,GACCA,GAAK,IAAUA,GAAK,IACf,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACCA,GAAK,IAAUA,GAAK,IACpBA,GAAK,IAAUA,GAAK,IACpBA,GAAK,IAAUA,GAAK,IACpBA,GAAK,IAAUA,GAAK,IACf,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACCA,GAAK,KAAUA,GAAK,KACf,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACCA,GAAK,MAAUA,GAAK,MACpBA,GAAK,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AK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACf,OAANA,GACCA,GAAK,MAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,KAC7B,CEvvCA,SAAS4iF,GAAcC,GACnBA,EAAIppG,SAAQ,SAAUmyF,GAElB,UADOA,EAAGv7F,SACNslG,EAAgB/J,IAAOiK,EAAgBjK,GACvC,IAAK,IAAIx2D,KAAKw2D,EAAGt/F,eACNs/F,EAAGt/F,QAAQ8oC,GAAG/kC,SACrBuyG,GAAchX,EAAGt/F,QAAQ8oC,GAAG/nC,YAG3BkoG,EAAgB3J,IAAOqK,EAAiBrK,EAAGhsE,SAG1C41E,EAAc5J,IAAO6J,EAAc7J,KACzCsK,EAAmBtK,E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C,EAAG/xC,KACxE2jK,GAAQ3jK,KAAK0S,IACRixJ,IAAIA,EAAKlxJ,MAAMpL,UAAUmT,MAAMutB,KAAKr1B,EAAM,EAAG1S,IAClD2jK,EAAG3jK,GAAK0S,EAAK1S,IAGrB,OAAO8wB,EAAGxsB,OAAOq/J,GAAMlxJ,MAAMpL,UAAUmT,MAAMutB,KAAKr1B,GACpD,CArE6B7K,OAAOmF,OA2GXnF,OAAOmF,OA2DkB,mBAApBuwL,iBAAiCA","sources":["webpack://unattended-showing/./application/template.hbs","webpack://unattended-showing/./context/appointment-sgt3/template.hbs","webpack://unattended-showing/./components/appointment-list/index.hbs","webpack://unattended-showing/./components/appointment-list/index.js","webpack://unattended-showing/./context/appointment/template.hbs","webpack://unattended-showing/./context/available-units-list-sgt3/template.hbs","webpack://unattended-showing/./context/available-units-list/template.hbs","webpack://unattended-showing/./context/change-password-sgt3/template.hbs","webpack://unattended-showing/./context/change-password/template.hbs","webpack://unattended-showing/./context/credit-card-verification/account/template.hbs","webpack://unattended-showing/./context/credit-card-verification/guest/template.hbs","webpack://unattended-showing/./context/faq-sgt3/template.hbs","webpack://unattended-showing/./context/faq/template.hbs","webpack://unattended-showing/./context/forgot-password-sgt3/template.hbs","webpack://unattended-showing/./context/forgot-password/template.hbs","webpack://unattended-showing/./context/guest-appointment/template.hbs","webpack://unattended-showing/./context/guest-sign-up/template.hbs","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns-tz@2.0.1_date-fns@2.29.3/node_modules/date-fns-tz/esm/_lib/tzIntlTimeZoneName/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns-tz@2.0.1_date-fns@2.29.3/node_modules/date-fns-tz/esm/format/formatters/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns-tz@2.0.1_date-fns@2.29.3/node_modules/date-fns-tz/esm/format/index.js","webpack://unattended-showing/./components/key-value-display/index.hbs","webpack://unattended-showing/./components/key-value-display/index.ts","webpack://unattended-showing/./components/tour-details/index.hbs","webpack://unattended-showing/./components/tour-details/index.ts","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns-tz@2.0.1_date-fns@2.29.3/node_modules/date-fns-tz/esm/formatInTimeZone/index.js","webpack://unattended-showing/./components/review-and-book/index.hbs","webpack://unattended-showing/./components/review-and-book/index.ts","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/isSameDay/index.js","webpack://unattended-showing/./components/book-tour/index.hbs","webpack://unattended-showing/./components/book-tour/index.ts","webpack://unattended-showing/./context/location-sgt3/template.hbs","webpack://unattended-showing/./components/modals/terms-and-conditions/index.hbs","webpack://unattended-showing/./components/modals/terms-and-conditions/index.js","webpack://unattended-showing/./components/appointment-schedule/index.hbs","webpack://unattended-showing/./components/appointment-schedule/index.js","webpack://unattended-showing/./context/location/template.hbs","webpack://unattended-showing/./context/login-sgt3/template.hbs","webpack://unattended-showing/./context/login/template.hbs","webpack://unattended-showing/./context/logout/template.hbs","webpack://unattended-showing/./context/not-found/template.hbs","webpack://unattended-showing/./components/phone-verification/index.hbs","webpack://unattended-showing/./components/phone-verification/index.ts","webpack://unattended-showing/./context/phone-verification/guest/template.hbs","webpack://unattended-showing/./context/profile-sgt3/template.hbs","webpack://unattended-showing/./context/profile/template.hbs","webpack://unattended-showing/./context/sign-up-sgt3/template.hbs","webpack://unattended-showing/./context/sign-up/index/template.hbs","webpack://unattended-showing/./context/sign-up/template.hbs","webpack://unattended-showing/./context/sign-up/verification/template.hbs","webpack://unattended-showing/./components/app-header-sgt3/index.hbs","webpack://unattended-showing/./components/app-header-sgt3/index.ts","webpack://unattended-showing/./components/app-footer-sgt3/index.hbs","webpack://unattended-showing/./components/app-footer-sgt3/index.ts","webpack://unattended-showing/./components/header-link.hbs","webpack://unattended-showing/./components/header-link.js","webpack://unattended-showing/./components/app-header/index.hbs","webpack://unattended-showing/./components/app-header/index.js","webpack://unattended-showing/./context/template.hbs","webpack://unattended-showing/./index/template.hbs","webpack://unattended-showing/./loading/template.hbs","webpack://unattended-showing/./not-found/template.hbs","webpack://unattended-showing/./adapters/application.js","webpack://unattended-showing/../rewritten-packages/ember-load-initializers.dd92ac3a/node_modules/ember-load-initializers/index.js","webpack://unattended-showing/./app.js","webpack://unattended-showing/./application/route.js","webpack://unattended-showing/./assets/unattended-showing.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/authenticators/base.js","webpack://unattended-showing/./authenticators/credentials.js","webpack://unattended-showing/./classes/base-route.js","webpack://unattended-showing/./classes/protected-route.js","webpack://unattended-showing/./components/app-footer/index.hbs","webpack://unattended-showing/./components/app-footer/index.js","webpack://unattended-showing/./modifiers/format-credit-card-number.ts","webpack://unattended-showing/./modifiers/format-credit-card-expiration.ts","webpack://unattended-showing/./components/credit-card-verification/index.hbs","webpack://unattended-showing/./components/credit-card-verification/index.ts","webpack://unattended-showing/./components/input-form-row/index.hbs","webpack://unattended-showing/./components/input-form-row/index.js","webpack://unattended-showing/./components/input-form.hbs","webpack://unattended-showing/./components/input-form.js","webpack://unattended-showing/./config/environment.js","webpack://unattended-showing/./context/appointment-sgt3/route.ts","webpack://unattended-showing/./context/appointment/controller.js","webpack://unattended-showing/./context/appointment/route.js","webpack://unattended-showing/./context/available-units-list-sgt3/route.ts","webpack://unattended-showing/./context/available-units-list/controller.js","webpack://unattended-showing/./context/available-units-list/route.js","webpack://unattended-showing/./context/change-password-sgt3/route.ts","webpack://unattended-showing/./context/change-password/controller.js","webpack://unattended-showing/./context/change-password/route.js","webpack://unattended-showing/./context/controller.ts","webpack://unattended-showing/./context/credit-card-verification/account/controller.ts","webpack://unattended-showing/./context/credit-card-verification/account/route.ts","webpack://unattended-showing/./context/credit-card-verification/guest/controller.ts","webpack://unattended-showing/./context/credit-card-verification/guest/route.ts","webpack://unattended-showing/./context/faq-sgt3/route.ts","webpack://unattended-showing/./context/faq/controller.js","webpack://unattended-showing/./context/forgot-password-sgt3/route.ts","webpack://unattended-showing/./context/forgot-password/controller.js","webpack://unattended-showing/./context/forgot-password/route.js","webpack://unattended-showing/./context/guest-appointment/controller.ts","webpack://unattended-showing/./context/guest-appointment/route.ts","webpack://unattended-showing/./context/guest-sign-up/controller.ts","webpack://unattended-showing/./context/guest-sign-up/route.ts","webpack://unattended-showing/./context/location-sgt3/controller.ts","webpack://unattended-showing/./context/location-sgt3/route.ts","webpack://unattended-showing/./context/location/controller.js","webpack://unattended-showing/./context/location/route.js","webpack://unattended-showing/./context/login-sgt3/controller.ts","webpack://unattended-showing/./context/login-sgt3/route.ts","webpack://unattended-showing/./context/login/controller.js","webpack://unattended-showing/./context/login/route.js","webpack://unattended-showing/./context/logout/route.js","webpack://unattended-showing/./context/phone-verification/base/controller.ts","webpack://unattended-showing/./context/phone-verification/guest/controller.ts","webpack://unattended-showing/./context/phone-verification/guest/route.ts","webpack://unattended-showing/./context/profile-sgt3/route.ts","webpack://unattended-showing/./context/profile/controller.js","webpack://unattended-showing/./context/profile/route.js","webpack://unattended-showing/./context/redirect/route.js","webpack://unattended-showing/./context/route.js","webpack://unattended-showing/./context/sign-up-sgt3/controller.ts","webpack://unattended-showing/./context/sign-up-sgt3/route.ts","webpack://unattended-showing/./context/sign-up/index/controller.js","webpack://unattended-showing/./context/sign-up/index/route.js","webpack://unattended-showing/./context/sign-up/verification/controller.js","webpack://unattended-showing/./context/sign-up/verification/route.js","webpack://unattended-showing/./enums/Country.ts","webpack://unattended-showing/./enums/LinkUrl.ts","webpack://unattended-showing/./helpers/file-utils.js","webpack://unattended-showing/./helpers/get-link-url.ts","webpack://unattended-showing/./index/controller.js","webpack://unattended-showing/./index/route.js","webpack://unattended-showing/./instance-initializers/env-settings.js","webpack://unattended-showing/./models/appointment.ts","webpack://unattended-showing/./models/available-units-list.js","webpack://unattended-showing/./models/base-location.ts","webpack://unattended-showing/./models/context.js","webpack://unattended-showing/./models/country.ts","webpack://unattended-showing/./models/credit-card-verification.ts","webpack://unattended-showing/./models/external-identifier.js","webpack://unattended-showing/./models/guest-appointment.ts","webpack://unattended-showing/./models/guest-sign-up.ts","webpack://unattended-showing/./models/location.ts","webpack://unattended-showing/./models/phone-verification-guest.ts","webpack://unattended-showing/./models/phone-verification.ts","webpack://unattended-showing/./models/profile-password.ts","webpack://unattended-showing/./models/profile.ts","webpack://unattended-showing/./models/sanitized-appointment.ts","webpack://unattended-showing/./models/sign-up.ts","webpack://unattended-showing/./modifiers/format-phone-number.ts","webpack://unattended-showing/./modifiers/number-formatter.ts","webpack://unattended-showing/./resolver.js","webpack://unattended-showing/../rewritten-packages/@ember/test-waiters.d540532b/node_modules/@ember/test-waiters/waiter-manager.js","webpack://unattended-showing/../rewritten-packages/@ember/test-waiters.d540532b/node_modules/@ember/test-waiters/build-waiter.js","webpack://unattended-showing/../src/index.ts","webpack://unattended-showing/../rewritten-packages/@ember/test-waiters.d540532b/node_modules/@ember/test-waiters/wait-for-promise.js","webpack://unattended-showing/../rewritten-packages/@ember/test-waiters.d540532b/node_modules/@ember/test-waiters/wait-for.js","webpack://unattended-showing/./router.js","webpack://unattended-showing/./serializers/application.js","webpack://unattended-showing/./serializers/sign-up.js","webpack://unattended-showing/./services/ajax.ts","webpack://unattended-showing/./services/check-in.js","webpack://unattended-showing/./services/error-reporting.js","webpack://unattended-showing/./services/intl.js","webpack://unattended-showing/./services/login-pending-booking.ts","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/subMinutes/index.js","webpack://unattended-showing/./services/mock-time.ts","webpack://unattended-showing/./services/sgt-session.ts","webpack://unattended-showing/./session-stores/application.js","webpack://unattended-showing/./transforms/hours-of-operation.js","webpack://unattended-showing/./utils/convert-to-record.ts","webpack://unattended-showing/./utils/datetime-utils.js","webpack://unattended-showing/./utils/validators.js","webpack://unattended-showing/../rewritten-packages/@ember-data/adapter.8c6a2bf1/node_modules/@ember-data/adapter/-private/utils/parse-response-headers.js","webpack://unattended-showing/../rewritten-packages/@ember-data/adapter.8c6a2bf1/node_modules/@ember-data/adapter/-private/utils/determine-body-promise.js","webpack://unattended-showing/../rewritten-packages/@ember-data/adapter.8c6a2bf1/node_modules/@ember-data/adapter/-private/utils/continue-on-reject.js","webpack://unattended-showing/../rewritten-packages/@ember-data/adapter.8c6a2bf1/node_modules/@ember-data/adapter/-private/utils/serialize-query-params.js","webpack://unattended-showing/../rewritten-packages/@ember-data/adapter.8c6a2bf1/node_modules/@ember-data/adapter/-private/utils/fetch.js","webpack://unattended-showing/../rewritten-packages/@ember-data/adapter.8c6a2bf1/node_modules/@ember-data/adapter/-private/build-url-mixin.js","webpack://unattended-showing/../rewritten-packages/@ember-data/adapter.8c6a2bf1/node_modules/@ember-data/adapter/-private/utils/serialize-into-hash.js","webpack://unattended-showing/../rewritten-packages/@ember-data/adapter.8c6a2bf1/node_modules/@ember-data/adapter/error.js","webpack://unattended-showing/../rewritten-packages/@ember-data/adapter.8c6a2bf1/node_modules/@ember-data/adapter/index.js","webpack://unattended-showing/../rewritten-packages/@ember-data/adapter.8c6a2bf1/node_modules/@ember-data/adapter/json-api.js","webpack://unattended-showing/../rewritten-packages/@ember-data/adapter.8c6a2bf1/node_modules/@ember-data/adapter/rest.js","webpack://unattended-showing/../rewritten-packages/@ember-data/debug.d79ffbc1/node_modules/@ember-data/debug/index.js","webpack://unattended-showing/../rewritten-packages/@ember-data/debug.d79ffbc1/node_modules/@ember-data/debug/setup.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/util.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/attr.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/errors.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/legacy-data-utils.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/legacy-data-fetch.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/diff-array.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/many-array.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/promise-belongs-to.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/promise-many-array.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/references/belongs-to.js","webpack://unattended-showing/../rewritten-packages/ember-cached-decorator-polyfill.9e7651c3/node_modules/ember-cached-decorator-polyfill/index.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/references/has-many.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/legacy-relationships-support.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/record-state.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/notify-changes.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/model.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/relationship-meta.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/belongs-to.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/has-many.js","webpack://unattended-showing/../rewritten-packages/@ember-data/model.aebb5837/node_modules/@ember-data/model/-private/model-for-mixin.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/coerce-id.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/graph/-utils.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/relationships/state/belongs-to.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/graph/-state.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/relationships/state/has-many.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/relationships/state/implicit.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/graph/-edge-definition.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/graph/operations/replace-related-records.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/graph/operations/add-to-related-records.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/graph/operations/remove-from-related-records.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/normalize-link.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/graph/index.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/graph/operations/update-relationship.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/graph/operations/replace-related-record.js","webpack://unattended-showing/../rewritten-packages/@ember-data/record-data.68d786d3/node_modules/@ember-data/record-data/-private/record-data.js","webpack://unattended-showing/../rewritten-packages/@ember-data/serializer.16f69675/node_modules/@ember-data/serializer/-private/embedded-records-mixin.js","webpack://unattended-showing/../rewritten-packages/@ember-data/serializer.16f69675/node_modules/@ember-data/serializer/-private/utils.js","webpack://unattended-showing/../rewritten-packages/@ember-data/serializer.16f69675/node_modules/@ember-data/serializer/-private/transforms/transform.js","webpack://unattended-showing/../rewritten-packages/@ember-data/serializer.16f69675/node_modules/@ember-data/serializer/-private/transforms/boolean.js","webpack://unattended-showing/../rewritten-packages/@ember-data/serializer.16f69675/node_modules/@ember-data/serializer/-private/transforms/date.js","webpack://unattended-showing/../rewritten-packages/@ember-data/serializer.16f69675/node_modules/@ember-data/serializer/-private/transforms/number.js","webpack://unattended-showing/../rewritten-packages/@ember-data/serializer.16f69675/node_modules/@ember-data/serializer/-private/transforms/string.js","webpack://unattended-showing/../rewritten-packages/@ember-data/serializer.16f69675/node_modules/@ember-data/serializer/index.js","webpack://unattended-showing/../rewritten-packages/@ember-data/serializer.16f69675/node_modules/@ember-data/serializer/json-api.js","webpack://unattended-showing/../rewritten-packages/@ember-data/serializer.16f69675/node_modules/@ember-data/serializer/json.js","webpack://unattended-showing/../rewritten-packages/@ember-data/serializer.16f69675/node_modules/@ember-data/serializer/rest.js","webpack://unattended-showing/../rewritten-packages/@ember-data/serializer.16f69675/node_modules/@ember-data/serializer/transform.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/backburner.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/coerce-id.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/common.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/errors-utils.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/request-cache.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/serializer-response.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/snapshot.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/identifer-debug-consts.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/weak-cache.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/fetch-manager.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/finders.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/normalize-model-name.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/utils/is-non-empty-string.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/identifier-cache.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/model/internal-model.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/internal-model-map.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/identity-map.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/utils/construct-resource.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/internal-model-factory.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/record-notification-manager.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/model/record-reference.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/record-data-for.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/record-data-store-wrapper.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/instance-cache.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/model/shim-model-class.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/promise-proxy-base.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/promise-proxies.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/snapshot-record-array.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/record-arrays/record-array.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/record-arrays/adapter-populated-record-array.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/record-array-manager.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/schema-definition-service.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/core-store.js","webpack://unattended-showing/../rewritten-packages/@ember-data/store.d86a0ee2/node_modules/@ember-data/store/-private/utils/promise-record.js","webpack://unattended-showing/../rewritten-packages/@ember/render-modifiers.436a303b/node_modules/@ember/render-modifiers/modifiers/did-insert.js","webpack://unattended-showing/../rewritten-packages/@ember/render-modifiers.436a303b/node_modules/@ember/render-modifiers/modifiers/did-update.js","webpack://unattended-showing/../rewritten-packages/@ember/render-modifiers.436a303b/node_modules/@ember/render-modifiers/modifiers/will-destroy.js","webpack://unattended-showing/../rewritten-packages/@ember/string.4a242b9a/node_modules/@ember/string/cache.js","webpack://unattended-showing/../rewritten-packages/@ember/string.4a242b9a/node_modules/@ember/string/index.js","webpack://unattended-showing/../rewritten-packages/@embroider/util.9c5279df/node_modules/@embroider/util/services/ensure-registered.js","webpack://unattended-showing/../rewritten-packages/@glimmer/component.b3400e67/node_modules/@glimmer/component/-private/component.js","webpack://unattended-showing/../rewritten-packages/@glimmer/component.b3400e67/node_modules/@glimmer/component/-private/destroyables.js","webpack://unattended-showing/../rewritten-packages/@glimmer/component.b3400e67/node_modules/@glimmer/component/-private/ember-component-manager.js","webpack://unattended-showing/../rewritten-packages/@glimmer/component.b3400e67/node_modules/@glimmer/component/-private/base-component-manager.js","webpack://unattended-showing/../rewritten-packages/@glimmer/component.b3400e67/node_modules/@glimmer/component/index.js","webpack://unattended-showing/../rewritten-packages/@glimmer/tracking.0f52e106/node_modules/@glimmer/tracking/index.js","webpack://unattended-showing/../rewritten-packages/@sentry/ember.1bea4619/node_modules/@sentry/ember/instance-initializers/sentry-performance.js","webpack://unattended-showing/../../src/dsn.ts","webpack://unattended-showing/../../src/envelope.ts","webpack://unattended-showing/../../src/error.ts","webpack://unattended-showing/../../src/api.ts","webpack://unattended-showing/../../src/baseclient.ts","webpack://unattended-showing/../../../src/metrics/envelope.ts","webpack://unattended-showing/../../../src/metrics/utils.ts","webpack://unattended-showing/../../../src/client.ts","webpack://unattended-showing/../../src/env.ts","webpack://unattended-showing/../../../src/userfeedback.ts","webpack://unattended-showing/../../src/clientreport.ts","webpack://unattended-showing/../../../src/stack-parsers.ts","webpack://unattended-showing/../../src/ratelimit.ts","webpack://unattended-showing/../../../src/transports/base.ts","webpack://unattended-showing/../../src/promisebuffer.ts","webpack://unattended-showing/../../../../src/transports/utils.ts","webpack://unattended-showing/../../../../src/transports/fetch.ts","webpack://unattended-showing/../../../../src/transports/xhr.ts","webpack://unattended-showing/../../../src/sdk.ts","webpack://unattended-showing/../rewritten-packages/@sentry/ember.1bea4619/node_modules/@sentry/ember/index.js","webpack://unattended-showing/../../src/sdk.ts","webpack://unattended-showing/../rewritten-packages/ember-cli-app-version.924df200/node_modules/ember-cli-app-version/initializer-factory.js","webpack://unattended-showing/../rewritten-packages/ember-cli-app-version.924df200/node_modules/ember-cli-app-version/_app_/initializers/app-version.js","webpack://unattended-showing/../rewritten-packages/ember-modifier.9c93520b/node_modules/ember-modifier/-private/compat.js","webpack://unattended-showing/../rewritten-packages/ember-modifier.9c93520b/node_modules/ember-modifier/-private/class/modifier-manager.js","webpack://unattended-showing/../rewritten-packages/ember-modifier.9c93520b/node_modules/ember-modifier/-private/class/modifier.js","webpack://unattended-showing/../rewritten-packages/ember-modifier.9c93520b/node_modules/ember-modifier/-private/function-based/modifier-manager.js","webpack://unattended-showing/../rewritten-packages/ember-modifier.9c93520b/node_modules/ember-modifier/-private/function-based/modifier.js","webpack://unattended-showing/../rewritten-packages/ember-click-outside.ccf54f40/node_modules/ember-click-outside/-private/matches-selector.js","webpack://unattended-showing/../rewritten-packages/ember-click-outside.ccf54f40/node_modules/ember-click-outside/utils.js","webpack://unattended-showing/../rewritten-packages/ember-click-outside.ccf54f40/node_modules/ember-click-outside/modifier.js","webpack://unattended-showing/../rewritten-packages/ember-cookies.7b6a648f/node_modules/ember-cookies/utils/serialize-cookie.js","webpack://unattended-showing/../rewritten-packages/ember-cookies.7b6a648f/node_modules/ember-cookies/services/cookies.js","webpack://unattended-showing/../rewritten-packages/ember-cookies.7b6a648f/node_modules/ember-cookies/_app_/services/cookies.js","webpack://unattended-showing/../rewritten-packages/ember-data.8959dcf6/node_modules/ember-data/_app_/initializers/ember-data.js","webpack://unattended-showing/../rewritten-packages/ember-data.8959dcf6/node_modules/ember-data/_app_/instance-initializers/ember-data.js","webpack://unattended-showing/../rewritten-packages/ember-data.8959dcf6/node_modules/ember-data/version.js","webpack://unattended-showing/../rewritten-packages/ember-data.8959dcf6/node_modules/ember-data/-private/core.js","webpack://unattended-showing/../rewritten-packages/ember-data.8959dcf6/node_modules/ember-data/index.js","webpack://unattended-showing/../rewritten-packages/ember-data.8959dcf6/node_modules/ember-data/setup-container.js","webpack://unattended-showing/../rewritten-packages/ember-get-config.867fe42e/node_modules/ember-get-config/index.js","webpack://unattended-showing/../rewritten-packages/ember-inflector.4956360c/node_modules/ember-inflector/lib/system/inflections.js","webpack://unattended-showing/../rewritten-packages/ember-inflector.4956360c/node_modules/ember-inflector/lib/system/inflector.js","webpack://unattended-showing/../rewritten-packages/ember-inflector.4956360c/node_modules/ember-inflector/lib/system/string.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/helpers/format-date.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/helpers/t.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/utils/missing-message.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.7.8/node_modules/@formatjs/icu-messageformat-parser/lib/error.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.7.8/node_modules/@formatjs/icu-messageformat-parser/lib/types.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.7.8/node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.2/node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.2/node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.2/node_modules/@formatjs/icu-skeleton-parser/lib/number.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.7.8/node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.7.8/node_modules/@formatjs/icu-messageformat-parser/lib/parser.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.7.8/node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.7.8/node_modules/@formatjs/icu-messageformat-parser/lib/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+fast-memoize@2.2.0/node_modules/@formatjs/fast-memoize/lib/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/intl-messageformat@10.5.14/node_modules/intl-messageformat/lib/src/error.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/intl-messageformat@10.5.14/node_modules/intl-messageformat/lib/src/formatters.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/intl-messageformat@10.5.14/node_modules/intl-messageformat/lib/src/core.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+intl@2.10.4_typescript@5.3.3/node_modules/@formatjs/intl/lib/src/utils.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+intl@2.10.4_typescript@5.3.3/node_modules/@formatjs/intl/lib/src/number.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+intl@2.10.4_typescript@5.3.3/node_modules/@formatjs/intl/lib/src/relativeTime.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+intl@2.10.4_typescript@5.3.3/node_modules/@formatjs/intl/lib/src/dateTime.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+intl@2.10.4_typescript@5.3.3/node_modules/@formatjs/intl/lib/src/plural.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+intl@2.10.4_typescript@5.3.3/node_modules/@formatjs/intl/lib/src/message.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+ecma402-abstract@2.0.0/node_modules/@formatjs/ecma402-abstract/lib/utils.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+intl@2.10.4_typescript@5.3.3/node_modules/@formatjs/intl/lib/src/list.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+intl@2.10.4_typescript@5.3.3/node_modules/@formatjs/intl/lib/src/displayName.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+intl@2.10.4_typescript@5.3.3/node_modules/@formatjs/intl/lib/src/create-intl.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/formatters/-base.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/formatters/format-date.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/formatters/format-list.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/formatters/format-message.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/formatters/format-number.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/formatters/format-relative.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/formatters/format-time.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/utils/empty-object.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/utils/flatten.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/translations.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/utils/normalize-locale.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/services/intl.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/utils/is-array-equal.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/utils/hydrate.js","webpack://unattended-showing/../rewritten-packages/ember-intl.4169306b/node_modules/ember-intl/-private/utils/get-dom.js","webpack://unattended-showing/../rewritten-packages/ember-metrics.267359ad/node_modules/ember-metrics/-private/utils/object-transforms.js","webpack://unattended-showing/../rewritten-packages/ember-metrics.267359ad/node_modules/ember-metrics/metrics-adapters/google-analytics.js","webpack://unattended-showing/../rewritten-packages/ember-metrics.267359ad/node_modules/ember-metrics/-private/utils/remove-from-dom.js","webpack://unattended-showing/../rewritten-packages/ember-metrics.267359ad/node_modules/ember-metrics/services/metrics.js","webpack://unattended-showing/../rewritten-packages/ember-metrics.267359ad/node_modules/ember-metrics/metrics-adapters/base.js","webpack://unattended-showing/../rewritten-packages/ember-noop.ed8e325e/node_modules/ember-noop/helpers/noop.js","webpack://unattended-showing/../rewritten-packages/ember-promise-helpers.93906283/node_modules/ember-promise-helpers/helpers/is-fulfilled.js","webpack://unattended-showing/../rewritten-packages/ember-promise-helpers.93906283/node_modules/ember-promise-helpers/helpers/is-pending.js","webpack://unattended-showing/../rewritten-packages/ember-promise-helpers.93906283/node_modules/ember-promise-helpers/helpers/await.js","webpack://unattended-showing/../rewritten-packages/ember-resolver.ee2dc081/node_modules/ember-resolver/resolvers/classic/container-debug-adapter.js","webpack://unattended-showing/../rewritten-packages/ember-resolver.ee2dc081/node_modules/ember-resolver/_app_/initializers/container-debug-adapter.js","webpack://unattended-showing/../rewritten-packages/ember-resolver.ee2dc081/node_modules/ember-resolver/resolvers/classic/index.js","webpack://unattended-showing/../rewritten-packages/ember-resolver.ee2dc081/node_modules/ember-resolver/utils/class-factory.js","webpack://unattended-showing/../rewritten-packages/ember-responsive.2275ab5c/node_modules/ember-responsive/_app_/breakpoints.js","webpack://unattended-showing/../rewritten-packages/ember-responsive.2275ab5c/node_modules/ember-responsive/helpers/media.js","webpack://unattended-showing/../rewritten-packages/ember-responsive.2275ab5c/node_modules/ember-responsive/initializers/responsive.js","webpack://unattended-showing/../rewritten-packages/ember-responsive.2275ab5c/node_modules/ember-responsive/_app_/initializers/ember-responsive-breakpoints.js","webpack://unattended-showing/../rewritten-packages/ember-responsive.2275ab5c/node_modules/ember-responsive/null-match-media.js","webpack://unattended-showing/../rewritten-packages/ember-responsive.2275ab5c/node_modules/ember-responsive/_app_/services/media.js","webpack://unattended-showing/../rewritten-packages/ember-responsive.2275ab5c/node_modules/ember-responsive/services/media.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/utils/assign.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/internal-session.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/session-stores/ephemeral.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/session-stores/adaptive.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/session-stores/local-storage.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/_app_/initializers/ember-simple-auth.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/initializers/setup-session.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/initializers/setup-session-restoration.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/_app_/instance-initializers/ember-simple-auth.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/_app_/services/session.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/use-session-setup-method.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/configuration.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/services/session.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/-internals/routing.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/utils/location.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/session-stores/base.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/session-stores/cookie.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/utils/is-fastboot.js","webpack://unattended-showing/../rewritten-packages/ember-simple-auth.5ac941c7/node_modules/ember-simple-auth/utils/objects-are-equal.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@embroider+macros@1.16.5_@glint+template@1.4.0/node_modules/@embroider/macros/src/addon/es-compat2.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@formatjs+intl@2.10.4_typescript@5.3.3/node_modules/@formatjs/intl/lib/src/error.js","webpack://unattended-showing/../../../src/debug-build.ts","webpack://unattended-showing/../../../src/eventbuilder.ts","webpack://unattended-showing/../../../src/helpers.ts","webpack://unattended-showing/../../src/eventbuilder.ts","webpack://unattended-showing/../../../src/integrations/linkederrors.ts","webpack://unattended-showing/../../../src/utils/hasTracingEnabled.ts","webpack://unattended-showing/../../../src/tracing/trace.ts","webpack://unattended-showing/../../../src/tracing/span.ts","webpack://unattended-showing/../../src/semanticAttributes.ts","webpack://unattended-showing/../../../src/tracing/transaction.ts","webpack://unattended-showing/../../../src/tracing/idletransaction.ts","webpack://unattended-showing/../../../src/tracing/utils.ts","webpack://unattended-showing/../../../src/tracing/errors.ts","webpack://unattended-showing/../../../src/tracing/sampling.ts","webpack://unattended-showing/../../../src/tracing/hubextensions.ts","webpack://unattended-showing/../../../src/common/debug-build.ts","webpack://unattended-showing/../../../src/browser/types.ts","webpack://unattended-showing/../../../../../src/browser/web-vitals/lib/bindReporter.ts","webpack://unattended-showing/../../../../../src/browser/web-vitals/lib/getNavigationEntry.ts","webpack://unattended-showing/../../../../../src/browser/web-vitals/lib/getActivationStart.ts","webpack://unattended-showing/../../../../../src/browser/web-vitals/lib/initMetric.ts","webpack://unattended-showing/../../../../../src/browser/web-vitals/lib/generateUniqueID.ts","webpack://unattended-showing/../../../../../src/browser/web-vitals/lib/observe.ts","webpack://unattended-showing/../../../../../src/browser/web-vitals/lib/onHidden.ts","webpack://unattended-showing/../../../../src/browser/web-vitals/getCLS.ts","webpack://unattended-showing/../../../../../src/browser/web-vitals/lib/getVisibilityWatcher.ts","webpack://unattended-showing/../../../../src/browser/web-vitals/getFID.ts","webpack://unattended-showing/../../../../src/browser/web-vitals/getLCP.ts","webpack://unattended-showing/../../../src/browser/instrument.ts","webpack://unattended-showing/../../../../src/browser/metrics/utils.ts","webpack://unattended-showing/../../../../src/browser/metrics/index.ts","webpack://unattended-showing/../../../src/browser/request.ts","webpack://unattended-showing/../../../src/common/fetch.ts","webpack://unattended-showing/../../../src/browser/browsertracing.ts","webpack://unattended-showing/../../../src/browser/router.ts","webpack://unattended-showing/../../../src/browser/backgroundtab.ts","webpack://unattended-showing/../../../src/index.ts","webpack://unattended-showing/../../../src/instrument/dom.ts","webpack://unattended-showing/../../src/url.ts","webpack://unattended-showing/../../../../src/integrations/breadcrumbs.ts","webpack://unattended-showing/../../../../src/integrations/dedupe.ts","webpack://unattended-showing/../../../../src/integrations/globalhandlers.ts","webpack://unattended-showing/../../../../src/integrations/httpcontext.ts","webpack://unattended-showing/../../../../src/integrations/linkederrors.ts","webpack://unattended-showing/../../../../src/integrations/trycatch.ts","webpack://unattended-showing/../../src/constants.ts","webpack://unattended-showing/../../src/debug-build.ts","webpack://unattended-showing/../../src/eventProcessors.ts","webpack://unattended-showing/../../src/exports.ts","webpack://unattended-showing/../../src/hub.ts","webpack://unattended-showing/../../src/integration.ts","webpack://unattended-showing/../../../src/integrations/functiontostring.ts","webpack://unattended-showing/../../../src/integrations/inboundfilters.ts","webpack://unattended-showing/../../src/scope.ts","webpack://unattended-showing/../../src/session.ts","webpack://unattended-showing/../../../src/tracing/dynamicSamplingContext.ts","webpack://unattended-showing/../../../src/utils/applyScopeDataToEvent.ts","webpack://unattended-showing/../../../src/utils/prepareEvent.ts","webpack://unattended-showing/../../../src/utils/spanUtils.ts","webpack://unattended-showing/../../src/version.ts","webpack://unattended-showing/../../../src/captureconsole.ts","webpack://unattended-showing/../../src/aggregate-errors.ts","webpack://unattended-showing/../../src/baggage.ts","webpack://unattended-showing/../../src/browser.ts","webpack://unattended-showing/../../../src/instrument/_handlers.ts","webpack://unattended-showing/../../../src/instrument/console.ts","webpack://unattended-showing/../../../src/instrument/fetch.ts","webpack://unattended-showing/../../../src/instrument/globalError.ts","webpack://unattended-showing/../../../src/instrument/globalUnhandledRejection.ts","webpack://unattended-showing/../../../src/vendor/supportsHistory.ts","webpack://unattended-showing/../../../src/instrument/history.ts","webpack://unattended-showing/../../../src/instrument/xhr.ts","webpack://unattended-showing/../../src/is.ts","webpack://unattended-showing/../../src/logger.ts","webpack://unattended-showing/../../src/misc.ts","webpack://unattended-showing/../../src/normalize.ts","webpack://unattended-showing/../../src/memo.ts","webpack://unattended-showing/../../src/object.ts","webpack://unattended-showing/../../src/severity.ts","webpack://unattended-showing/../../src/stacktrace.ts","webpack://unattended-showing/../../src/string.ts","webpack://unattended-showing/../../src/supports.ts","webpack://unattended-showing/../../src/syncpromise.ts","webpack://unattended-showing/../../src/time.ts","webpack://unattended-showing/../../src/tracing.ts","webpack://unattended-showing/../../src/worldwide.ts","webpack://unattended-showing/../../../../../node_modules/.pnpm/card-validator@10.0.2/node_modules/card-validator/dist/card-number.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/card-validator@10.0.2/node_modules/card-validator/dist/cardholder-name.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/card-validator@10.0.2/node_modules/card-validator/dist/cvv.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/card-validator@10.0.2/node_modules/card-validator/dist/expiration-date.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/card-validator@10.0.2/node_modules/card-validator/dist/expiration-month.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/card-validator@10.0.2/node_modules/card-validator/dist/expiration-year.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/card-validator@10.0.2/node_modules/card-validator/dist/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/card-validator@10.0.2/node_modules/card-validator/dist/lib/is-array.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/card-validator@10.0.2/node_modules/card-validator/dist/lib/parse-date.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/card-validator@10.0.2/node_modules/card-validator/dist/luhn-10.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/card-validator@10.0.2/node_modules/card-validator/dist/postal-code.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/credit-card-type@10.0.2/node_modules/credit-card-type/dist/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/credit-card-type@10.0.2/node_modules/credit-card-type/dist/lib/add-matching-cards-to-results.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/credit-card-type@10.0.2/node_modules/credit-card-type/dist/lib/card-types.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/credit-card-type@10.0.2/node_modules/credit-card-type/dist/lib/clone.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/credit-card-type@10.0.2/node_modules/credit-card-type/dist/lib/find-best-match.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/credit-card-type@10.0.2/node_modules/credit-card-type/dist/lib/is-valid-input-type.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/credit-card-type@10.0.2/node_modules/credit-card-type/dist/lib/matches.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/addLeadingZeros/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/assign/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/cloneObject/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/defaultLocale/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/defaultOptions/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/format/formatters/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/format/lightFormatters/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/format/longFormatters/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/getUTCDayOfYear/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/getUTCISOWeek/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/getUTCISOWeekYear/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/getUTCWeek/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/getUTCWeekYear/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/protectedTokens/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/requiredArgs/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/startOfUTCISOWeek/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/startOfUTCISOWeekYear/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/startOfUTCWeek/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/startOfUTCWeekYear/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/_lib/toInteger/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/addMilliseconds/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/defaultOptions/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/requiredArgs/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/toInteger/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/addDays/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/addMilliseconds/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/addMinutes/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/format/lightFormatters/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/format/formatters/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/getUTCWeek/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/format/longFormatters/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/protectedTokens/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/en-US/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/defaultLocale/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/format/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/subMilliseconds/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/isAfter/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/isBefore/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/isEqual/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/isDate/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/isValid/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/isWithinInterval/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/setDay/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/setHours/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/setMonth/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/getDaysInMonth/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/startOfDay/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/startOfHour/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/toDate/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/format/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/isDate/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/isValid/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/locale/_lib/buildFormatLongFn/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/locale/_lib/buildLocalizeFn/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/locale/_lib/buildMatchFn/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/locale/_lib/buildMatchPatternFn/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/locale/en-US/_lib/formatDistance/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/locale/en-US/_lib/formatLong/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/locale/en-US/_lib/formatRelative/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/locale/en-US/_lib/localize/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/locale/en-US/_lib/match/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/locale/en-US/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/subMilliseconds/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/toDate/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/detect-browser@5.3.0/node_modules/detect-browser/es/index.js","webpack://unattended-showing/../../src/-private/ember-environment.js","webpack://unattended-showing/../../../src/-private/external/environment.js","webpack://unattended-showing/../../../../../src/-private/external/scheduler/policies/bounded-policy.js","webpack://unattended-showing/../../../../../src/-private/external/scheduler/policies/drop-policy.js","webpack://unattended-showing/../../../../../src/-private/external/scheduler/policies/enqueued-policy.js","webpack://unattended-showing/../../../../../src/-private/external/scheduler/policies/execution-states.js","webpack://unattended-showing/../../../../../src/-private/external/scheduler/policies/keep-latest-policy.js","webpack://unattended-showing/../../../../../src/-private/external/scheduler/policies/restartable-policy.js","webpack://unattended-showing/../../../../src/-private/external/scheduler/refresh.js","webpack://unattended-showing/../../../../../src/-private/external/scheduler/state-tracker/state.js","webpack://unattended-showing/../../../../../src/-private/external/scheduler/state-tracker/state-tracker.js","webpack://unattended-showing/../../../../../src/-private/external/scheduler/state-tracker/null-state-tracker.js","webpack://unattended-showing/../../../../../src/-private/external/scheduler/state-tracker/null-state.js","webpack://unattended-showing/../../../../src/-private/external/scheduler/scheduler.js","webpack://unattended-showing/../../../../../src/-private/external/scheduler/policies/unbounded-policy.js","webpack://unattended-showing/../../../src/-private/external/task-factory.js","webpack://unattended-showing/../../../../src/-private/external/task-instance/cancelation.js","webpack://unattended-showing/../../../../src/-private/external/task-instance/completion-states.js","webpack://unattended-showing/../../../src/-private/external/generator-state.js","webpack://unattended-showing/../../../../src/-private/external/task-instance/executor.js","webpack://unattended-showing/../../../../src/-private/external/task-instance/initial-state.js","webpack://unattended-showing/../../../../src/-private/external/task/default-state.js","webpack://unattended-showing/../../../../src/-private/external/task/task-group.js","webpack://unattended-showing/../../../../src/-private/external/task/task.js","webpack://unattended-showing/../../../../src/-private/external/task/taskable.js","webpack://unattended-showing/../../../src/-private/external/yieldables.js","webpack://unattended-showing/../../../src/-private/scheduler/ember-scheduler.js","webpack://unattended-showing/../../src/-private/task-factory.js","webpack://unattended-showing/../../src/-private/task-group.js","webpack://unattended-showing/../../../../src/-private/external/task-instance/base.js","webpack://unattended-showing/../../src/-private/task-instance.js","webpack://unattended-showing/../../src/-private/task-properties.js","webpack://unattended-showing/../../src/-private/task.js","webpack://unattended-showing/../../src/-private/taskable-mixin.js","webpack://unattended-showing/../../src/-private/tracked-state.js","webpack://unattended-showing/../../src/-private/async-arrow-runtime.js","webpack://unattended-showing/../../src/-private/utils.js","webpack://unattended-showing/../../../src/-private/external/task-decorators.js","webpack://unattended-showing/../../src/-private/task-decorators.js","webpack://unattended-showing/../../src/-private/cancelable-promise-helpers.js","webpack://unattended-showing/../src/index.js","webpack://unattended-showing/../index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/ember-focus-trap@1.1.1_ember-source@4.12.4_@babel+core@7.24.9_@glimmer+component@1.1.2_@babel_vvuia6snx5ae3hcxo6zlbkc3w4/node_modules/ember-focus-trap/dist/modifiers/focus-trap.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/ember-lifeline@7.0.0_@ember+test-helpers@3.1.0_@glint+template@1.4.0_ember-source@4.12.4_@bab_gwthlkopk5nm4tapzqbuz2i52i/node_modules/ember-lifeline/dist/cancel-task.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/ember-lifeline@7.0.0_@ember+test-helpers@3.1.0_@glint+template@1.4.0_ember-source@4.12.4_@bab_gwthlkopk5nm4tapzqbuz2i52i/node_modules/ember-lifeline/dist/run-task.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/ember-lifeline@7.0.0_@ember+test-helpers@3.1.0_@glint+template@1.4.0_ember-source@4.12.4_@bab_gwthlkopk5nm4tapzqbuz2i52i/node_modules/ember-lifeline/dist/utils/get-task.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/ember-lifeline@7.0.0_@ember+test-helpers@3.1.0_@glint+template@1.4.0_ember-source@4.12.4_@bab_gwthlkopk5nm4tapzqbuz2i52i/node_modules/ember-lifeline/dist/poll-task.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/ember-lifeline@7.0.0_@ember+test-helpers@3.1.0_@glint+template@1.4.0_ember-source@4.12.4_@bab_gwthlkopk5nm4tapzqbuz2i52i/node_modules/ember-lifeline/dist/debounce-task.js","webpack://unattended-showing/../src/-private/class-based/modifier-manager.ts","webpack://unattended-showing/../src/-private/class-based/modifier.ts","webpack://unattended-showing/../src/-private/function-based/modifier.ts","webpack://unattended-showing/../src/-private/function-based/modifier-manager.ts","webpack://unattended-showing/../../src/helpers/and.ts","webpack://unattended-showing/../../src/helpers/not.ts","webpack://unattended-showing/../../src/helpers/or.ts","webpack://unattended-showing/../../src/helpers/eq.ts","webpack://unattended-showing/../../src/helpers/not-eq.ts","webpack://unattended-showing/../../src/utils/truth-convert.ts","webpack://unattended-showing/../../../../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js","webpack://unattended-showing/../../src/utils/isBrowser.js","webpack://unattended-showing/../../src/utils/debounce.js","webpack://unattended-showing/../../src/utils/isFunction.js","webpack://unattended-showing/../../src/utils/getStyleComputedProperty.js","webpack://unattended-showing/../../src/utils/getParentNode.js","webpack://unattended-showing/../../src/utils/getScrollParent.js","webpack://unattended-showing/../../src/utils/getReferenceNode.js","webpack://unattended-showing/../../src/utils/isIE.js","webpack://unattended-showing/../../src/utils/getOffsetParent.js","webpack://unattended-showing/../../src/utils/getRoot.js","webpack://unattended-showing/../../src/utils/findCommonOffsetParent.js","webpack://unattended-showing/../../src/utils/isOffsetContainer.js","webpack://unattended-showing/../../src/utils/getScroll.js","webpack://unattended-showing/../../src/utils/getBordersSize.js","webpack://unattended-showing/../../src/utils/getWindowSizes.js","webpack://unattended-showing/../../src/utils/getClientRect.js","webpack://unattended-showing/../../src/utils/getBoundingClientRect.js","webpack://unattended-showing/../../src/utils/getOffsetRectRelativeToArbitraryNode.js","webpack://unattended-showing/../../src/utils/includeScroll.js","webpack://unattended-showing/../../src/utils/isFixed.js","webpack://unattended-showing/../../src/utils/getFixedPositionOffsetParent.js","webpack://unattended-showing/../../src/utils/getBoundaries.js","webpack://unattended-showing/../../src/utils/getViewportOffsetRectRelativeToArtbitraryNode.js","webpack://unattended-showing/../../src/utils/computeAutoPlacement.js","webpack://unattended-showing/../../src/utils/getReferenceOffsets.js","webpack://unattended-showing/../../src/utils/getOuterSizes.js","webpack://unattended-showing/../../src/utils/getOppositePlacement.js","webpack://unattended-showing/../../src/utils/getPopperOffsets.js","webpack://unattended-showing/../../src/utils/find.js","webpack://unattended-showing/../../src/utils/runModifiers.js","webpack://unattended-showing/../../src/utils/findIndex.js","webpack://unattended-showing/../../src/methods/update.js","webpack://unattended-showing/../../src/utils/isModifierEnabled.js","webpack://unattended-showing/../../src/utils/getSupportedPropertyName.js","webpack://unattended-showing/../../src/methods/destroy.js","webpack://unattended-showing/../../src/utils/getWindow.js","webpack://unattended-showing/../../src/utils/setupEventListeners.js","webpack://unattended-showing/../../src/methods/enableEventListeners.js","webpack://unattended-showing/../../src/methods/disableEventListeners.js","webpack://unattended-showing/../../src/utils/removeEventListeners.js","webpack://unattended-showing/../../src/utils/isNumeric.js","webpack://unattended-showing/../../src/utils/setStyles.js","webpack://unattended-showing/../../src/modifiers/computeStyle.js","webpack://unattended-showing/../../src/utils/isModifierRequired.js","webpack://unattended-showing/../../src/methods/placements.js","webpack://unattended-showing/../../src/utils/clockwise.js","webpack://unattended-showing/../../src/modifiers/index.js","webpack://unattended-showing/../../src/methods/defaults.js","webpack://unattended-showing/../../src/modifiers/shift.js","webpack://unattended-showing/../../src/modifiers/offset.js","webpack://unattended-showing/../../src/modifiers/preventOverflow.js","webpack://unattended-showing/../../src/modifiers/keepTogether.js","webpack://unattended-showing/../../src/modifiers/arrow.js","webpack://unattended-showing/../../src/modifiers/flip.js","webpack://unattended-showing/../../src/utils/getOppositeVariation.js","webpack://unattended-showing/../../src/modifiers/inner.js","webpack://unattended-showing/../../src/modifiers/hide.js","webpack://unattended-showing/../../src/utils/getRoundedOffsets.js","webpack://unattended-showing/../../src/modifiers/applyStyle.js","webpack://unattended-showing/../../src/utils/setAttributes.js","webpack://unattended-showing/../../src/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@babel+runtime@7.23.9/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@babel+runtime@7.23.9/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@babel+runtime@7.23.9/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@babel+runtime@7.23.9/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@babel+runtime@7.23.9/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@babel+runtime@7.23.9/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@babel+runtime@7.23.9/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/@babel+runtime@7.23.9/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns-tz@2.0.1_date-fns@2.29.3/node_modules/date-fns-tz/esm/_lib/newDateUTC/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns-tz@2.0.1_date-fns@2.29.3/node_modules/date-fns-tz/esm/_lib/tzTokenizeDate/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns-tz@2.0.1_date-fns@2.29.3/node_modules/date-fns-tz/esm/_lib/tzParseTimezone/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns-tz@2.0.1_date-fns@2.29.3/node_modules/date-fns-tz/esm/_lib/tzPattern/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns-tz@2.0.1_date-fns@2.29.3/node_modules/date-fns-tz/esm/toDate/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns-tz@2.0.1_date-fns@2.29.3/node_modules/date-fns-tz/esm/utcToZonedTime/index.js","webpack://unattended-showing/../../../../../node_modules/.pnpm/date-fns-tz@2.0.1_date-fns@2.29.3/node_modules/date-fns-tz/esm/zonedTimeToUtc/index.js","webpack://unattended-showing/../src/runtime.ts","webpack://unattended-showing/../../../../../node_modules/.pnpm/tslib@2.6.3/node_modules/tslib/tslib.es6.mjs"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{outlet}}\\n\",{ moduleName: \"unattended-showing/application/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

SGT 3.0 placeholder

\\n

Appointment Page

\\n
\\n \\n Return to home\\n \\n
\\n
\",{ moduleName: \"unattended-showing/context/appointment-sgt3/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n {{#each @appointments as |map|}}\\n
\\n

{{format-date map.day weekday=\\'long\\' month=\\'short\\' day=\\'numeric\\' year=\\'numeric\\'}}

\\n
\\n {{#each map.appointments as |appointment|}}\\n
\\n \\n {{#if (and @upcomingAppointments appointment.location.hasCommunitySiteMap)}}\\n Community Site Map\\n {{/if}}\\n
\\n {{#if @upcomingAppointments}}\\n
\\n \\n
\\n {{#if (and (not appointment.userCode) appointment.showCheckIn)}}\\n
\\n \\n
\\n {{else if (and (not appointment.userCode) appointment.activePendingIdVerification)}}\\n
\\n \\n
\\n {{/if}}\\n {{/if}}\\n
\\n
\\n {{/each}}\\n
\\n
\\n {{/each}}\\n
\\n\",{ moduleName: \"unattended-showing/components/appointment-list/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport templateOnlyComponent from '@ember/component/template-only';\nexport default templateOnlyComponent();","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n
\\n

My Scheduled Appointments

\\n \\n {{#if future}}\\n \\n {{else}}\\n

You have no upcoming appointments scheduled.

\\n {{/if}}\\n \\n
\\n\\n {{#if (or (is-pending this.pastAppointments) (await this.pastAppointments))}}\\n
\\n

Past Appointments

\\n {{#if (is-pending this.pastAppointments)}}\\n \\n {{else}}\\n \\n {{/if}}\\n
\\n {{/if}}\\n
\",{ moduleName: \"unattended-showing/context/appointment/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

SGT 3.0 placeholder

\\n

Bookings Page

\\n
\\n \\n Return to home\\n \\n
\\n
\",{ moduleName: \"unattended-showing/context/available-units-list-sgt3/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{#if (is-fulfilled @model.availableUnitsList)}}\\n
\\n
\\n \\\"Dealer\\\"\\n {{#if (await @model.availableUnitsList.locations)}}\\n
\\n \\n

Please select a unit to tour. You can only select one unit at a time.

\\n

If you\\'d like to view multiple units, please book two separate tours.

\\n
\\n {{#if @model.context.hasCommunitySiteMap}}\\n Community Site Map\\n {{/if}}\\n
\\n
\\n {{#each (await @model.availableUnitsList.locations) as |location|}}\\n \\n {{/each}}\\n
\\n \\n
\\n
\\n {{else}}\\n
\\n

We\\'re sorry, there are no homes available to tour at this time.

\\n
\\n {{/if}}\\n
\\n
\\n{{else}}\\n \\n{{/if}}\",{ moduleName: \"unattended-showing/context/available-units-list/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

SGT 3.0 placeholder

\\n

Change Password Page

\\n
\\n \\n Return to home\\n \\n
\\n
\",{ moduleName: \"unattended-showing/context/change-password-sgt3/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n \\n
\\n \\n {{#if this.sgtSession.isAuthenticated}}\\n Back to my profile\\n {{/if}}\\n
\\n
\",{ moduleName: \"unattended-showing/context/change-password/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\",{ moduleName: \"unattended-showing/context/credit-card-verification/account/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\",{ moduleName: \"unattended-showing/context/credit-card-verification/guest/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

SGT 3.0 placeholder

\\n

FAQ Page

\\n
\\n \\n Return to home\\n \\n
\\n
\",{ moduleName: \"unattended-showing/context/faq-sgt3/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{#if (is-fulfilled @model.context)}}\\n
\\n

Frequently Asked Questions

\\n {{#each (await this.pageContents) as |section|}}\\n

{{section.title}}

\\n {{#each section.questions as |question|}}\\n

{{question.title}}

\\n
    \\n {{#each question.answers as |answer|}}\\n
  • {{answer}}
  • \\n {{/each}}\\n
\\n {{/each}}\\n {{/each}}\\n
\\n{{else}}\\n \\n{{/if}}\",{ moduleName: \"unattended-showing/context/faq/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

SGT 3.0 placeholder

\\n

Forgot Password Page

\\n
\\n \\n Return to home\\n \\n
\\n
\",{ moduleName: \"unattended-showing/context/forgot-password-sgt3/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

Password Recovery

\\n

\\n Enter your email address below and we will send you the instructions to change the password.\\n

\\n
\\n
\\n \\n
\\n
\\n
\\n \\n
\\n
\\n\",{ moduleName: \"unattended-showing/context/forgot-password/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

SGT 3.0 placeholder

\\n

Appointment Page

\\n
\\n \\n Return to home\\n \\n
\\n
\\n
\\n {{#if (is-fulfilled @model)}}\\n
\\n

Appointment Info

\\n\\n
\\n appointment ID: {{this.model.appointment.appointmentId}}\\n
\\n\\n
\\n User ID: {{this.model.appointment.userId}}\\n
\\n
\\n {{else}}\\n \\n {{/if}}\\n
\",{ moduleName: \"unattended-showing/context/guest-appointment/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

Guest Details

\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\",{ moduleName: \"unattended-showing/context/guest-sign-up/template.hbs\" })","/**\n * Returns the formatted time zone name of the provided `timeZone` or the current\n * system time zone if omitted, accounting for DST according to the UTC value of\n * the date.\n */\nexport default function tzIntlTimeZoneName(length, date, options) {\n var dtf = getDTF(length, options.timeZone, options.locale)\n return dtf.formatToParts ? partsTimeZone(dtf, date) : hackyTimeZone(dtf, date)\n}\n\nfunction partsTimeZone(dtf, date) {\n var formatted = dtf.formatToParts(date)\n\n for (var i = formatted.length - 1; i >= 0; --i) {\n if (formatted[i].type === 'timeZoneName') {\n return formatted[i].value\n }\n }\n}\n\nfunction hackyTimeZone(dtf, date) {\n var formatted = dtf.format(date).replace(/\\u200E/g, '')\n var tzNameMatch = / [\\w-+ ]+$/.exec(formatted)\n return tzNameMatch ? tzNameMatch[0].substr(1) : ''\n}\n\n// If a locale has been provided `en-US` is used as a fallback in case it is an\n// invalid locale, otherwise the locale is left undefined to use the system locale.\nfunction getDTF(length, timeZone, locale) {\n if (locale && !locale.code) {\n throw new Error(\n \"date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`\"\n )\n }\n return new Intl.DateTimeFormat(locale ? [locale.code, 'en-US'] : undefined, {\n timeZone: timeZone,\n timeZoneName: length,\n })\n}\n","import tzIntlTimeZoneName from '../../_lib/tzIntlTimeZoneName/index.js'\nimport tzParseTimezone from '../../_lib/tzParseTimezone/index.js'\n\nvar MILLISECONDS_IN_MINUTE = 60 * 1000\n\nvar formatters = {\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, localize, options) {\n var timezoneOffset = getTimeZoneOffset(options.timeZone, date)\n\n if (timezoneOffset === 0) {\n return 'Z'\n }\n\n switch (token) {\n // Hours and optional minutes\n case 'X':\n return formatTimezoneWithOptionalMinutes(timezoneOffset)\n\n // Hours, minutes and optional seconds without `:` delimeter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case 'XXXX':\n case 'XX': // Hours and minutes without `:` delimeter\n return formatTimezone(timezoneOffset)\n\n // Hours, minutes and optional seconds with `:` delimeter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimeter\n default:\n return formatTimezone(timezoneOffset, ':')\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, localize, options) {\n var timezoneOffset = getTimeZoneOffset(options.timeZone, date)\n\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset)\n\n // Hours, minutes and optional seconds without `:` delimeter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case 'xxxx':\n case 'xx': // Hours and minutes without `:` delimeter\n return formatTimezone(timezoneOffset)\n\n // Hours, minutes and optional seconds with `:` delimeter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimeter\n default:\n return formatTimezone(timezoneOffset, ':')\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, localize, options) {\n var timezoneOffset = getTimeZoneOffset(options.timeZone, date)\n\n switch (token) {\n // Short\n case 'O':\n case 'OO':\n case 'OOO':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':')\n // Long\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':')\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, localize, options) {\n switch (token) {\n // Short\n case 'z':\n case 'zz':\n case 'zzz':\n return tzIntlTimeZoneName('short', date, options)\n // Long\n case 'zzzz':\n default:\n return tzIntlTimeZoneName('long', date, options)\n }\n },\n}\n\nfunction getTimeZoneOffset(timeZone, originalDate) {\n var timeZoneOffset = timeZone\n ? tzParseTimezone(timeZone, originalDate, true) / MILLISECONDS_IN_MINUTE\n : originalDate.getTimezoneOffset()\n if (Number.isNaN(timeZoneOffset)) {\n throw new RangeError('Invalid time zone specified: ' + timeZone)\n }\n return timeZoneOffset\n}\n\nfunction addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : ''\n var output = Math.abs(number).toString()\n while (output.length < targetLength) {\n output = '0' + output\n }\n return sign + output\n}\n\nfunction formatTimezone(offset, dirtyDelimeter) {\n var delimeter = dirtyDelimeter || ''\n var sign = offset > 0 ? '-' : '+'\n var absOffset = Math.abs(offset)\n var hours = addLeadingZeros(Math.floor(absOffset / 60), 2)\n var minutes = addLeadingZeros(Math.floor(absOffset % 60), 2)\n return sign + hours + delimeter + minutes\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimeter) {\n if (offset % 60 === 0) {\n var sign = offset > 0 ? '-' : '+'\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2)\n }\n return formatTimezone(offset, dirtyDelimeter)\n}\n\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\n var sign = offset > 0 ? '-' : '+'\n var absOffset = Math.abs(offset)\n var hours = Math.floor(absOffset / 60)\n var minutes = absOffset % 60\n if (minutes === 0) {\n return sign + String(hours)\n }\n var delimiter = dirtyDelimiter || ''\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2)\n}\n\nexport default formatters\n","import dateFnsFormat from 'date-fns/format/index.js'\nimport formatters from './formatters/index.js'\nimport toDate from '../toDate/index.js'\n\nvar tzFormattingTokensRegExp = /([xXOz]+)|''|'(''|[^'])+('|$)/g\n\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 8 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 8 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Su | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Su | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Su | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Su | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | AM, PM | a..aaa | AM, PM | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bbb | AM, PM, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 1, 2, ..., 11, 0 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 0001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | PDT, EST, CEST | 6 |\n * | | zzzz | Pacific Daylight Time | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 05/29/1453 | 7 |\n * | | PP | May 29, 1453 | 7 |\n * | | PPP | May 29th, 1453 | 7 |\n * | | PPPP | Sunday, May 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 05/29/1453, 12:00 AM | 7 |\n * | | PPpp | May 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | May 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Sunday, May 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).\n *\n * 6. Specific non-location timezones are created using the Intl browser API. The output is determined by the\n * preferred standard of the current locale (en-US by default) which may not always give the expected result.\n * For this reason it is recommended to supply a `locale` in the format options when formatting a time zone name.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. These tokens are often confused with others. See: https://git.io/fxCyr\n *\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole\n * library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The second argument is now required for the sake of explicitness.\n *\n * ```javascript\n * // Before v2.0.0\n * format(new Date(2016, 0, 1))\n *\n * // v2.0.0 onward\n * format(new Date(2016, 0, 1), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n * ```\n *\n * - New format string API for `format` function\n * which is based on [Unicode Technical Standard\n * #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table). See [this\n * post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.\n *\n * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options}\n * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link\n * https://date-fns.org/docs/toDate}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See\n * [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {Boolean} [options.awareOfUnicodeTokens=false] - if true, allows usage of Unicode tokens causes confusion:\n * - Some of the day of year tokens (`D`, `DD`) that are confused with the day of month tokens (`d`, `dd`).\n * - Some of the local week-numbering year tokens (`YY`, `YYYY`) that are confused with the calendar year tokens\n * (`yy`, `yyyy`). See: https://git.io/fxCyr\n * @param {String} [options.timeZone=''] - used to specify the IANA time zone offset of a date String.\n * @param {Date|Number} [options.originalDate] - can be used to pass the original unmodified date to `format` to\n * improve correctness of the replaced timezone token close to the DST threshold.\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} `options.awareOfUnicodeTokens` must be set to `true` to use `XX` token; see:\n * https://git.io/fxCyr\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * var result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * var result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {\n var formatStr = String(dirtyFormatStr)\n var options = dirtyOptions || {}\n\n var matches = formatStr.match(tzFormattingTokensRegExp)\n if (matches) {\n var date = toDate(options.originalDate || dirtyDate, options)\n // Work through each match and replace the tz token in the format string with the quoted\n // formatted time zone so the remaining tokens can be filled in by date-fns#format.\n formatStr = matches.reduce(function (result, token) {\n if (token[0] === \"'\") {\n return result // This is a quoted portion, matched only to ensure we don't match inside it\n }\n var pos = result.indexOf(token)\n var precededByQuotedSection = result[pos - 1] === \"'\"\n var replaced = result.replace(\n token,\n \"'\" + formatters[token[0]](date, token, null, options) + \"'\"\n )\n // If the replacement results in two adjoining quoted strings, the back to back quotes\n // are removed, so it doesn't look like an escaped quote.\n return precededByQuotedSection\n ? replaced.substring(0, pos - 1) + replaced.substring(pos + 1)\n : replaced\n }, formatStr)\n }\n\n return dateFnsFormat(dirtyDate, formatStr, options)\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"

\\n {{@key}}\\n {{@value}}\\n

\",{ moduleName: \"unattended-showing/components/key-value-display/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport templateOnlyComponent from '@ember/component/template-only';\n\nimport './_style.scss';\n\nexport interface KeyValueDisplaySignature {\n Args: {\n key: string;\n value: string;\n maskValue?: boolean;\n };\n}\n\nconst KeyValueDisplay = templateOnlyComponent();\nexport default KeyValueDisplay;\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n KeyValueDisplay: typeof KeyValueDisplay;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n
\\n {{#if @context.communityName}}\\n

{{@context.communityName}}

\\n {{/if}}\\n

{{@location.unitDescription}}

\\n

{{this.formattedAddress}}

\\n
\\n
\\n

Tour Info

\\n \\n \\n \\n \\n \\n
\\n

My Details

\\n \\n
\\n
\",{ moduleName: \"unattended-showing/components/tour-details/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { addMinutes } from 'date-fns';\nimport { formatInTimeZone } from 'date-fns-tz';\n\nimport type Appointment from 'unattended-showing/models/appointment';\nimport type ContextModel from 'unattended-showing/models/context';\nimport type LocationModel from 'unattended-showing/models/location';\nimport './_style.scss';\n\ninterface TourDetailsSignature {\n Element: HTMLDivElement;\n Args: {\n appointment: Appointment;\n context: ContextModel;\n location: LocationModel;\n targetMoveInDate: Date;\n };\n}\n\nexport default class TourDetails extends Component {\n /**\n * Format the location address to display.\n */\n get formattedAddress(): string {\n const location = this.args.location;\n let addressString = location.street1 + ', ';\n if (location.street2) {\n addressString += location.street2 + ', ';\n }\n addressString +=\n location.city + ', ' + location.state + ', ' + location.zipCode;\n return addressString;\n }\n\n /**\n * Format the tour time range to display in the format h:mm a - h:mm a.\n */\n get formattedTourTime(): string {\n const appointmentStartTime = this.args.appointment.dateTimeUtc,\n startTimeString = this.formatTimeInTimeZone(appointmentStartTime),\n appointmentEndTime = addMinutes(\n appointmentStartTime,\n this.args.context.appointmentLength\n );\n const endTimeString = this.formatTimeInTimeZone(appointmentEndTime);\n return `${startTimeString} - ${endTimeString}`;\n }\n\n /**\n * Format the given date in the format h:mm a in the location's local time zone.\n */\n formatTimeInTimeZone(date: Date): string {\n const { timeZone } = this.args.location;\n return formatInTimeZone(date, timeZone, 'h:mm a');\n }\n\n /**\n * Get the number of bedrooms and bathrooms for the unit in a formatted string.\n */\n get formattedUnitType(): string {\n const { location } = this.args;\n return `${location.numberOfBedrooms} bd, ${location.numberOfBathrooms} ba`;\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n TourDetails: typeof TourDetails;\n }\n}\n","import cloneObject from 'date-fns/_lib/cloneObject/index.js'\r\nimport format from '../format/index.js'\r\nimport utcToZonedTime from '../utcToZonedTime/index.js'\r\n\r\n/**\r\n * @name formatInTimeZone\r\n * @category Time Zone Helpers\r\n * @summary Gets the offset in milliseconds between the time zone and Universal Coordinated Time (UTC)\r\n *\r\n * @param {Date|String|Number} date - the date representing the local time / real UTC time\r\n * @param {String} timeZone - the time zone this date should be formatted for; can be an offset or IANA time zone\r\n * @param {String} formatStr - the string of tokens\r\n * @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options}\r\n * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link\r\n * https://date-fns.org/docs/toDate}\r\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\r\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\r\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See\r\n * [Locale]{@link https://date-fns.org/docs/Locale}\r\n * @param {Boolean} [options.awareOfUnicodeTokens=false] - if true, allows usage of Unicode tokens causes confusion:\r\n * - Some of the day of year tokens (`D`, `DD`) that are confused with the day of month tokens (`d`, `dd`).\r\n * - Some of the local week-numbering year tokens (`YY`, `YYYY`) that are confused with the calendar year tokens\r\n * (`yy`, `yyyy`). See: https://git.io/fxCyr\r\n * @param {String} [options.timeZone=''] - used to specify the IANA time zone offset of a date String.\r\n * @returns {String} the formatted date string\r\n */\r\nexport default function formatInTimeZone(date, timeZone, formatStr, options) {\r\n var extendedOptions = cloneObject(options)\r\n extendedOptions.timeZone = timeZone\r\n extendedOptions.originalDate = date\r\n return format(utcToZonedTime(date, timeZone), formatStr, extendedOptions)\r\n}\r\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

Review & Book

\\n \\n
\\n {{#if @context.hasTermsAndConditions}}\\n \\n I agree to the following\\n \\n Terms and Conditions\\n \\n \\n {{/if}}\\n
\\n \\n
\",{ moduleName: \"unattended-showing/components/review-and-book/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { dataUrlToObjectUrl } from 'unattended-showing/helpers/file-utils';\n\nimport type Appointment from 'unattended-showing/models/appointment';\nimport type ContextModel from 'unattended-showing/models/context';\nimport type LocationModel from 'unattended-showing/models/location';\nimport type Ajax from 'unattended-showing/services/ajax';\nimport './_style.scss';\n\ninterface ReviewAndBookSignature {\n Element: HTMLDivElement;\n Args: {\n appointment: Appointment;\n context: ContextModel;\n location: LocationModel;\n targetMoveInDate: Date;\n backAction: () => void;\n nextAction: () => void;\n };\n}\n\ninterface TermsPayload {\n value: string;\n}\n\nexport default class ReviewAndBook extends Component {\n @service declare ajax: Ajax;\n\n @tracked agreedToTermsAndConditions = false;\n\n /**\n * Check if the Book Tour button should be disabled.\n */\n get bookTourDisabled(): boolean {\n return (\n this.args.context.hasTermsAndConditions &&\n !this.agreedToTermsAndConditions\n );\n }\n\n /**\n * Opens a new tab for the terms and conditions.\n */\n @action async openTermsAndConditions(): Promise {\n const context = this.args.context;\n if (!context.termsAndConditionsObjectUrl) {\n const dataUrl = await this.ajax.apiRequest(\n `/fileUploads/terms/${context.systemGroupId}`\n );\n\n context.termsAndConditionsObjectUrl = dataUrlToObjectUrl(\n dataUrl.value\n );\n }\n\n window.open(\n context.termsAndConditionsObjectUrl,\n '_blank',\n 'noopener noreferrer'\n );\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n ReviewAndBook: typeof ReviewAndBook;\n }\n}\n","import startOfDay from \"../startOfDay/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameDay\n * @category Day Helpers\n * @summary Are the given dates in the same day (and year and month)?\n *\n * @description\n * Are the given dates in the same day (and year and month)?\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same day (and year and month)\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?\n * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))\n * //=> true\n *\n * @example\n * // Are 4 September and 4 October in the same day?\n * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))\n * //=> false\n *\n * @example\n * // Are 4 September, 2014 and 4 September, 2015 in the same day?\n * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))\n * //=> false\n */\n\nexport default function isSameDay(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeftStartOfDay = startOfDay(dirtyDateLeft);\n var dateRightStartOfDay = startOfDay(dirtyDateRight);\n return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();\n}","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

Book a Tour

\\n
\\n \\n \\n

{{item.props.relativeDate}}

\\n
\\n

{{format-date item.props.date weekday=\\'long\\'}}

\\n

{{format-date item.props.date month=\\'long\\' day=\\'numeric\\'}}

\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\",{ moduleName: \"unattended-showing/components/book-tour/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action, computed } from '@ember/object';\nimport { set } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { BinaryListItem } from '@adc/ui-components/components/simple-binary/list';\nimport DropdownSelectItem from '@adc/ui-components/utils/dropdown-select-item';\nimport {\n addDays,\n addMinutes,\n format,\n isAfter,\n isBefore,\n isEqual,\n isSameDay,\n isWithinInterval,\n startOfDay\n} from 'date-fns';\nimport { utcToZonedTime } from 'date-fns-tz';\n\nimport type ArrayProxy from '@ember/array/proxy';\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Appointment from 'unattended-showing/models/appointment';\nimport type LocationModel from 'unattended-showing/models/location';\nimport type SanitizedAppointment from 'unattended-showing/models/sanitized-appointment';\nimport type MockTimeService from 'unattended-showing/services/mock-time';\nimport './_style.scss';\n\ninterface BookTourSignature {\n Element: HTMLDivElement;\n Args: {\n appointment: Appointment;\n appointmentSettings: AppointmentSettings;\n location: LocationModel;\n targetMoveInDate?: Date;\n nextAction: (tourDateTime: Date, desiredMoveInDate: Date) => void;\n backAction: () => void;\n };\n}\n\ninterface AppointmentSettings {\n appointmentLength: number;\n hoursOfOperationSchedule: Timeblock[];\n}\n\ninterface Timeblock {\n day: number;\n startMinutesLocal: number;\n endMinutesLocal: number;\n}\n\ninterface DateListItemProps {\n date: Date;\n relativeDate: string;\n timeSlotOptions: DropdownSelectItem[];\n}\n\ninterface TimeSlot {\n startDateTime: Date;\n endDateTime?: Date;\n available: boolean;\n currentTimeSlot: boolean;\n}\n\ninterface UnavailablePeriod {\n startTime: Date;\n isTourNow: boolean;\n}\n\nexport default class BookTour extends Component {\n @service declare mockTime: MockTimeService;\n @service\n declare notificationManager: ServiceRegistry['notification-manager'];\n\n @tracked tourDate: Date | null = null;\n @tracked tourTime = '';\n @tracked desiredMoveInDate = this.desiredMoveInDateInitalValue;\n @tracked timeSlotSelectOptions: DropdownSelectItem[] = [];\n\n /**\n * Get the initial value to be used in the Desired Move-In Date datepicker. This value will come from the user's account if they are signed in.\n */\n get desiredMoveInDateInitalValue(): Date | null {\n return this.args.targetMoveInDate ?? null;\n }\n\n /**\n * Returns upcoming days for which appointment time slots can be booked.\n */\n @computed(\n 'args.location.{timeZone,unavailablePeriods}',\n 'maxTourDates',\n 'mockTime.mockTime',\n 'unavailablePeriods'\n )\n get appointmentDays(): Promise[]> {\n return (async () => {\n const { timeZone } = this.args.location || {},\n maxTourDates: number = 7;\n\n // Get time slots which are unavailable.\n const unavailablePeriodModelsUTC = await this.args.location\n .unavailablePeriods,\n unavailablePeriodsLocal: UnavailablePeriod[] =\n this.getUnavailablePeriods(\n unavailablePeriodModelsUTC,\n timeZone\n );\n\n // Generate the date list items to display on the form.\n const daySlots: BinaryListItem[] = [];\n for (let i = 0; i < maxTourDates; i++) {\n daySlots.push(\n this.getTourDateBinaryListItem(\n i,\n timeZone,\n unavailablePeriodsLocal\n )\n );\n }\n\n const initialTourDate = this.getTourDateInitialValue(daySlots);\n if (initialTourDate) {\n initialTourDate.state = true;\n this.setSelectedTourDate(initialTourDate);\n this.setTourTimeInitialValue(initialTourDate);\n }\n\n return daySlots;\n })();\n }\n\n /**\n * Sets the tour date that should be selected by default.\n */\n getTourDateInitialValue(\n daySlots: BinaryListItem[]\n ): BinaryListItem | undefined {\n const appointment = this.args.appointment;\n let selectedDate: BinaryListItem | undefined;\n if (appointment && appointment.dateTimeUtc) {\n // Select the existing appointment date.\n selectedDate = daySlots.find((dateItem) => {\n return isSameDay(\n dateItem.props.date,\n utcToZonedTime(\n appointment.dateTimeUtc,\n this.args.location.timeZone\n )\n );\n });\n if (selectedDate) {\n return selectedDate;\n }\n }\n // Select the first available date.\n selectedDate = daySlots.find((dateItem) => {\n return !dateItem.disabled;\n });\n return selectedDate;\n }\n\n /**\n * Set the initial selected tour time if the user has previously made a selection.\n */\n setTourTimeInitialValue(\n selectedDate: BinaryListItem\n ): void {\n const appointment = this.args.appointment;\n if (!appointment || !appointment.dateTimeUtc) {\n return;\n }\n\n const localAppointmentTime = utcToZonedTime(\n appointment.dateTimeUtc,\n this.args.location.timeZone\n ),\n selectedTime = selectedDate.props.timeSlotOptions.find(\n (timeSlot) => timeSlot.value === localAppointmentTime.toString()\n );\n\n if (selectedTime) {\n this.tourTime = selectedTime.value;\n }\n }\n\n /**\n * Builds a binary list option for a tour date.\n */\n getTourDateBinaryListItem(\n index: number,\n timeZone: string,\n unavailablePeriodsLocal: UnavailablePeriod[]\n ): BinaryListItem {\n const currentUnitDateLocal = this.getCurrentUnitDateLocal(timeZone);\n const today = startOfDay(currentUnitDateLocal);\n const day: Date = addDays(today, index);\n const timeSlotOptions = this.getAppointmentTimeSlots(\n day,\n unavailablePeriodsLocal\n );\n return new BinaryListItem({\n disabled: !this.hasAvailableTimeSlots(timeSlotOptions),\n props: {\n date: day,\n relativeDate: this.getRelativeDateText(day, today),\n timeSlotOptions: timeSlotOptions\n }\n });\n }\n\n /**\n * Checks a list of time slot dropdown options to see if at least one is available.\n */\n hasAvailableTimeSlots(timeSlotOptions: DropdownSelectItem[]): boolean {\n if (timeSlotOptions.length < 1) {\n return false;\n }\n const availableTimeSlot = timeSlotOptions.find((option) => {\n return !option.disabled;\n });\n return availableTimeSlot !== undefined;\n }\n\n /**\n * Get the 'Today', 'Tomorrow', or 'Future' language for a Tour Date button.\n */\n getRelativeDateText(buttonDate: Date, today: Date): string {\n if (isEqual(buttonDate, today)) {\n return 'Today';\n } else if (isEqual(buttonDate, addDays(today, 1))) {\n return 'Tomorrow';\n }\n return 'Future';\n }\n\n /**\n * Update the selected tour date when it is changed.\n */\n @action\n onTourDateChange(\n items: BinaryListItem[]\n ): Promise {\n return (async () => {\n const appointmentDays: BinaryListItem[] =\n await this.appointmentDays;\n const selectedItem =\n items.find((item) => item.state) ?? appointmentDays[0];\n this.setSelectedTourDate(selectedItem);\n this.tourTime = '';\n })();\n }\n\n /**\n * Sets the tour date and time slot options based on the given selected date button.\n */\n setSelectedTourDate(selectedItem: BinaryListItem): void {\n this.tourDate = selectedItem.props.date;\n this.timeSlotSelectOptions = selectedItem.props.timeSlotOptions;\n }\n\n /**\n * Get a list of time slot options for the Tour Time dropdown for a given date.\n */\n getAppointmentTimeSlots(\n date: Date,\n unavailablePeriodsLocal: UnavailablePeriod[]\n ): DropdownSelectItem[] {\n const { timeZone } = this.args.location || {},\n { appointmentLength } = this.args.appointmentSettings,\n currentUnitDateLocal = this.getCurrentUnitDateLocal(timeZone),\n timeSlotsLocal = this.getTimeSlotsLocal(date, currentUnitDateLocal);\n\n timeSlotsLocal\n .filter((timeSlot) => {\n return !this.isTimeSlotAvailable(\n timeSlot.startDateTime,\n unavailablePeriodsLocal,\n appointmentLength\n );\n })\n .forEach((t) => set(t, 'available', false));\n\n // Check if the first time slot is currently ongoing.\n if (timeSlotsLocal.length > 0) {\n if (\n this.hasStartTimePassed(timeSlotsLocal[0], currentUnitDateLocal)\n ) {\n timeSlotsLocal[0].currentTimeSlot = true;\n\n // If the first time slot is current and the second is unavailable, mark the first as unavailable as well.\n if (timeSlotsLocal.length > 1 && !timeSlotsLocal[1].available) {\n timeSlotsLocal[0].available = false;\n }\n }\n }\n\n return timeSlotsLocal.map((timeSlot) => {\n const timeSlotLabel: string =\n this.formatTimeSlotForDropdown(timeSlot);\n return DropdownSelectItem.create({\n name: timeSlotLabel,\n value: timeSlot.startDateTime.toString(),\n disabled: !timeSlot.available\n });\n });\n }\n\n /**\n * Checks if the given time slot has begun.\n */\n hasStartTimePassed(timeSlot: TimeSlot, currentDateTime: Date): boolean {\n return (\n isAfter(currentDateTime, timeSlot.startDateTime) ||\n isEqual(currentDateTime, timeSlot.startDateTime)\n );\n }\n\n /**\n * Get the periods that are unavailable for tours.\n */\n getUnavailablePeriods(\n unavailablePeriodModelsUTC: ArrayProxy,\n timeZone: string\n ): UnavailablePeriod[] {\n return unavailablePeriodModelsUTC.map((unavailablePeriodModel) => {\n const dateTimeUTC = new Date(unavailablePeriodModel.dateTimeUtc),\n dateTimeLocal = utcToZonedTime(dateTimeUTC, timeZone),\n isTourNow = unavailablePeriodModel.isTourNow;\n return {\n startTime: dateTimeLocal,\n isTourNow: isTourNow\n };\n });\n }\n\n /**\n * Checks whether the given time slot is available (does not conflict with unavailable periods).\n */\n isTimeSlotAvailable(\n timeSlotStart: Date,\n unavailablePeriods: UnavailablePeriod[],\n appointmentLength: number\n ): boolean {\n return unavailablePeriods.every((unavailablePeriod) => {\n const timeSlotEnd = this.getAppointmentEndDate(\n timeSlotStart,\n appointmentLength\n ),\n unavailablePeriodEnd = this.getAppointmentEndDate(\n unavailablePeriod.startTime,\n unavailablePeriod.isTourNow\n ? appointmentLength * 2\n : appointmentLength\n );\n\n if (\n isEqual(timeSlotStart, unavailablePeriodEnd) ||\n isEqual(timeSlotEnd, unavailablePeriod.startTime)\n ) {\n return true;\n }\n\n const unavailableInterval = {\n start: unavailablePeriod.startTime,\n end: unavailablePeriodEnd\n },\n startAvailable = !isWithinInterval(\n timeSlotStart,\n unavailableInterval\n ),\n endAvailable = !isWithinInterval(\n timeSlotEnd,\n unavailableInterval\n );\n\n return startAvailable && endAvailable;\n });\n }\n\n /**\n * Get the string to show for a time slot in the Tour Time dropdown.\n */\n formatTimeSlotForDropdown(timeSlot: TimeSlot): string {\n if (timeSlot.currentTimeSlot) {\n return 'Tour Now';\n }\n return timeSlot.startDateTime.toLocaleString('en-US', {\n hour: 'numeric',\n minute: '2-digit'\n });\n }\n\n /**\n * Get the upcoming and current time slots for the given day.\n * @return List of upcoming and current time slots.\n */\n getTimeSlotsLocal(targetDay: Date, currentUnitDateLocal: Date): TimeSlot[] {\n let timeSlotsLocal: TimeSlot[] = [];\n\n // If the property is not getting their available times from a CRM integration, generate them.\n if (this.args.location.appointmentTimeSlotsFromCrmLocal == undefined) {\n timeSlotsLocal = this.generateTimeSlotsForDay(\n targetDay,\n currentUnitDateLocal\n );\n } else {\n timeSlotsLocal = this.getTimeSlotsFromCrmLocal(\n targetDay,\n currentUnitDateLocal\n );\n }\n\n return timeSlotsLocal.filter((slot) => slot.available);\n }\n\n /**\n * Generates all time slots, available and unavailable, for a given day based on the hours of operation schedule.\n */\n generateTimeSlotsForDay(\n targetDay: Date,\n currentUnitDateLocal: Date\n ): TimeSlot[] {\n const { appointmentLength, hoursOfOperationSchedule } =\n this.args.appointmentSettings;\n\n // Get the timeblocks for the selected day.\n const filteredTimeblocks = hoursOfOperationSchedule?.filter(\n (timeblock) => timeblock.day === targetDay.getDay()\n ),\n timeSlots: TimeSlot[] = [];\n\n // Iterate through the timeblocks and add appointment slots.\n let previousStartTime: Date;\n filteredTimeblocks?.forEach(\n ({ startMinutesLocal, endMinutesLocal }) => {\n for (\n let currentTime = startMinutesLocal;\n currentTime <= endMinutesLocal;\n currentTime += appointmentLength\n ) {\n const startDateTime = new Date(targetDay);\n startDateTime.setMinutes(currentTime);\n const endDateTime = this.getAppointmentEndDate(\n new Date(startDateTime),\n appointmentLength\n );\n\n // Check for duplicated time slots before adding\n // as duplicates can occur when the time changes for daylight savings.\n if (\n !previousStartTime ||\n isAfter(startDateTime, previousStartTime)\n ) {\n timeSlots.push({\n startDateTime,\n available: isAfter(\n endDateTime,\n currentUnitDateLocal\n ),\n currentTimeSlot: false\n });\n previousStartTime = startDateTime;\n }\n }\n }\n );\n\n return timeSlots;\n }\n\n /**\n * Generates all time slots, available and unavailable, based on time slots given by the CRM.\n */\n getTimeSlotsFromCrmLocal(\n targetDay: Date,\n currentUnitDateLocal: Date\n ): TimeSlot[] {\n const timeSlots: TimeSlot[] = [];\n\n this.args.location.appointmentTimeSlotsFromCrmLocal.forEach(\n (slot: string) => {\n const startDateLocal = new Date(slot);\n const endDateLocal = this.getAppointmentEndDate(\n startDateLocal,\n this.args.appointmentSettings.appointmentLength\n );\n\n // Filter out time slots for different days and time slots that have already ended.\n if (\n !isSameDay(startDateLocal, targetDay) ||\n !isAfter(endDateLocal, currentUnitDateLocal)\n ) {\n return;\n }\n\n // Check that time slots do not overlap (CRM time slots do not come with an end time).\n const previousSlot = timeSlots[timeSlots.length - 1];\n if (\n previousSlot?.endDateTime &&\n previousSlot?.endDateTime > startDateLocal\n ) {\n return;\n }\n\n timeSlots.push({\n startDateTime: startDateLocal,\n endDateTime: endDateLocal,\n available: true,\n currentTimeSlot: false\n });\n }\n );\n\n return timeSlots;\n }\n\n /**\n * Update the selected tour time when it is changed.\n */\n @action\n onTourTimeChange(newTime: string): void {\n this.tourTime = newTime;\n }\n\n /**\n * Update the selected desired move-in date when it is changed.\n */\n @action\n onDesiredMoveInDateChange(newDate: Date): void {\n this.desiredMoveInDate = newDate;\n }\n\n /**\n * Get the current day in the location's time zone. If mock time is being used, this will return the mock time.\n */\n getCurrentUnitDateLocal(timeZone: string): Date {\n return (\n this.mockTime.mockTime ??\n new Date(new Date().toLocaleString('en-US', { timeZone: timeZone }))\n );\n }\n\n /**\n * Get end time of appointment.\n */\n getAppointmentEndDate(startTime: Date, appointmentLength: number): Date {\n return addMinutes(startTime, appointmentLength);\n }\n\n /**\n * Get the minimum allowable move-in date for the date picker. The minimum date will be the current day.\n */\n get minMoveInDate(): Date {\n const today = new Date();\n return today;\n }\n\n /**\n * Get the maximum allowable move-in date for the date picker. The maximum date will be a year from the current day.\n */\n get maxMoveInDate(): Date {\n const maxDate = new Date();\n maxDate.setFullYear(maxDate.getFullYear() + 1);\n return maxDate;\n }\n\n /**\n * Format a Date object as a string in the format YYYY-MM-DD.\n */\n toFormattedString(date: Date): string {\n return format(date, 'yyyy-MM-dd');\n }\n\n /**\n * Validates user input and sends it to the server if it is valid.\n */\n @action\n async nextAction(): Promise {\n if (!this.validateUserInputs()) {\n return;\n }\n\n const tourDateTime = new Date(this.tourTime);\n const desiredMoveInDate = this.desiredMoveInDate!;\n this.args.nextAction(tourDateTime, desiredMoveInDate);\n }\n\n /**\n * Determines whether the user inputs are valid and adds the appropriate errors to the NotificationManager.\n */\n validateUserInputs(): boolean {\n // TODO: This method may need to be updated in POINT-6942 depending on how errors will be displayed.\n if (!this.tourTime) {\n this.notificationManager.addError('Tour time is required.');\n return false;\n }\n\n if (!this.desiredMoveInDate) {\n this.notificationManager.addError(\n 'Desired move-in date is required.'\n );\n return false;\n } else if (isBefore(this.desiredMoveInDate, this.minMoveInDate)) {\n this.notificationManager.addError(\n 'Desired move-in date must not be in the past.'\n );\n return false;\n } else if (isAfter(this.desiredMoveInDate, this.maxMoveInDate)) {\n this.notificationManager.addError(\n 'Desired move-in date must not be more than a year from today.'\n );\n return false;\n }\n\n return true;\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n BookTour: typeof BookTour;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n {{#if @model.location.hasAppointment}}\\n

You\\'re Booked!

\\n {{else if this.showReviewAndBook}}\\n \\n {{else}}\\n \\n {{/if}}\\n
\",{ moduleName: \"unattended-showing/context/location-sgt3/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n \\n I agree to the following Terms and Conditions\\n \\n\\n
\\n \\n \\n
\\n\",{ moduleName: \"unattended-showing/components/modals/terms-and-conditions/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { dataUrlToObjectUrl } from 'unattended-showing/helpers/file-utils';\n\n/**\n * @classdesc\n * The modal that prompts the user to accept the terms and conditions.\n */\nexport default class TermsAndConditionsModal extends Component {\n @service modals;\n @service ajax;\n\n @tracked isChecked = false;\n\n /**\n * Opens a new tab for the terms and conditions.\n *\n * @function\n */\n @action async openTermsAndConditions(ev) {\n ev.preventDefault();\n\n const context = this.args.model.context;\n if (!context.termsAndConditionsObjectUrl) {\n const dataUrl = await this.ajax.apiRequest(\n `/fileUploads/terms/${context.systemGroupId}`\n );\n\n context.termsAndConditionsObjectUrl = dataUrlToObjectUrl(\n dataUrl.value\n );\n }\n\n window.open(\n context.termsAndConditionsObjectUrl,\n '_blank',\n 'noopener noreferrer'\n );\n }\n\n /**\n * Closes the modal.\n */\n @action closeAction() {\n this.modals.closeModal();\n }\n\n /**\n * Performs the save action and then closes the modal\n * @returns {Promise}\n */\n @action saveAndCloseAction() {\n return this.args.model.saveAction().then(() => this.closeAction());\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n {{#if @model.hasAppointment}}\\n {{#if (is-fulfilled @model.nextAppointment)}}\\n {{#if @model.nextAppointment.gateCode}}\\n
\\n
\\n

{{@model.nextAppointment.gateCode}}

\\n

\\n GATE CODE\\n
\\n Use this code to access the parking area.\\n

\\n
\\n
\\n {{/if}}\\n {{#if @model.nextAppointment.userCode}}\\n
\\n
\\n

You\\'re all set!

\\n

{{@model.nextAppointment.userCode}}

\\n

\\n PIN CODE\\n
\\n Use this to access the property and unit\\n {{#if (await this.shouldDisplayNow)}}\\n from now until\\n {{else}}\\n on\\n {{format-date (await this.nextAppointmentLocalTime) weekday=\\'long\\' month=\\'long\\' day=\\'numeric\\' year=\\'numeric\\'}}\\n from\\n {{format-date (await this.nextAppointmentLocalTime) hour=\\'numeric\\' minute=\\'2-digit\\'}}\\n -\\n {{/if}}\\n {{format-date (await this.nextAppointmentLocalEndTime) hour=\\'numeric\\' minute=\\'2-digit\\'}}.\\n

\\n
\\n
\\n \\n
\\n
\\n {{else if @model.nextAppointment.showCheckIn}}\\n
\\n
\\n \\n

You\\'re Booked!

\\n

\\n \\n {{format-date (await this.nextAppointmentLocalTime) weekday=\\'long\\' month=\\'long\\' day=\\'numeric\\' year=\\'numeric\\'}}\\n \\n

\\n

\\n {{format-date (await this.nextAppointmentLocalTime) hour=\\'numeric\\' minute=\\'2-digit\\'}} -\\n {{format-date (await this.nextAppointmentLocalEndTime) hour=\\'numeric\\' minute=\\'2-digit\\'}}\\n

\\n
\\n \\n \\n
\\n {{else if @model.nextAppointment.activePendingIdVerification}}\\n
\\n

Check Your Texts

\\n

We sent you a link to verify your ID.

\\n
\\n \\n \\n
\\n
\\n {{else}}\\n
\\n
\\n \\n

You\\'re Booked!

\\n

\\n \\n {{format-date (await this.nextAppointmentLocalTime) weekday=\\'long\\' month=\\'long\\' day=\\'numeric\\' year=\\'numeric\\'}}\\n \\n

\\n

\\n {{format-date (await this.nextAppointmentLocalTime) hour=\\'numeric\\' minute=\\'2-digit\\'}} -\\n {{format-date (await this.nextAppointmentLocalEndTime) hour=\\'numeric\\' minute=\\'2-digit\\'}}\\n

\\n
\\n
\\n

\\n {{#if (and @model.geofenceEnabled @model.checkpointIdEnabled)}}\\n We\\'ll let you know when it\\'s time to check-in. Please note that you may need to log in and verify your location and ID.\\n {{else if @model.checkpointIdEnabled}}\\n We\\'ll let you know when it\\'s time to check-in. Please note that you may need to log in and verify your ID.\\n {{else if @model.geofenceEnabled}}\\n We\\'ll let you know when it\\'s time to check-in. Please note that you may need to log in and verify your location.\\n {{else}}\\n Check back here at the time of your tour to view your PIN code. It will also be sent to you via text and email.\\n {{/if}}\\n

\\n \\n
\\n
\\n {{/if}}\\n {{else}}\\n \\n {{/if}}\\n {{!-- If user tried to book appointment prior to logging in/signing-up, temporary load while appointment saves --}}\\n {{else if this.loginPendingBooking.enableTemporaryLoading}}\\n \\n {{else}}\\n
\\n

Schedule a Visit

\\n {{#if @model.checkpointIdEnabled}}\\n \\n
\\n \\n This unit requires you to upload your ID and take a live selfie in order to tour.\\n \\n
\\n {{/if}}\\n {{#if @model.geofenceEnabled}}\\n \\n
\\n \\n This unit requires you to share your location and confirm you are on site in order to tour.\\n \\n
\\n {{/if}}\\n
\\n {{#each this.appointmentDays as |day|}}\\n \\n
{{format-date day weekday=\\'short\\'}}
\\n
{{format-date day month=\\'short\\' day=\\'numeric\\'}}
\\n
\\n {{/each}}\\n
\\n

Please note the times below are in the community\\'s local time zone ({{@model.timeZoneAbbreviation}}).

\\n {{#if (await this.hasFutureAppointmentSlots)}}\\n
    \\n {{#each (await this.appointmentTimeSlots) as |slot|}}\\n
  • \\n
    \\n {{format-date slot.startDateTime hour=\\'numeric\\' minute=\\'2-digit\\'}}\\n
    \\n
    \\n \\n {{#if slot.available}}\\n {{#if slot.currentTimeSlot}}\\n Tour Now\\n {{else}}\\n Book Tour\\n {{/if}}\\n {{else}}\\n Unavailable\\n {{/if}}\\n \\n
    \\n
  • \\n {{/each}}\\n
\\n {{else}}\\n
There are no available times for this day.
\\n {{/if}}\\n
\\n {{/if}}\\n\\n\",{ moduleName: \"unattended-showing/components/appointment-schedule/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { set } from '@ember/object';\nimport { action, computed } from '@ember/object';\nimport { alias, not } from '@ember/object/computed';\nimport { inject as service } from '@ember/service';\nimport { utcToZonedTime } from 'date-fns-tz';\nimport addDays from 'date-fns/addDays';\nimport addMinutes from 'date-fns/addMinutes';\nimport isAfter from 'date-fns/isAfter';\nimport isEqual from 'date-fns/isEqual';\nimport isWithinInterval from 'date-fns/isWithinInterval';\nimport startOfDay from 'date-fns/startOfDay';\nimport { datesAreOnSameDay } from '../../utils/datetime-utils';\nimport TermsAndConditionsModal from '../modals/terms-and-conditions/index';\n\n/**\n * Component for showing, scheduling, and deleting Self-Guided Tours time slots.\n */\nexport default class AppointmentSchedule extends Component {\n @service loginPendingBooking;\n @service checkIn;\n @service modals;\n @service mockTime;\n\n /**\n * Whether the appointment table should be shown or if there is already an existing appointment and we\n * want to hide the table.\n *\n * @type {boolean}\n */\n @not('args.model.hasAppointment')\n hasNoAppointment;\n\n /**\n * Stores selected appointment datetime.\n *\n * @type {Date}\n */\n selectedDate = null;\n\n /**\n * Number of days for which appointments can be booked in advance. There is currently no dealer setting for this.\n * Need to consult with PM to see if this is desired.\n *\n * @type {Number}\n */\n days = 7;\n\n /**\n * Get the collection of unavailable appointment blocks for this community.\n *\n * @type {Array<{models.SanitizedAppointment}>}\n */\n @alias('args.model.unavailablePeriods')\n unavailablePeriods;\n\n /**\n * Get end time of appointment.\n *\n * @param {Date} date\n * @param {Number} appointmentLength\n *\n * @returns {Date}\n */\n getAppointmentEndDate(date, appointmentLength) {\n return addMinutes(date, appointmentLength);\n }\n\n /**\n * Checks whether the time slot is available.\n *\n * @param {{startDateTime: {Date}, available: {boolean}}} timeSlotStart\n * @param {[Date]} unavailablePeriods\n * @param {Number} appointmentLength\n *\n * @returns {boolean}\n */\n isTimeSlotAvailable(timeSlotStart, unavailablePeriods, appointmentLength) {\n return unavailablePeriods.every((unavailablePeriod) => {\n const timeSlotEnd = this.getAppointmentEndDate(\n timeSlotStart,\n appointmentLength\n ),\n unavailablePeriodEnd = this.getAppointmentEndDate(\n unavailablePeriod.startTime,\n unavailablePeriod.isTourNow\n ? appointmentLength * 2\n : appointmentLength\n );\n\n if (\n isEqual(timeSlotStart, unavailablePeriodEnd) ||\n isEqual(timeSlotEnd, unavailablePeriod.startTime)\n ) {\n return true;\n }\n\n const unavailableInterval = {\n start: unavailablePeriod.startTime,\n end: unavailablePeriodEnd\n },\n startAvailable = !isWithinInterval(\n timeSlotStart,\n unavailableInterval\n ),\n endAvailable = !isWithinInterval(\n timeSlotEnd,\n unavailableInterval\n );\n\n return startAvailable && endAvailable;\n });\n }\n\n /**\n * Returns upcoming days for which appointment time slots can be booked.\n *\n * @type {[Date]}\n */\n @computed('args.model.timeZone', 'days', 'mockTime.mockTime')\n get appointmentDays() {\n const { timeZone } = this.args.model || {};\n const currentUnitDateLocal = new Date(\n new Date().toLocaleString('en-US', { timeZone: timeZone })\n );\n const today = startOfDay(\n this.mockTime.mockTime ?? currentUnitDateLocal\n );\n let daySlots = Array.from(new Array(this.days), (_, index) =>\n addDays(today, index)\n );\n\n // eslint-disable-next-line ember/no-side-effects\n set(this, 'selectedDate', daySlots[0]);\n return daySlots;\n }\n\n /**\n * Returns the NextAppointment's dateTimeUtc in local time. The dateTimeLocal property on the appointment model\n * is a date time object adjusted to the system's local timezone.\n *\n * @type {[Date]}\n */\n @computed('args.model.nextAppointment')\n get nextAppointmentLocalTime() {\n return (async () => {\n const nextAppointment = await this.args.model.nextAppointment;\n return nextAppointment.dateTimeLocal;\n })();\n }\n\n /**\n * Determines if the start time should be changed to 'now'.\n *\n * @returns {Boolean}\n */\n @computed('args.model.nextAppointment')\n get shouldDisplayNow() {\n return (async () => {\n // Compare the dateTimeUtc to the current time. The value of dateTimeUtc is automatically\n // converted from UTC to the time zone of the browser.\n const nextAppointment = await this.args.model.nextAppointment;\n return new Date() >= nextAppointment.dateTimeUtc;\n })();\n }\n\n /**\n * Returns the NextAppointment's end dateTimeUtc in local time. The dateTimeLocal property on the appointment model\n * is a date time object adjusted to the system's local timezone.\n *\n * @type {[Date]}\n */\n @computed(\n 'nextAppointmentLocalTime',\n 'args.{appointmentSettings.appointmentLength,model.nextAppointment}'\n )\n get nextAppointmentLocalEndTime() {\n return (async () => {\n const appointmentTime = await this.nextAppointmentLocalTime,\n appointmentEndTime = new Date(appointmentTime),\n nextAppointment = await this.args.model.nextAppointment;\n let length = nextAppointment.length;\n\n return new Date(\n appointmentEndTime.setMinutes(\n appointmentTime.getMinutes() + length\n )\n );\n })();\n }\n\n /**\n * Returns objects required to build appointment time slot rows.\n *\n * @type {Array<{startDateTime: {Date}, available: {Boolean}}>}\n */\n @computed(\n 'args.{appointmentSettings,model.timeZone,model.appointmentTimeSlotsFromCrmLocal}',\n 'mockTime.mockTime',\n 'selectedDate',\n 'unavailablePeriods.[]'\n )\n get appointmentTimeSlots() {\n return (async () => {\n const { timeZone } = await this.args.model,\n unavailablePeriodModelsUTC = await this.unavailablePeriods,\n { appointmentLength } = this.args.appointmentSettings,\n currentUnitDateLocal = new Date(\n new Date().toLocaleString('en-US', { timeZone: timeZone })\n ),\n timeSlotsLocal = this.getTimeSlotsLocal(\n this.mockTime.mockTime ?? currentUnitDateLocal\n );\n\n // Get location's unavailable times.\n const unavailablePeriodsLocal = unavailablePeriodModelsUTC.map(\n (model) => {\n const dateTimeUTC = new Date(model.dateTimeUtc),\n dateTimeLocal = utcToZonedTime(dateTimeUTC, timeZone),\n isTourNow = model.isTourNow;\n return {\n startTime: dateTimeLocal,\n isTourNow: isTourNow\n };\n }\n );\n\n // Set time slots which are unavailable for appointment.\n timeSlotsLocal\n .filter((timeSlot) => {\n return !this.isTimeSlotAvailable(\n timeSlot.startDateTime,\n unavailablePeriodsLocal,\n appointmentLength\n );\n })\n .forEach((t) => set(t, 'available', false));\n\n // If we have at least one time slot available, mark it as TOUR NOW.\n if (timeSlotsLocal.length > 0) {\n if (\n isAfter(\n this.mockTime.mockTime ?? currentUnitDateLocal,\n timeSlotsLocal[0].startDateTime\n )\n ) {\n timeSlotsLocal[0].currentTimeSlot = true;\n }\n\n // If the first time slot is current and the second is unavailable, mark the first as unavailable as well.\n if (timeSlotsLocal.length > 1) {\n if (\n !timeSlotsLocal[1].available &&\n timeSlotsLocal[0].currentTimeSlot\n ) {\n timeSlotsLocal[0].available = false;\n }\n }\n }\n\n return timeSlotsLocal;\n })();\n }\n\n @computed('appointmentTimeSlots')\n get hasFutureAppointmentSlots() {\n return (async () => {\n const slots = await this.appointmentTimeSlots;\n return slots.length > 0;\n })();\n }\n\n /**\n * Returns the time slots for display, with past slots filtered out.\n */\n getTimeSlotsLocal(currentUnitDateLocal) {\n let timeSlotsLocal;\n\n // If the property is not getting their available times from a CRM integration, generate them.\n if (this.args.model.appointmentTimeSlotsFromCrmLocal == undefined) {\n timeSlotsLocal = this.generateTimeSlotsForDay(currentUnitDateLocal);\n } else {\n timeSlotsLocal = this.getTimeSlotsForCrmLocal(currentUnitDateLocal);\n }\n\n return timeSlotsLocal.filter((slot) => slot.available);\n }\n\n /**\n * Generates time slots for the given date using the hours of operation schedule.\n */\n generateTimeSlotsForDay(currentUnitDateLocal) {\n const { appointmentLength, hoursOfOperationSchedule } =\n this.args.appointmentSettings,\n targetDay = this.selectedDate;\n\n if (!targetDay) {\n return [];\n }\n\n // Get the timeblocks for the selected day.\n const filteredTimeblocks = hoursOfOperationSchedule.filter(\n (tb) => tb.day === targetDay.getDay()\n ),\n appointments = [];\n\n // Iterate through the timeblocks and add appointment slots.\n filteredTimeblocks.forEach(({ startMinutesLocal, endMinutesLocal }) => {\n for (\n let currentTime = startMinutesLocal;\n currentTime <= endMinutesLocal;\n currentTime += appointmentLength\n ) {\n const startDateTime = new Date(targetDay);\n startDateTime.setMinutes(currentTime);\n const endDateTime = this.getAppointmentEndDate(\n new Date(startDateTime),\n appointmentLength\n );\n appointments.push({\n startDateTime,\n available: isAfter(endDateTime, currentUnitDateLocal),\n currentTimeSlot: false\n });\n }\n });\n\n return appointments;\n }\n\n /**\n * Filters down and returns the time slots for the given date, only for properties with CRM integrations.\n */\n getTimeSlotsForCrmLocal(currentUnitDateLocal) {\n const timeSlots = [];\n\n this.args.model.appointmentTimeSlotsFromCrmLocal.forEach((slot) => {\n const startDateLocal = new Date(slot);\n const endDateLocal = this.getAppointmentEndDate(\n startDateLocal,\n this.args.appointmentSettings.appointmentLength\n );\n\n // Time slot needs to be for the selected date and the end date needs to be past right now.\n if (\n !datesAreOnSameDay(startDateLocal, this.selectedDate) ||\n !isAfter(endDateLocal, currentUnitDateLocal)\n ) {\n return;\n }\n\n // Since CRM time slots do not come with an end time, we need to make sure they don't overlap.\n const previousSlot = timeSlots[timeSlots.length - 1];\n if (previousSlot?.endDateTime > startDateLocal) {\n return;\n }\n\n timeSlots.push({\n startDateTime: startDateLocal,\n endDateTime: endDateLocal,\n available: true,\n currentTimeSlot: false\n });\n });\n\n return timeSlots;\n }\n\n /**\n * Open terms and conditions modal.\n *\n * @param {Date} startDateTime\n */\n @action openTermsAndConditionsModal(startDateTime) {\n this.modals.showModal(TermsAndConditionsModal, {\n saveAction: () => this.args.saveAction(startDateTime),\n context: this.args.context\n });\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{#if (is-fulfilled @model)}}\\n
\\n
\\n
\\n \\n
\\n
\\n
{{@model.location.unitDescription}}
\\n
{{@model.location.streetAddress}}
\\n
{{@model.location.region}}
\\n
\\n
\\n {{#each @model.location.availableDetails as |detail|}}\\n {{! hide rent if = \\'-\\'. See location model}}\\n {{#if (not-eq detail.value \\'-\\')}}\\n
\\n
{{detail.value}}
\\n
{{detail.title}}
\\n
\\n {{/if}}\\n {{/each}}\\n
\\n {{#if @model.context.hasCommunitySiteMap}}\\n
\\n Community Site Map\\n
\\n {{/if}}\\n
\\n \\n
\\n{{else}}\\n \\n{{/if}}\",{ moduleName: \"unattended-showing/context/location/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n
\\n

Log In

\\n
\\n \\n \\n \\n \\n Reset password\\n \\n \\n \\n \\n
\\n \\n \\n
\",{ moduleName: \"unattended-showing/context/login-sgt3/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

Login to Self-Guided Tours

\\n
\\n
\\n
\\n {{!-- template-lint-disable require-input-label --}}\\n \\n
\\n
\\n {{!-- template-lint-disable require-input-label --}}\\n \\n
\\n
\\n
\\n \\n
Forgot your password? Reset it
\\n
\\n
\\n\\n\\n

Don\\'t have an account?

\\n
\\n Sign up for an account\\n
\\n
\\n\\n\\n\",{ moduleName: \"unattended-showing/context/login/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\",{ moduleName: \"unattended-showing/context/logout/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

Oops

\\n

The page you tried to reach is not available. That\\'s all we know, please go back to the property manager\\'s website to continue searching for properties.

\\n
\\n \\n Return to home\\n \\n
\\n
\",{ moduleName: \"unattended-showing/context/not-found/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

Verify Your Phone

\\n

We sent a code to your phone number

\\n
\\n
\\n {{#each this.verificationCode as |digit index|}}\\n \\n {{/each}}\\n
\\n \\n \\n
\\n
\\n
\\n

Still need help?

\\n Click here for assistance\\n
\\n
\\n\\n\",{ moduleName: \"unattended-showing/components/phone-verification/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nimport './_style.scss';\n\ninterface VerificationCodeArgs {\n onSubmit: (code: string) => void;\n onResend: () => void;\n needHelpRoute: string;\n}\nexport default class PhoneVerification extends Component {\n verificationCode: string[] = Array(6).fill('');\n @tracked isCodeComplete = false;\n\n @action\n handleInput(index: number, event: InputEvent): void {\n const input = event.target as HTMLInputElement;\n\n // If the input is not a single number, 0-9, clear the value.\n if (!input.value.match(/^\\d$/)) {\n input.value = '';\n }\n\n this.verificationCode[index] = input.value;\n this.updateIsCodeComplete();\n this.updateFocus();\n }\n\n @action\n handleKeyDown(index: number, event: KeyboardEvent): void {\n // When the user hits backspace on an empty input box,\n // move the focus to the previous input box.\n if (event.key === 'Backspace' && index > 0) {\n const input = event.target as HTMLInputElement;\n if (input.value === '') {\n (\n document.querySelectorAll('.digit-input')[\n index - 1\n ] as HTMLInputElement\n ).focus();\n }\n }\n }\n\n @action\n handlePaste(event: ClipboardEvent): void {\n const pasteData = event.clipboardData?.getData('text') || '';\n // If the user tries to copy and past a 6 digit code,\n // then fill in the input.\n if (pasteData.match(/^\\d{6}$/)) {\n pasteData.split('').forEach((value, index) => {\n this.verificationCode[index] = value;\n // Directly set the value of the input field so the component re-renders.\n (\n document.querySelectorAll('.digit-input')[\n index\n ] as HTMLInputElement\n ).value = value;\n });\n\n this.updateIsCodeComplete();\n this.updateFocus();\n }\n event.preventDefault();\n }\n\n @action\n submitCode(): void {\n if (this.isCodeComplete) {\n // Execute onSubmit function passed in from parent.\n this.args.onSubmit(this.verificationCode.join(''));\n }\n }\n\n @action\n resendCode(): void {\n // Execute onResend function passed in from parent.\n this.args.onResend();\n }\n\n private updateFocus(): void {\n let nextEmptyIndex = this.verificationCode.findIndex(\n (digit) => digit === ''\n );\n\n // if the code has been filled in, set the focus to the last input.\n if (nextEmptyIndex === -1) {\n nextEmptyIndex = this.verificationCode.length - 1;\n }\n\n (\n document.querySelectorAll('.digit-input')[\n nextEmptyIndex\n ] as HTMLInputElement\n ).focus();\n }\n\n private updateIsCodeComplete(): void {\n this.isCodeComplete = this.verificationCode.every(\n (digit) => digit !== ''\n );\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n PhoneVerification: typeof PhoneVerification;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\",{ moduleName: \"unattended-showing/context/phone-verification/guest/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

SGT 3.0 placeholder

\\n

Profile Page

\\n
\\n \\n Return to home\\n \\n
\\n
\",{ moduleName: \"unattended-showing/context/profile-sgt3/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n
\\n \\n
\\n \\n \\n \\n Change my password\\n \\n
\\n
\\n\\n\",{ moduleName: \"unattended-showing/context/profile/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n
\\n

Sign Up

\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n
\",{ moduleName: \"unattended-showing/context/sign-up-sgt3/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

Sign Up for a Self-Guided Tours Account

\\n
\\n {{#each this.userInfoFields as |field|}}\\n \\n {{/each}}\\n\\n {{#each this.userPasswordFields as |field|}}\\n \\n {{/each}}\\n
\\n
\\n \\n
Already have an account? Login
\\n
\\n
\",{ moduleName: \"unattended-showing/context/sign-up/index/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{outlet}}\",{ moduleName: \"unattended-showing/context/sign-up/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n \\n {{#each this.addressInfoFields as |field|}}\\n \\n {{/each}}\\n \\n\\n
\\n \\n
\\n
\",{ moduleName: \"unattended-showing/context/sign-up/verification/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n \\n {{#if this.sgtSession.isAuthenticated}}\\n \\n <:default as |trigger|>\\n \\n \\n <:responsive-header as |ResponsiveHeader|>\\n \\n \\n \\n {{#if (and this.profileMenuIsActive (media \\'isMobile\\'))}}\\n
\\n {{/if}}\\n {{/if}}\\n
\",{ moduleName: \"unattended-showing/components/app-header-sgt3/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { inject as service } from '@ember/service';\nimport DropdownActionItem from '@adc/ui-components/utils/dropdown-action-item';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\n\ninterface AppHeaderSgt3Signature {\n Args: {\n serverLogoUrl: string;\n };\n}\n\n/**\n * Component for application header bar.\n */\nexport default class AppHeaderSgt3 extends Component {\n @service declare router: ServiceRegistry['router'];\n @service declare sgtSession: ServiceRegistry['sgt-session'];\n\n @tracked\n profileMenuIsActive = false;\n\n /**\n * Get the DropdownActionItems to build the profile menu options.\n */\n get menuItems(): DropdownActionItem[] {\n return [\n ['My Profile', 'profile-sgt3'],\n ['My Appointments', 'appointment-sgt3'],\n ['Logout', 'logout']\n ].map(([name, route]) =>\n DropdownActionItem.create({\n name,\n action: () => this.router.transitionTo(`context.${route}`)\n })\n );\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n AppHeaderSgt3: typeof AppHeaderSgt3;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n \\n \\'Dealer\\'\\n \\n
\\n \\n Terms\\n \\n \\n Privacy Policy\\n \\n
\\n
\\n\",{ moduleName: \"unattended-showing/components/app-footer-sgt3/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { computed } from '@ember/object';\n\ninterface AppFooterSgt3Signature {\n Args: {\n hasPointCentralDealer: boolean;\n };\n}\n\n/**\n * Component for application footer.\n */\nexport default class AppFooterSgt3 extends Component {\n /**\n * Path to 'powered by' image.\n */\n @computed('args.hasPointCentralDealer')\n get poweredByLogoSrc(): string {\n return this.args.hasPointCentralDealer\n ? '/app/assets/images/poweredbyPC-sgt3.png'\n : '/app/assets/images/powered_by_adc.png';\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n AppFooterSgt3: typeof AppFooterSgt3;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n {{#if @icon}}\\n \\n {{/if}}\\n {{@text}}\\n\\n\",{ moduleName: \"unattended-showing/components/header-link.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './header-link.hbs'; */\nimport templateOnlyComponent from '@ember/component/template-only';\nexport default templateOnlyComponent();","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n \\n \\n \\n\\n \",{ moduleName: \"unattended-showing/components/app-header/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { computed, action } from '@ember/object';\nimport { inject as service } from '@ember/service';\n\n/**\n * Component for application header bar.\n */\nexport default class AppHeader extends Component {\n @service sgtSession;\n\n /**\n * Dealer logo's URL.\n *\n * @type {String}\n */\n get serverLogoUrl() {\n return this.args.serverLogoUrl ?? '';\n }\n\n /**\n * Whether menu items are collapsed in narrow windows.\n *\n * @type {Boolean}\n * @default true\n */\n @tracked isCollapsed = true;\n\n /**\n * Get the logged-in user's name.\n *\n * @function\n * @returns {String}\n */\n @computed('sgtSession.{data.authenticated.userName,isAuthenticated}')\n get username() {\n return this.sgtSession.isAuthenticated\n ? this.sgtSession.data.authenticated.userName\n : 'Login';\n }\n\n /**\n * Set menu to collapsed state when user clicks on something.\n *\n * @function\n */\n @action handleClick() {\n this.isCollapsed = true;\n }\n\n /**\n * Toggles collapsed state.\n *\n * @function\n */\n @action toggleMenu() {\n this.isCollapsed = !this.isCollapsed;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n \\n \\n \\n {{#if this.showSGT3}}\\n \\n
\\n {{outlet}}\\n
\\n \\n {{else}}\\n \\n {{outlet}}\\n \\n {{/if}}\\n \\n
\",{ moduleName: \"unattended-showing/context/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n \\n\\n
\\n
\\n
\\n

Self-Guided Tours:
The New Way to Tour

\\n

Say goodbye to keys in a key box

\\n

Builders and property managers, here is a way to increase showing hours, shorten vacancy periods, save money, and impress prospective residents and buyers.

\\n

Self-Guided Tours enables prospective residents and buyers to schedule a tour whenever it is convenient for them, using a temporary digital smart key that keeps all access secure and accountable.

\\n {{#each this.titleAreaCheckList as |item|}}\\n
\\n \\n {{item}}\\n
\\n {{/each}}\\n
\\n
\\n
\\n\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n {{#each this.howItWorksSteps as |step|}}\\n
\\n

{{step.step}}

\\n

{{step.text}}

\\n
\\n {{/each}}\\n
\\n
\\n\\n
\\n
\\n

A Solution for All Property Types

\\n
\\n
\\n
\\n \\n
\\n Builders\\n
\\n
\\n
\\n \\n
\\n Property Managers\\n
\\n
\\n {{#each this.solutionExplanation as |step|}}\\n
\\n
\\n
\\n \\n {{#if (not-eq step.icon \\\"phone\\\")}}\\n
\\n {{/if}}\\n
\\n
\\n
\\n {{#if step.homeOwner}}\\n
\\n {{/if}}\\n {{#if step.propertyManager}}\\n
\\n {{/if}}\\n
\\n

\\n {{step.header}}\\n
{{step.description}}\\n

\\n
\\n
\\n
\\n {{/each}}\\n
\\n
\\n\\n
\\n

Want a Free Demo?

\\n \\n
\\n\\n
\\n
\\n

FAQs

\\n {{#each this.faq as |section|}}\\n
\\n

{{section.section}}

\\n {{#each section.questions as |question|}}\\n
\\n \\n \\n
\\n
    \\n {{#each question.answers as |answer|}}\\n
  • {{answer}}
  • \\n {{/each}}\\n
\\n
\\n
\\n {{/each}}\\n
\\n {{/each}}\\n
\\n
\\n
\\n\\n \\n
\\n\",{ moduleName: \"unattended-showing/index/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\",{ moduleName: \"unattended-showing/loading/template.hbs\" })","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

Oops

\\n

The page you tried to reach is not available. That\\'s all we know, please go back to the property manager\\'s website to continue searching for properties.

\\n
\",{ moduleName: \"unattended-showing/not-found/template.hbs\" })","import { getCookie } from '@adc/ember-utils/utils/browser-helpers';\nimport { BuildURLMixin } from '@ember-data/adapter';\nimport { inject as service } from '@ember/service';\nimport { isEmpty } from '@ember/utils';\nimport {\n InvalidAntiForgeryToken,\n ServerProcessingError,\n ProcessingError\n} from '@adc/ajax/enums/AjaxResponseHttpCode';\nimport BaseAdapter from '@adc/app-infrastructure/adapters/base-adapter';\n\n/**\n * @classdesc\n * Sets up properties for communicating with the backend.\n */\nexport default class ApplicationAdapter extends BaseAdapter.extend(\n BuildURLMixin\n) {\n @service notificationManager;\n @service sgtSession;\n\n /**\n * Namespace for API requests.\n */\n namespace = 'api';\n\n /**\n * Handles cases where AFG is invalid or login has expired. Application will reload\n * to get new AFG if AFG has expired or invalidate session if authentication JWT is expired.\n *\n * @param status {Number}\n * @param error {String}\n */\n handleError(status, error) {\n // Handle the case where an anti-forgery token is not valid\n // or is missing or if there is a server error. For either case,\n // we invalidate the current user session.\n if (\n status === ServerProcessingError ||\n status === InvalidAntiForgeryToken\n ) {\n this.notificationManager.addError(error);\n this.sgtSession.invalidate();\n }\n }\n\n /**\n * Expected request headers appended to each request.\n *\n * @override\n *\n * @function\n * @returns {{Accept: {String}, Content-Type: {String}, AjaxRequestUniqueKey: {String}, Authorization: {String}}}\n */\n get headers() {\n const headers = {\n Accept: 'application/vnd.api+json',\n 'Content-Type': 'application/json',\n AjaxRequestUniqueKey: getCookie('afg')\n };\n\n // Set Ember Simple Auth login token on header.\n const { token } = this.sgtSession.data.authenticated;\n if (!isEmpty(token)) {\n headers.Authorization = token;\n }\n\n return headers;\n }\n\n // region normalizing responses\n /**\n * @param {number} status\n * @param {Object} headers\n * @param {Object} payload\n *\n * @returns {Array} errors payload\n */\n normalizeErrorResponse(status, headers, payload) {\n payload = payload || { errors: null };\n const errors = payload.errors || [{ detail: null }];\n\n // Handle errors.\n errors.forEach((error) =>\n this.handleError(parseInt(error.status), error.detail)\n );\n\n const errorMessages = errors\n .map((error) => error.detail)\n .filter((error) => error);\n\n // Is this a processing error then add to notification manager.\n if (status === ProcessingError) {\n errors\n .filter(({ code }) => code === ProcessingError)\n .forEach(({ detail }) =>\n this.notificationManager.addError(detail)\n );\n\n return errors;\n }\n\n return errorMessages.length ? errorMessages : null;\n }\n\n /** @override **/\n findRecord(store, type, id, snapshot) {\n // If query parameters are passed in to findRecord, then send it along with GET request.\n if (snapshot.adapterOptions?.queryParams) {\n const url = this.buildURL(\n type.modelName,\n id,\n snapshot,\n 'findRecord'\n );\n\n return this.ajax(url, 'GET', {\n data: snapshot.adapterOptions.queryParams\n });\n }\n\n // Otherwise, just call base implementation.\n return super.findRecord(...arguments);\n }\n}\n","import require from 'require';\nfunction resolveInitializer(moduleName) {\n var module = require(moduleName, null, null, true);\n if (!module) {\n throw new Error(moduleName + ' must export an initializer.');\n }\n var initializer = module['default'];\n if (!initializer) {\n throw new Error(moduleName + ' must have a default export');\n }\n if (!initializer.name) {\n initializer.name = moduleName.slice(moduleName.lastIndexOf('/') + 1);\n }\n return initializer;\n}\nfunction registerInitializers(app, moduleNames) {\n for (var i = 0; i < moduleNames.length; i++) {\n app.initializer(resolveInitializer(moduleNames[i]));\n }\n}\nfunction registerInstanceInitializers(app, moduleNames) {\n for (var i = 0; i < moduleNames.length; i++) {\n app.instanceInitializer(resolveInitializer(moduleNames[i]));\n }\n}\nfunction _endsWith(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n}\n\n/**\n * Configure your application as it boots\n */\nexport default function loadInitializers(app, prefix) {\n var initializerPrefix = prefix + '/initializers/';\n var instanceInitializerPrefix = prefix + '/instance-initializers/';\n var initializers = [];\n var instanceInitializers = [];\n // this is 2 pass because generally the first pass is the problem\n // and is reduced, and resolveInitializer has potential to deopt\n var moduleNames = Object.keys(requirejs._eak_seen);\n for (var i = 0; i < moduleNames.length; i++) {\n var moduleName = moduleNames[i];\n if (moduleName.lastIndexOf(initializerPrefix, 0) === 0) {\n if (!_endsWith(moduleName, '-test')) {\n initializers.push(moduleName);\n }\n } else if (moduleName.lastIndexOf(instanceInitializerPrefix, 0) === 0) {\n if (!_endsWith(moduleName, '-test')) {\n instanceInitializers.push(moduleName);\n }\n }\n }\n registerInitializers(app, initializers);\n registerInstanceInitializers(app, instanceInitializers);\n}","import Application from '@ember/application';\nimport loadInitializers from 'ember-load-initializers';\nimport Resolver from 'ember-resolver';\nimport config from 'unattended-showing/config/environment';\n\n// Style imports for webpack\nimport './assets/styles/app.scss';\n// Imports for v2 addon styles\nimport '@adc/ui-components/addon.scss';\n\nexport default class App extends Application {\n modulePrefix = config.modulePrefix;\n podModulePrefix = config.podModulePrefix;\n Resolver = Resolver;\n}\n\nloadInitializers(App, config.modulePrefix);\n","import { action } from '@ember/object';\nimport Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\n/**\n * @classdesc\n * The main application route.\n */\nexport default class ApplicationRoute extends Route {\n @service notificationManager;\n @service sgtSession;\n @service errorReporting;\n @service store;\n @service intl;\n @service router;\n\n async beforeModel() {\n this.intl.setLocale('en-US');\n await this.sgtSession.setup();\n }\n\n /** @override **/\n afterModel() {\n // Start Sentry Error Reporting\n this.errorReporting.initializeForSession();\n }\n\n /**\n * Error handler for the application.\n *\n * @param errors {Object}\n */\n @action error(errors) {\n let errorMessages = errors?.errors?.errors ?? errors?.errors ?? [];\n\n // Make sure errorMessages is an array.\n if (typeof errorMessages === 'string') {\n errorMessages = [errorMessages];\n }\n\n // Show the error message and then let the error reporting service handle it.\n errorMessages.forEach((error) =>\n this.notificationManager.addError(error)\n );\n\n // Redirect to error page.\n this.router.replaceWith('not-found', 'not-found');\n\n // Let error reporting report the error.\n throw errors;\n }\n}\n","\nimport { importSync as i, macroCondition, getGlobalConfig } from '@embroider/macros';\nlet w = window;\nlet d = w.define;\n\n\ni(\"./-embroider-implicit-modules.js\");\n\nd(\"unattended-showing/adapters/application\", function(){ return i(\"unattended-showing/adapters/application.js\");});\nd(\"unattended-showing/app\", function(){ return i(\"unattended-showing/app.js\");});\nd(\"unattended-showing/application/route\", function(){ return i(\"unattended-showing/application/route.js\");});\nd(\"unattended-showing/application/template\", function(){ return i(\"unattended-showing/application/template.hbs\");});\nd(\"unattended-showing/authenticators/credentials\", function(){ return i(\"unattended-showing/authenticators/credentials.js\");});\nd(\"unattended-showing/classes/base-route\", function(){ return i(\"unattended-showing/classes/base-route.js\");});\nd(\"unattended-showing/classes/interfaces/requests/credit-card-verification-request\", function(){ return i(\"unattended-showing/classes/interfaces/requests/credit-card-verification-request.ts\");});\nd(\"unattended-showing/classes/interfaces/responses/credit-card-verification-guest-response\", function(){ return i(\"unattended-showing/classes/interfaces/responses/credit-card-verification-guest-response.ts\");});\nd(\"unattended-showing/classes/protected-route\", function(){ return i(\"unattended-showing/classes/protected-route.js\");});\nd(\"unattended-showing/config/environment\", function(){ return i(\"unattended-showing/config/environment.js\");});\nd(\"unattended-showing/context/appointment-sgt3/route\", function(){ return i(\"unattended-showing/context/appointment-sgt3/route.ts\");});\nd(\"unattended-showing/context/appointment-sgt3/template\", function(){ return i(\"unattended-showing/context/appointment-sgt3/template.hbs\");});\nd(\"unattended-showing/context/appointment/controller\", function(){ return i(\"unattended-showing/context/appointment/controller.js\");});\nd(\"unattended-showing/context/appointment/route\", function(){ return i(\"unattended-showing/context/appointment/route.js\");});\nd(\"unattended-showing/context/appointment/template\", function(){ return i(\"unattended-showing/context/appointment/template.hbs\");});\nd(\"unattended-showing/context/available-units-list-sgt3/route\", function(){ return i(\"unattended-showing/context/available-units-list-sgt3/route.ts\");});\nd(\"unattended-showing/context/available-units-list-sgt3/template\", function(){ return i(\"unattended-showing/context/available-units-list-sgt3/template.hbs\");});\nd(\"unattended-showing/context/available-units-list/controller\", function(){ return i(\"unattended-showing/context/available-units-list/controller.js\");});\nd(\"unattended-showing/context/available-units-list/route\", function(){ return i(\"unattended-showing/context/available-units-list/route.js\");});\nd(\"unattended-showing/context/available-units-list/template\", function(){ return i(\"unattended-showing/context/available-units-list/template.hbs\");});\nd(\"unattended-showing/context/change-password-sgt3/route\", function(){ return i(\"unattended-showing/context/change-password-sgt3/route.ts\");});\nd(\"unattended-showing/context/change-password-sgt3/template\", function(){ return i(\"unattended-showing/context/change-password-sgt3/template.hbs\");});\nd(\"unattended-showing/context/change-password/controller\", function(){ return i(\"unattended-showing/context/change-password/controller.js\");});\nd(\"unattended-showing/context/change-password/route\", function(){ return i(\"unattended-showing/context/change-password/route.js\");});\nd(\"unattended-showing/context/change-password/template\", function(){ return i(\"unattended-showing/context/change-password/template.hbs\");});\nd(\"unattended-showing/context/controller\", function(){ return i(\"unattended-showing/context/controller.ts\");});\nd(\"unattended-showing/context/credit-card-verification/account/controller\", function(){ return i(\"unattended-showing/context/credit-card-verification/account/controller.ts\");});\nd(\"unattended-showing/context/credit-card-verification/account/route\", function(){ return i(\"unattended-showing/context/credit-card-verification/account/route.ts\");});\nd(\"unattended-showing/context/credit-card-verification/account/template\", function(){ return i(\"unattended-showing/context/credit-card-verification/account/template.hbs\");});\nd(\"unattended-showing/context/credit-card-verification/guest/controller\", function(){ return i(\"unattended-showing/context/credit-card-verification/guest/controller.ts\");});\nd(\"unattended-showing/context/credit-card-verification/guest/route\", function(){ return i(\"unattended-showing/context/credit-card-verification/guest/route.ts\");});\nd(\"unattended-showing/context/credit-card-verification/guest/template\", function(){ return i(\"unattended-showing/context/credit-card-verification/guest/template.hbs\");});\nd(\"unattended-showing/context/faq-sgt3/route\", function(){ return i(\"unattended-showing/context/faq-sgt3/route.ts\");});\nd(\"unattended-showing/context/faq-sgt3/template\", function(){ return i(\"unattended-showing/context/faq-sgt3/template.hbs\");});\nd(\"unattended-showing/context/faq/controller\", function(){ return i(\"unattended-showing/context/faq/controller.js\");});\nd(\"unattended-showing/context/faq/template\", function(){ return i(\"unattended-showing/context/faq/template.hbs\");});\nd(\"unattended-showing/context/forgot-password-sgt3/route\", function(){ return i(\"unattended-showing/context/forgot-password-sgt3/route.ts\");});\nd(\"unattended-showing/context/forgot-password-sgt3/template\", function(){ return i(\"unattended-showing/context/forgot-password-sgt3/template.hbs\");});\nd(\"unattended-showing/context/forgot-password/controller\", function(){ return i(\"unattended-showing/context/forgot-password/controller.js\");});\nd(\"unattended-showing/context/forgot-password/route\", function(){ return i(\"unattended-showing/context/forgot-password/route.js\");});\nd(\"unattended-showing/context/forgot-password/template\", function(){ return i(\"unattended-showing/context/forgot-password/template.hbs\");});\nd(\"unattended-showing/context/guest-appointment/controller\", function(){ return i(\"unattended-showing/context/guest-appointment/controller.ts\");});\nd(\"unattended-showing/context/guest-appointment/route\", function(){ return i(\"unattended-showing/context/guest-appointment/route.ts\");});\nd(\"unattended-showing/context/guest-appointment/template\", function(){ return i(\"unattended-showing/context/guest-appointment/template.hbs\");});\nd(\"unattended-showing/context/guest-sign-up/controller\", function(){ return i(\"unattended-showing/context/guest-sign-up/controller.ts\");});\nd(\"unattended-showing/context/guest-sign-up/route\", function(){ return i(\"unattended-showing/context/guest-sign-up/route.ts\");});\nd(\"unattended-showing/context/guest-sign-up/template\", function(){ return i(\"unattended-showing/context/guest-sign-up/template.hbs\");});\nd(\"unattended-showing/context/location-sgt3/controller\", function(){ return i(\"unattended-showing/context/location-sgt3/controller.ts\");});\nd(\"unattended-showing/context/location-sgt3/route\", function(){ return i(\"unattended-showing/context/location-sgt3/route.ts\");});\nd(\"unattended-showing/context/location-sgt3/template\", function(){ return i(\"unattended-showing/context/location-sgt3/template.hbs\");});\nd(\"unattended-showing/context/location/controller\", function(){ return i(\"unattended-showing/context/location/controller.js\");});\nd(\"unattended-showing/context/location/route\", function(){ return i(\"unattended-showing/context/location/route.js\");});\nd(\"unattended-showing/context/location/template\", function(){ return i(\"unattended-showing/context/location/template.hbs\");});\nd(\"unattended-showing/context/login-sgt3/controller\", function(){ return i(\"unattended-showing/context/login-sgt3/controller.ts\");});\nd(\"unattended-showing/context/login-sgt3/route\", function(){ return i(\"unattended-showing/context/login-sgt3/route.ts\");});\nd(\"unattended-showing/context/login-sgt3/template\", function(){ return i(\"unattended-showing/context/login-sgt3/template.hbs\");});\nd(\"unattended-showing/context/login/controller\", function(){ return i(\"unattended-showing/context/login/controller.js\");});\nd(\"unattended-showing/context/login/route\", function(){ return i(\"unattended-showing/context/login/route.js\");});\nd(\"unattended-showing/context/login/template\", function(){ return i(\"unattended-showing/context/login/template.hbs\");});\nd(\"unattended-showing/context/logout/route\", function(){ return i(\"unattended-showing/context/logout/route.js\");});\nd(\"unattended-showing/context/logout/template\", function(){ return i(\"unattended-showing/context/logout/template.hbs\");});\nd(\"unattended-showing/context/not-found/template\", function(){ return i(\"unattended-showing/context/not-found/template.hbs\");});\nd(\"unattended-showing/context/phone-verification/base/controller\", function(){ return i(\"unattended-showing/context/phone-verification/base/controller.ts\");});\nd(\"unattended-showing/context/phone-verification/guest/controller\", function(){ return i(\"unattended-showing/context/phone-verification/guest/controller.ts\");});\nd(\"unattended-showing/context/phone-verification/guest/route\", function(){ return i(\"unattended-showing/context/phone-verification/guest/route.ts\");});\nd(\"unattended-showing/context/phone-verification/guest/template\", function(){ return i(\"unattended-showing/context/phone-verification/guest/template.hbs\");});\nd(\"unattended-showing/context/profile-sgt3/route\", function(){ return i(\"unattended-showing/context/profile-sgt3/route.ts\");});\nd(\"unattended-showing/context/profile-sgt3/template\", function(){ return i(\"unattended-showing/context/profile-sgt3/template.hbs\");});\nd(\"unattended-showing/context/profile/controller\", function(){ return i(\"unattended-showing/context/profile/controller.js\");});\nd(\"unattended-showing/context/profile/route\", function(){ return i(\"unattended-showing/context/profile/route.js\");});\nd(\"unattended-showing/context/profile/template\", function(){ return i(\"unattended-showing/context/profile/template.hbs\");});\nd(\"unattended-showing/context/redirect/route\", function(){ return i(\"unattended-showing/context/redirect/route.js\");});\nd(\"unattended-showing/context/route\", function(){ return i(\"unattended-showing/context/route.js\");});\nd(\"unattended-showing/context/sign-up-sgt3/controller\", function(){ return i(\"unattended-showing/context/sign-up-sgt3/controller.ts\");});\nd(\"unattended-showing/context/sign-up-sgt3/route\", function(){ return i(\"unattended-showing/context/sign-up-sgt3/route.ts\");});\nd(\"unattended-showing/context/sign-up-sgt3/template\", function(){ return i(\"unattended-showing/context/sign-up-sgt3/template.hbs\");});\nd(\"unattended-showing/context/sign-up/index/controller\", function(){ return i(\"unattended-showing/context/sign-up/index/controller.js\");});\nd(\"unattended-showing/context/sign-up/index/route\", function(){ return i(\"unattended-showing/context/sign-up/index/route.js\");});\nd(\"unattended-showing/context/sign-up/index/template\", function(){ return i(\"unattended-showing/context/sign-up/index/template.hbs\");});\nd(\"unattended-showing/context/sign-up/template\", function(){ return i(\"unattended-showing/context/sign-up/template.hbs\");});\nd(\"unattended-showing/context/sign-up/verification/controller\", function(){ return i(\"unattended-showing/context/sign-up/verification/controller.js\");});\nd(\"unattended-showing/context/sign-up/verification/route\", function(){ return i(\"unattended-showing/context/sign-up/verification/route.js\");});\nd(\"unattended-showing/context/sign-up/verification/template\", function(){ return i(\"unattended-showing/context/sign-up/verification/template.hbs\");});\nd(\"unattended-showing/context/template\", function(){ return i(\"unattended-showing/context/template.hbs\");});\nd(\"unattended-showing/enums/Country\", function(){ return i(\"unattended-showing/enums/Country.ts\");});\nd(\"unattended-showing/enums/LinkUrl\", function(){ return i(\"unattended-showing/enums/LinkUrl.ts\");});\nd(\"unattended-showing/index/controller\", function(){ return i(\"unattended-showing/index/controller.js\");});\nd(\"unattended-showing/index/route\", function(){ return i(\"unattended-showing/index/route.js\");});\nd(\"unattended-showing/index/template\", function(){ return i(\"unattended-showing/index/template.hbs\");});\nd(\"unattended-showing/instance-initializers/env-settings\", function(){ return i(\"unattended-showing/instance-initializers/env-settings.js\");});\nd(\"unattended-showing/loading/template\", function(){ return i(\"unattended-showing/loading/template.hbs\");});\nd(\"unattended-showing/models/appointment\", function(){ return i(\"unattended-showing/models/appointment.ts\");});\nd(\"unattended-showing/models/available-units-list\", function(){ return i(\"unattended-showing/models/available-units-list.js\");});\nd(\"unattended-showing/models/base-location\", function(){ return i(\"unattended-showing/models/base-location.ts\");});\nd(\"unattended-showing/models/context\", function(){ return i(\"unattended-showing/models/context.js\");});\nd(\"unattended-showing/models/country\", function(){ return i(\"unattended-showing/models/country.ts\");});\nd(\"unattended-showing/models/credit-card-verification\", function(){ return i(\"unattended-showing/models/credit-card-verification.ts\");});\nd(\"unattended-showing/models/external-identifier\", function(){ return i(\"unattended-showing/models/external-identifier.js\");});\nd(\"unattended-showing/models/guest-appointment\", function(){ return i(\"unattended-showing/models/guest-appointment.ts\");});\nd(\"unattended-showing/models/guest-sign-up\", function(){ return i(\"unattended-showing/models/guest-sign-up.ts\");});\nd(\"unattended-showing/models/location\", function(){ return i(\"unattended-showing/models/location.ts\");});\nd(\"unattended-showing/models/phone-verification-guest\", function(){ return i(\"unattended-showing/models/phone-verification-guest.ts\");});\nd(\"unattended-showing/models/phone-verification\", function(){ return i(\"unattended-showing/models/phone-verification.ts\");});\nd(\"unattended-showing/models/profile-password\", function(){ return i(\"unattended-showing/models/profile-password.ts\");});\nd(\"unattended-showing/models/profile\", function(){ return i(\"unattended-showing/models/profile.ts\");});\nd(\"unattended-showing/models/sanitized-appointment\", function(){ return i(\"unattended-showing/models/sanitized-appointment.ts\");});\nd(\"unattended-showing/models/sign-up\", function(){ return i(\"unattended-showing/models/sign-up.ts\");});\nd(\"unattended-showing/not-found/template\", function(){ return i(\"unattended-showing/not-found/template.hbs\");});\nd(\"unattended-showing/resolver\", function(){ return i(\"unattended-showing/resolver.js\");});\nd(\"unattended-showing/router\", function(){ return i(\"unattended-showing/router.js\");});\nd(\"unattended-showing/serializers/application\", function(){ return i(\"unattended-showing/serializers/application.js\");});\nd(\"unattended-showing/serializers/sign-up\", function(){ return i(\"unattended-showing/serializers/sign-up.js\");});\nd(\"unattended-showing/services/ajax\", function(){ return i(\"unattended-showing/services/ajax.ts\");});\nd(\"unattended-showing/services/check-in\", function(){ return i(\"unattended-showing/services/check-in.js\");});\nd(\"unattended-showing/services/error-reporting\", function(){ return i(\"unattended-showing/services/error-reporting.js\");});\nd(\"unattended-showing/services/intl\", function(){ return i(\"unattended-showing/services/intl.js\");});\nd(\"unattended-showing/services/login-pending-booking\", function(){ return i(\"unattended-showing/services/login-pending-booking.ts\");});\nd(\"unattended-showing/services/mock-time\", function(){ return i(\"unattended-showing/services/mock-time.ts\");});\nd(\"unattended-showing/services/sgt-session\", function(){ return i(\"unattended-showing/services/sgt-session.ts\");});\nd(\"unattended-showing/session-stores/application\", function(){ return i(\"unattended-showing/session-stores/application.js\");});\nd(\"unattended-showing/transforms/hours-of-operation\", function(){ return i(\"unattended-showing/transforms/hours-of-operation.js\");});\nd(\"unattended-showing/utils/convert-to-record\", function(){ return i(\"unattended-showing/utils/convert-to-record.ts\");});\nd(\"unattended-showing/utils/datetime-utils\", function(){ return i(\"unattended-showing/utils/datetime-utils.js\");});\nd(\"unattended-showing/utils/validators\", function(){ return i(\"unattended-showing/utils/validators.js\");});\nd(\"unattended-showing/services/dom\", function(){ return i(\"unattended-showing/services/dom.js\");});\nd(\"unattended-showing/services/adc-ajax\", function(){ return i(\"unattended-showing/services/adc-ajax.js\");});\nd(\"unattended-showing/services/adc-intl\", function(){ return i(\"unattended-showing/services/adc-intl.js\");});\nd(\"unattended-showing/adapters/base-adapter\", function(){ return i(\"unattended-showing/adapters/base-adapter.js\");});\nd(\"unattended-showing/adapters/base-json-api-content-adapter\", function(){ return i(\"unattended-showing/adapters/base-json-api-content-adapter.js\");});\nd(\"unattended-showing/adapters/base-micro-api-adapter\", function(){ return i(\"unattended-showing/adapters/base-micro-api-adapter.js\");});\nd(\"unattended-showing/models/base-model\", function(){ return i(\"unattended-showing/models/base-model.js\");});\nd(\"unattended-showing/models/locale\", function(){ return i(\"unattended-showing/models/locale.js\");});\nd(\"unattended-showing/models/micro-api-data-item\", function(){ return i(\"unattended-showing/models/micro-api-data-item.js\");});\nd(\"unattended-showing/models/micro-api-endpoint\", function(){ return i(\"unattended-showing/models/micro-api-endpoint.js\");});\nd(\"unattended-showing/serializers/base-serializer\", function(){ return i(\"unattended-showing/serializers/base-serializer.js\");});\nd(\"unattended-showing/serializers/common-serializer\", function(){ return i(\"unattended-showing/serializers/common-serializer.js\");});\nd(\"unattended-showing/serializers/polymorphic-serializer\", function(){ return i(\"unattended-showing/serializers/polymorphic-serializer.js\");});\nd(\"unattended-showing/services/base-engine-config\", function(){ return i(\"unattended-showing/services/base-engine-config.js\");});\nd(\"unattended-showing/services/base-error-reporting\", function(){ return i(\"unattended-showing/services/base-error-reporting.js\");});\nd(\"unattended-showing/services/browser\", function(){ return i(\"unattended-showing/services/browser.js\");});\nd(\"unattended-showing/services/context-manager\", function(){ return i(\"unattended-showing/services/context-manager.js\");});\nd(\"unattended-showing/services/cookie-manager\", function(){ return i(\"unattended-showing/services/cookie-manager.js\");});\nd(\"unattended-showing/services/env-settings\", function(){ return i(\"unattended-showing/services/env-settings.js\");});\nd(\"unattended-showing/services/locale\", function(){ return i(\"unattended-showing/services/locale.js\");});\nd(\"unattended-showing/services/native-bridge\", function(){ return i(\"unattended-showing/services/native-bridge.js\");});\nd(\"unattended-showing/services/performance-monitor\", function(){ return i(\"unattended-showing/services/performance-monitor.js\");});\nd(\"unattended-showing/services/session-activity\", function(){ return i(\"unattended-showing/services/session-activity.js\");});\nd(\"unattended-showing/services/websocket\", function(){ return i(\"unattended-showing/services/websocket.js\");});\nd(\"unattended-showing/transforms/array\", function(){ return i(\"unattended-showing/transforms/array.js\");});\nd(\"unattended-showing/transforms/nullable-boolean\", function(){ return i(\"unattended-showing/transforms/nullable-boolean.js\");});\nd(\"unattended-showing/initializers/setup-pikaday\", function(){ return i(\"unattended-showing/initializers/setup-pikaday.js\");});\nd(\"unattended-showing/initializers/setup-route-view\", function(){ return i(\"unattended-showing/initializers/setup-route-view.js\");});\nd(\"unattended-showing/initializers/setup-ui-components\", function(){ return i(\"unattended-showing/initializers/setup-ui-components.js\");});\nd(\"unattended-showing/services/accessibility\", function(){ return i(\"unattended-showing/services/accessibility.js\");});\nd(\"unattended-showing/services/modals\", function(){ return i(\"unattended-showing/services/modals.js\");});\nd(\"unattended-showing/services/notification-manager\", function(){ return i(\"unattended-showing/services/notification-manager.js\");});\nd(\"unattended-showing/vendor/qrcode\", function(){ return i(\"unattended-showing/vendor/qrcode.js\");});\nd(\"unattended-showing/services/cookies\", function(){ return i(\"unattended-showing/services/cookies.js\");});\nd(\"unattended-showing/utils/intl/missing-message\", function(){ return i(\"unattended-showing/utils/intl/missing-message.js\");});\nd(\"unattended-showing/instance-initializers/sentry-performance\", function(){ return i(\"unattended-showing/instance-initializers/sentry-performance.js\");});\nd(\"unattended-showing/data-adapter\", function(){ return i(\"unattended-showing/data-adapter.js\");});\nd(\"unattended-showing/initializers/ember-data-data-adapter\", function(){ return i(\"unattended-showing/initializers/ember-data-data-adapter.js\");});\nd(\"unattended-showing/adapters/-json-api\", function(){ return i(\"unattended-showing/adapters/-json-api.js\");});\nd(\"unattended-showing/initializers/ember-data\", function(){ return i(\"unattended-showing/initializers/ember-data.js\");});\nd(\"unattended-showing/instance-initializers/ember-data\", function(){ return i(\"unattended-showing/instance-initializers/ember-data.js\");});\nd(\"unattended-showing/serializers/-default\", function(){ return i(\"unattended-showing/serializers/-default.js\");});\nd(\"unattended-showing/serializers/-json-api\", function(){ return i(\"unattended-showing/serializers/-json-api.js\");});\nd(\"unattended-showing/serializers/-rest\", function(){ return i(\"unattended-showing/serializers/-rest.js\");});\nd(\"unattended-showing/services/store\", function(){ return i(\"unattended-showing/services/store.js\");});\nd(\"unattended-showing/transforms/boolean\", function(){ return i(\"unattended-showing/transforms/boolean.js\");});\nd(\"unattended-showing/transforms/date\", function(){ return i(\"unattended-showing/transforms/date.js\");});\nd(\"unattended-showing/transforms/number\", function(){ return i(\"unattended-showing/transforms/number.js\");});\nd(\"unattended-showing/transforms/string\", function(){ return i(\"unattended-showing/transforms/string.js\");});\nd(\"unattended-showing/services/-ensure-registered\", function(){ return i(\"unattended-showing/services/-ensure-registered.js\");});\nd(\"unattended-showing/breakpoints\", function(){ return i(\"unattended-showing/breakpoints.js\");});\nd(\"unattended-showing/initializers/ember-responsive-breakpoints\", function(){ return i(\"unattended-showing/initializers/ember-responsive-breakpoints.js\");});\nd(\"unattended-showing/services/media\", function(){ return i(\"unattended-showing/services/media.js\");});\nd(\"unattended-showing/component-managers/glimmer\", function(){ return i(\"unattended-showing/component-managers/glimmer.js\");});\nd(\"unattended-showing/initializers/app-version\", function(){ return i(\"unattended-showing/initializers/app-version.js\");});\nd(\"unattended-showing/metrics-adapters/base\", function(){ return i(\"unattended-showing/metrics-adapters/base.js\");});\nd(\"unattended-showing/metrics-adapters/google-analytics\", function(){ return i(\"unattended-showing/metrics-adapters/google-analytics.js\");});\nd(\"unattended-showing/services/metrics\", function(){ return i(\"unattended-showing/services/metrics.js\");});\nd(\"unattended-showing/initializers/container-debug-adapter\", function(){ return i(\"unattended-showing/initializers/container-debug-adapter.js\");});\nd(\"unattended-showing/initializers/ember-simple-auth\", function(){ return i(\"unattended-showing/initializers/ember-simple-auth.js\");});\nd(\"unattended-showing/instance-initializers/ember-simple-auth\", function(){ return i(\"unattended-showing/instance-initializers/ember-simple-auth.js\");});\nd(\"unattended-showing/services/session\", function(){ return i(\"unattended-showing/services/session.js\");});\nd(\"unattended-showing/routes/base-route\", function(){ return i(\"unattended-showing/routes/base-route.js\");});\nd(\"unattended-showing/routes/mixins/is-medium-width-page\", function(){ return i(\"unattended-showing/routes/mixins/is-medium-width-page.js\");});\n\n\n\n\n\nif (!runningTests) {\n i(\"../app\").default.create({\"name\":\"unattended-showing\",\"version\":\"1.0.0+9912585e\"});\n}\n\n","import RSVP from 'rsvp';\nimport Evented from '@ember/object/evented';\nimport EmberObject from '@ember/object';\n\n/**\n The base class for all authenticators. __This serves as a starting point for\n implementing custom authenticators and must not be used directly.__\n\n The authenticator authenticates the session. The actual mechanism used to do\n this might, e.g., post a set of credentials to a server and in exchange\n retrieve an access token, initiating authentication against an external\n provider like Facebook, etc. The details depend on the specific authenticator.\n Upon successful authentication, any data that the authenticator receives and\n resolves via the promise returned from the\n {{#crossLink \"BaseAuthenticator/authenticate:method\"}}{{/crossLink}}\n method is stored in the session and can be accessed via the session service\n to be used by the authorizer (see\n {{#crossLink \"BaseAuthorizer/authorize:method\"}}{{/crossLink}}) to e.g.,\n authorize outgoing requests.\n\n The authenticator also decides whether a set of data that was restored from\n the session store (see\n {{#crossLink \"BaseStore/restore:method\"}}{{/crossLink}}) makes up an\n authenticated session or not.\n\n __Authenticators for an application are defined in the `app/authenticators`\n directory__, e.g.:\n\n ```js\n // app/authenticators/oauth2.js\n import OAuth2PasswordGrantAuthenticator from 'ember-simple-auth/authenticators/oauth2-password-grant';\n\n export default class OAuth2Authenticator extends OAuth2PasswordGrantAuthenticator {\n ...\n }\n ```\n\n and can then be used via the name Ember CLI automatically registers for them\n within the Ember container.\n\n ```js\n // app/components/login-form.js\n import Component from '@ember/component';\n import { inject as service } from '@ember/service';\n import { action } from '@ember/object';\n\n export default class LoginFormComponent extends Component {\n @service session;\n\n @action\n authenticate() {\n this.session.authenticate('authenticator:oauth2');\n }\n }\n ```\n\n @class BaseAuthenticator\n @module ember-simple-auth/authenticators/base\n @extends Ember.Object\n @uses Ember.Evented\n @public\n*/\nexport default EmberObject.extend(Evented, {\n /**\n __Triggered when the authentication data is updated by the authenticator\n due to an external or scheduled event__. This might happen, e.g., if the\n authenticator refreshes an expired token or an event is triggered from an\n external authentication provider that the authenticator uses. The session\n handles that event, passes the updated data back to the authenticator's\n {{#crossLink \"BaseAuthenticator/restore:method\"}}{{/crossLink}}\n method and handles the result of that invocation accordingly.\n\n @event sessionDataUpdated\n @param {Object} data The updated session data\n @public\n */\n\n /**\n __Triggered when the authentication data is invalidated by the authenticator\n due to an external or scheduled event__. This might happen, e.g., if a token\n expires or an event is triggered from an external authentication provider\n that the authenticator uses. The session handles the event and will\n invalidate itself when it is triggered.\n\n @event sessionDataInvalidated\n @public\n */\n\n /**\n Restores the session from a session data object. __This method is invoked\n by the session either on application startup if session data is restored\n from the session store__ or when properties in the store change due to\n external events (e.g. in another tab) and the new session data needs to be\n validated for whether it constitutes an authenticated session.\n\n __This method returns a promise. A resolving promise results in the session\n becoming or remaining authenticated.__ Any data the promise resolves with\n will be saved in and accessible via the session service's\n `data.authenticated` property (see\n {{#crossLink \"SessionService/data:property\"}}{{/crossLink}}). A rejecting\n promise indicates that `data` does not constitute a valid session and will\n result in the session being invalidated or remaining unauthenticated.\n\n The `BaseAuthenticator`'s implementation always returns a rejecting\n promise. __This method must be overridden in subclasses.__\n\n @method restore\n @param {Object} data The data to restore the session from\n @return {Ember.RSVP.Promise} A promise that when it resolves results in the session becoming or remaining authenticated\n @public\n */\n restore() {\n return RSVP.reject();\n },\n\n /**\n Authenticates the session with the specified `args`. These options vary\n depending on the actual authentication mechanism the authenticator\n implements (e.g. a set of credentials or a Facebook account id etc.). __The\n session will invoke this method in order to authenticate itself__ (see\n {{#crossLink \"SessionService/authenticate:method\"}}{{/crossLink}}).\n\n __This method returns a promise. A resolving promise will result in the\n session becoming authenticated.__ Any data the promise resolves with will\n be saved in and accessible via the session service's `data.authenticated`\n property (see {{#crossLink \"SessionService/data:property\"}}{{/crossLink}}).\n A rejecting promise indicates that authentication failed and will result in\n the session remaining unauthenticated.\n\n The `BaseAuthenticator`'s implementation always returns a rejecting promise\n and thus never authenticates the session. __This method must be overridden\n in subclasses__.\n\n @method authenticate\n @param {Any} [...args] The arguments that the authenticator requires to authenticate the session\n @return {Ember.RSVP.Promise} A promise that when it resolves results in the session becoming authenticated\n @public\n */\n authenticate() {\n return RSVP.reject();\n },\n\n /**\n This method is invoked as a callback when the session is invalidated. While\n the session will invalidate itself and clear all authenticated session data,\n it might be necessary for some authenticators to perform additional tasks\n (e.g. invalidating an access token on the server side).\n\n __This method returns a promise. A resolving promise will result in the\n session becoming unauthenticated.__ A rejecting promise will result in\n invalidation being intercepted and the session remaining authenticated.\n\n The `BaseAuthenticator`'s implementation always returns a resolving promise\n and thus never intercepts session invalidation. __This method doesn't have\n to be overridden in custom authenticators__ if no actions need to be\n performed on session invalidation.\n\n @method invalidate\n @param {Object} data The current authenticated session data\n @param {Array} ...args additional arguments as required by the authenticator\n @return {Ember.RSVP.Promise} A promise that when it resolves results in the session being invalidated\n @public\n */\n invalidate() {\n return RSVP.resolve();\n }\n});\n","import { inject as service } from '@ember/service';\nimport Base from 'ember-simple-auth/authenticators/base';\nimport ApplicationAdapter from '../adapters/application';\n\n/**\n * @classdesc\n * Authenticator for Self-Guided Tours login.\n */\nexport default class CredentialsAuthenticator extends Base {\n @service ajax;\n\n /** @override **/\n async restore(data) {\n return Promise.resolve(data);\n }\n\n /** @override **/\n async authenticate(username, password) {\n let response;\n const adapter = ApplicationAdapter.create({});\n\n try {\n response = await this.ajax.request(\n this.ajax.apiBaseUrl + '/login',\n {\n body: JSON.stringify({\n username: username,\n password: password\n }),\n cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached\n credentials: 'same-origin', // include, same-origin, *omit\n headers: {\n 'content-type': 'application/json'\n },\n method: 'POST', // *GET, POST, PUT, DELETE, etc.\n mode: 'same-origin', // no-cors, cors, *same-origin\n redirect: 'follow', // manual, *follow, error\n referrer: window.location.href // *client, no-referrer\n }\n );\n } catch (exception) {\n response = {\n value: undefined,\n errors: adapter.normalizeErrorResponse(0, '', exception)\n };\n }\n\n // Get data in response from backend authentication request.\n const { value } = response;\n\n // Throw the error if response doesn't contain value expected.\n if (!value) {\n throw {\n errors: response.errors || [\n 'Unable to authenticate user. Please try again later.'\n ]\n };\n }\n\n // These values are expected by the application once the user is logged in.\n return {\n profileId: value.id,\n token: value.token\n };\n }\n}\n","import Route from '@ember/routing/route';\n\n/**\n * @classdesc\n * Base class for routes that automatically scrolls to the top of the page.\n */\nexport default class BaseRoute extends Route {\n activate() {\n super.activate();\n window.scrollTo(0, 0);\n }\n}\n","import { inject as service } from '@ember/service';\nimport BaseRoute from 'unattended-showing/classes/base-route';\n\n/**\n * @classdesc\n * Base class for all protected routes which ensures a user is logged in.\n */\nexport default class ProtectedRoute extends BaseRoute {\n @service sgtSession;\n\n beforeModel(transition) {\n this.sgtSession.requireAuthentication(transition, 'context.login');\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n \\n \\\"Dealer\\\"\\n \\n

© {{this.copyrightYear}} {{this.poweredByName}}. All Rights Reserved.

\\n
\\n \\n Privacy Policy\\n \\n |\\n \\n Terms of Use\\n \\n
\\n
\\n\",{ moduleName: \"unattended-showing/components/app-footer/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { computed } from '@ember/object';\n\n/**\n * Component for application footer.\n */\nexport default class AppFooter extends Component {\n /**\n * Company name to display for who's powering the website.\n *\n * @type {String}\n */\n get poweredByName() {\n return this.args.poweredByName ?? 'Alarm.com';\n }\n\n /**\n * Current year for copyright text.\n *\n * @type {Number}\n */\n copyrightYear = new Date().getFullYear();\n\n /**\n * Link for 'powered by' image.\n *\n * @type {String}\n */\n @computed('args.hasPointCentralDealer')\n get poweredByLogo() {\n return this.args.hasPointCentralDealer\n ? '/app/assets/images/poweredbyPC.png'\n : '/app/assets/images/powered_by_adc.png';\n }\n}\n","import FormatNumberModifier from './number-formatter';\n\n/**\n * Formats an input field in the format ####-####-####-####.\n */\nexport default class FormatCreditCardNumberModifier extends FormatNumberModifier {\n maxDigits = 16;\n\n format(value: string): string {\n let newValue = '';\n for (let i = 0; i < value.length; i += 4) {\n newValue += value.slice(i, i + 4);\n if (i + 4 < value.length) {\n newValue += '-';\n }\n }\n return newValue;\n }\n}\n","import FormatNumberModifier from './number-formatter';\n\n/**\n * Formats an input field in the format ##/##.\n */\nexport default class FormatCreditCardExpirationModifier extends FormatNumberModifier {\n maxDigits = 4;\n\n format(value: string): string {\n if (value.length <= 2) {\n return value;\n }\n return value.slice(0, 2) + '/' + value.slice(2, 4);\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

Credit Card Verification

\\n

For the safety of our community, please verify your credit card. We will not charge you and your information will not be stored.

\\n
\\n

Credit Card Details

\\n
\\n \\n \\n \\n \\n \\n \\n
\\n \\n \\n \\n
\\n \\n \\n \\n \\n \\n \\n
3-digit number on the back of the card
\\n \\n \\n \\n
\\n
\\n

Billing Address

\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\",{ moduleName: \"unattended-showing/components/credit-card-verification/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action, computed } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { isEmpty } from '@ember/utils';\nimport { USA } from 'unattended-showing/enums/Country';\nimport { cardholderName, cvv, expirationDate, number } from 'card-validator';\nimport { validateTextInputCustomRegex } from '../../utils/validators';\n\nimport type ArrayProxy from '@ember/array/proxy';\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Country from 'unattended-showing/models/country';\nimport type { ISelectItem } from '../../../../../addons/adc-ui-components/package/src/utils/select-item';\nimport './_style.scss';\nimport type CreditCardVerificationRequest from 'unattended-showing/classes/interfaces/requests/credit-card-verification-request';\n\ninterface CreditCardVerificationSignature {\n Element: HTMLDivElement;\n Args: {\n countries: ArrayProxy;\n transitionAction: () => void;\n backAction: () => void;\n verifyApiAction: (\n optionsOrType: Record,\n creditCardVerificationRequestBody: Record\n ) => Promise;\n };\n}\n\ninterface CountryData {\n name: string;\n states: string[];\n address: AddressData;\n zipFieldName: string;\n stateFieldName: string;\n}\n\ninterface AddressData {\n zipLength: number;\n zipValidator: (input: string) => boolean;\n}\n\ninterface FieldValidationData {\n label: string;\n value: string | number;\n isValid: boolean;\n}\n\nexport default class CreditCardVerificationComponent extends Component {\n @service\n declare ajax: ServiceRegistry['ajax'];\n @service\n declare loginPendingBooking: ServiceRegistry['login-pending-booking'];\n @service\n declare notificationManager: ServiceRegistry['notification-manager'];\n @service\n declare router: ServiceRegistry['router'];\n @service\n declare sgtSession: ServiceRegistry['sgt-session'];\n\n @tracked cvvTooltipIsOpen = false;\n @tracked firstName = '';\n @tracked lastName = '';\n @tracked expiration = '';\n @tracked cardNumber = '';\n @tracked cvv = '';\n @tracked country = USA.toString();\n @tracked streetAddress = '';\n @tracked city = '';\n @tracked state = '';\n @tracked zipCode = '';\n\n /**\n * Get DropdownSelectItem options for country dropdown.\n */\n @computed('country', 'countryDataMap')\n get countryListItems(): ISelectItem[] {\n const countryListItems = Array.from(\n this.countryDataMap,\n ([key, value]) => {\n return {\n name: value.name,\n value: key\n };\n }\n );\n return countryListItems;\n }\n\n /**\n * Returns an object containing country data.\n */\n @computed('args.countries')\n get countryDataMap(): Map {\n const countryDataMap: Map = new Map();\n this.args.countries.forEach((country) => {\n countryDataMap.set(country.id, {\n name: country.countryName,\n states: country.states,\n address: {\n zipLength: country.zipLength,\n zipValidator: validateTextInputCustomRegex.bind(\n null,\n new RegExp(country.zipValidator)\n )\n },\n zipFieldName: country.zipFieldName,\n stateFieldName: country.stateFieldName\n });\n });\n return countryDataMap;\n }\n\n @computed('country', 'countryDataMap')\n get selectedCountryData(): CountryData | null {\n return this.countryDataMap.get(this.country) ?? null;\n }\n\n /**\n * Get DropdownSelectItem options for states dropdown.\n */\n @computed('country', 'countryDataMap', 'selectedCountryData.states')\n get stateListItems(): ISelectItem[] {\n return (this.selectedCountryData?.states || []).map((name) => {\n return { name, value: name };\n });\n }\n\n /**\n * Get the label to display for the \"state\" dropdown.\n */\n @computed('country', 'countryDataMap', 'selectedCountryData.stateFieldName')\n get stateFieldName(): string {\n return this.selectedCountryData?.stateFieldName ?? 'State';\n }\n\n /**\n * Get the label to display for the \"ZIP\" field.\n */\n @computed('country', 'countryDataMap', 'selectedCountryData.zipFieldName')\n get zipFieldName(): string {\n return this.selectedCountryData?.zipFieldName ?? 'Zip';\n }\n\n /**\n * Toggle the tooltip visibility when the help trigger is activated.\n */\n @action toggleCvvTooltip(): void {\n this.cvvTooltipIsOpen = !this.cvvTooltipIsOpen;\n }\n\n /**\n * Sends user credit card information to backend server to be verified.\n */\n @action async verifyCard(): Promise {\n if (!this.validateUserInputs()) {\n return;\n }\n\n // Send credit card information to backend and redirect to profile route if successful.\n try {\n const headers: Record = {},\n token = this.sgtSession.data?.authenticated?.token;\n if (token && !isEmpty(token)) {\n headers.Authorization = token;\n }\n\n const optionsOrType = {\n headers: headers\n };\n\n const creditCardVerificationRequestBody: CreditCardVerificationRequest =\n {\n firstName: this.firstName,\n lastName: this.lastName,\n cardNumber: this.sanitizedCardNumber,\n expirationMonth: this.expirationMonth,\n expirationYear: this.expirationYear,\n securityCode: this.cvv,\n country: this.country,\n address: this.streetAddress,\n city: this.city,\n state: this.state,\n zipCode: this.zipCode\n };\n\n await this.args.verifyApiAction(\n optionsOrType,\n creditCardVerificationRequestBody\n );\n\n this.args.transitionAction();\n } catch (error) {\n this.ajax.handleApiRequestError(\n error,\n 'Unable to verify credit card.'\n );\n }\n }\n\n @computed('cardNumber')\n get sanitizedCardNumber(): string {\n return this.cardNumber.replace(/\\D/g, '');\n }\n\n @computed('expiration')\n get expirationMonth(): number {\n return parseInt(this.expiration.substring(0, 2));\n }\n\n @computed('expiration')\n get expirationYear(): number {\n return parseInt('20' + this.expiration.substring(3));\n }\n\n /**\n * Gets the FieldValidationData for each input in the form.\n */\n @computed(\n 'city',\n 'country',\n 'countryDataMap',\n 'cvv',\n 'expiration',\n 'firstName',\n 'lastName',\n 'sanitizedCardNumber',\n 'selectedCountryData.address.zipValidator',\n 'state',\n 'stateFieldName',\n 'streetAddress',\n 'zipCode',\n 'zipFieldName'\n )\n get fieldValidationData(): FieldValidationData[] {\n const textValidator = validateTextInputCustomRegex.bind(\n null,\n /[a-zA-Z]+/\n ),\n numberValidator = validateTextInputCustomRegex.bind(\n null,\n /^[0-9]+$/\n ),\n zipValidator =\n this.selectedCountryData?.address.zipValidator ??\n numberValidator;\n\n return [\n {\n label: 'First Name',\n value: this.firstName,\n isValid: cardholderName(this.firstName).isValid\n },\n {\n label: 'Last Name',\n value: this.lastName,\n isValid: cardholderName(this.lastName).isValid\n },\n {\n label: 'Card Number',\n value: this.sanitizedCardNumber,\n isValid: number(this.sanitizedCardNumber).isValid\n },\n {\n label: 'Expiration',\n value: this.expiration,\n isValid: expirationDate(this.expiration).isValid\n },\n {\n label: 'CVV',\n value: this.cvv,\n isValid: cvv(this.cvv).isValid\n },\n {\n label: 'Country',\n value: this.country,\n isValid: numberValidator(this.country)\n },\n {\n label: 'Street Address',\n value: this.streetAddress,\n isValid: textValidator(this.streetAddress)\n },\n {\n label: 'City',\n value: this.city,\n isValid: textValidator(this.city)\n },\n {\n label: 'State',\n value: this.state,\n isValid: textValidator(this.state)\n },\n {\n label: this.zipFieldName,\n value: this.zipCode,\n isValid: zipValidator(this.zipCode)\n }\n ];\n }\n\n validateUserInputs(): boolean {\n // This method may need to be updated in POINT-6942 depending on how errors will be displayed.\n const errors: string[] = [];\n this.fieldValidationData.forEach((field) => {\n if (!field.value) {\n errors.push(`${field.label} is required.`);\n } else if (!field.isValid) {\n errors.push(`Invalid input for ${field.label}.`);\n }\n });\n\n if (errors.length > 0) {\n this.notificationManager.addError(errors[0]);\n return false;\n }\n return true;\n }\n\n /**\n * Helper action to set the country. Used by the country dropdown on-change.\n * This also clears the state as the options will change.\n */\n @action\n updateCountry(value: string): void {\n this.country = value;\n // If a state has been selected, preselect the first state of the new country.\n if (this.state) {\n this.state = this.selectedCountryData?.states[0] ?? '';\n }\n }\n\n /**\n * Helper action to set the state. Used by the state dropdown on-change.\n */\n @action\n updateState(value: string): void {\n this.state = value;\n }\n\n @action\n back(): void {\n this.args.backAction();\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n CreditCardVerificationComponent: typeof CreditCardVerificationComponent;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n
\\n \\n {{#each @field.subFields as |subField|}}\\n {{#if (eq subField.inputType \\'dropdown\\')}}\\n \\n {{else}}\\n \\n {{/if}}\\n {{/each}}\\n
\\n\\n {{#unless this.isValid}}\\n

\\n {{@field.errorMessage}}\\n

\\n {{/unless}}\\n
\\n\",{ moduleName: \"unattended-showing/components/input-form-row/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { computed, notifyPropertyChange } from '@ember/object';\nimport { action, get } from '@ember/object';\n\n/**\n * Create a new input row item.\n *\n * @param {String} label\n * @param {Array} subFields\n * @param {Function} validator\n * @param {String} errorMessage\n *\n * @returns {{label: String, subFields: Array<{Object}>, validator: {Function}, errorMessage: {String}}}\n */\nexport function createRowItem(label, subFields, validator, errorMessage) {\n return { label, subFields, validator, errorMessage };\n}\n\n/**\n * Create a new dropdown subfield.\n *\n * @param {String} propertyName\n * @param {String} placeHolder\n * @param {Function} valueChange\n * @param {Array} dropdownItems\n *\n * @returns {{inputType: String, propertyName: String, placeHolder: String, valueChange: Function, dropdownItems: Array}}\n */\nexport function createDropdownSubField(\n propertyName,\n valueChange,\n dropdownItems,\n placeHolder = ''\n) {\n return {\n inputType: 'dropdown',\n propertyName,\n placeHolder,\n valueChange,\n dropdownItems\n };\n}\n\n/**\n * Create a new input subfield.\n *\n * @param {String} inputType\n * @param {String} propertyName\n * @param {Number} maxLength\n *\n * @returns {{inputType: String, propertyName: String, maxLength: Number}}\n */\nexport function createNativeSubField(\n propertyName,\n inputType = 'text',\n maxLength = ''\n) {\n return { inputType, propertyName, maxLength };\n}\n\n/**\n * Component that shows rows of user input fields.\n */\nexport default class InputFormRow extends Component {\n /**\n * True if all of the validator functions that were passed in to the inputs are true, returns false otherwise.\n *\n * @type {boolean}\n */\n @computed('args.{field,model}')\n get isValid() {\n const { field = {}, model } = this.args,\n { validator = () => true, subFields = [] } = field;\n\n if (!model) {\n return true;\n }\n\n return subFields.every(({ propertyName }) =>\n validator(get(model, propertyName))\n );\n }\n\n /**\n * Call this action on change of an input. This will recompute the validity property that will update styling.\n */\n @action recomputeValidity() {\n notifyPropertyChange(this, 'args.model');\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n

{{@title}}

\\n

{{@description}}

\\n {{#if @error}}\\n

{{@error}}

\\n {{/if}}\\n
\\n {{#each @userInfoFields as |field|}}\\n \\n {{/each}}\\n\\n {{yield}}\\n
\\n
\\n\",{ moduleName: \"unattended-showing/components/input-form.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './input-form.hbs'; */\nimport templateOnlyComponent from '@ember/component/template-only';\nexport default templateOnlyComponent();","export default {\"modulePrefix\":\"unattended-showing\",\"environment\":\"production\",\"rootURL\":\"/app/\",\"locationType\":\"history\",\"apiBaseUrl\":\"/api\",\"isRemoteBuild\":true,\"EmberENV\":{\"EXTEND_PROTOTYPES\":false,\"FEATURES\":{},\"_APPLICATION_TEMPLATE_WRAPPER\":false,\"_DEFAULT_ASYNC_OBSERVERS\":true,\"_JQUERY_INTEGRATION\":false,\"_TEMPLATE_ONLY_GLIMMER_COMPONENTS\":true},\"APP\":{\"name\":\"unattended-showing\",\"version\":\"1.0.0+9912585e\"},\"metricsAdapters\":[{\"name\":\"GoogleAnalytics\",\"environments\":[\"production\"],\"config\":{\"id\":\"UA-81847905-3\"}}],\"ember-cli-mirage\":{\"enabled\":false,\"usingProxy\":false,\"useDefaultPassthroughs\":true},\"notificationManager\":{\"error\":{\"autoCloseDuration\":10000}},\"errorReporting\":{\"dsn\":\"https://34e22b3ab5a444bb8a46a780c15cf0e5@sentry.io/1458620\",\"environment\":\"production\",\"isEnabled\":true,\"showDebugInfo\":false}};","import { inject as service } from '@ember/service';\nimport ProtectedRoute from 'unattended-showing/classes/protected-route';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Context from '../../models/context';\n\ninterface ContextModel {\n context: Promise;\n}\n\n/**\n * @classdesc\n * Route for viewing and managing existing Self-Guided Tours appointments.\n */\nexport default class AppointmentSgt3Route extends ProtectedRoute {\n @service declare store: ServiceRegistry['store'];\n @service declare router: ServiceRegistry['router'];\n\n /**\n * @param model\n * @returns {{appointments: (model.appointment|Promise), context: (models.context|promise)}}\n */\n async model() {\n try {\n const contextModel = this.modelFor('context') as ContextModel;\n const context = await contextModel.context;\n const appointment = this.store.findAll('appointment');\n\n return {\n appointment,\n context\n };\n } catch (error) {\n this.send('error', error);\n\n return {};\n }\n }\n\n /**\n * @param model\n * redirects to not-found page if context does not have SGT3 toggle.\n */\n async afterModel(model: { context: Context }) {\n if (!model.context.useSGT3) {\n this.router.transitionTo('context.not-found', 'not-found');\n }\n }\n}\n","import Controller from '@ember/controller';\nimport { computed, setProperties } from '@ember/object';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { getCommunitySiteMapObjectUrl } from 'unattended-showing/helpers/file-utils';\nimport startOfDay from 'date-fns/startOfDay';\n\n/**\n * Main controller for appointment route.\n */\nexport default class AppointmentController extends Controller {\n @service sgtSession;\n @service store;\n @service router;\n @service ajax;\n @service checkIn;\n\n /**\n * Each Appointment is placed in a map, categorized by individual days. This gets the map key for the Appointment object.\n *\n * @param {models.Appointment} appointment\n * @type {number}\n */\n appointmentKey(appointment) {\n return startOfDay(new Date(appointment.dateTimeLocal)).valueOf();\n }\n\n /**\n * Get appointments filtered by filter function, sorted ascending, and placed into day-buckets.\n *\n * @param {function} filter\n * @param {Boolean} reverseDayOrder\n *\n * @type {Array<{day: {Date}, appointments: Array>}\n */\n async filteredAppointments(filter, reverseDayOrder = false) {\n const appointments = await this.model.appointments,\n context = await this.model.context;\n await Promise.all(\n appointments.map((a) => {\n const locationId = a.belongsTo('location').id();\n return this.store.findRecord('location', locationId, {\n adapterOptions: {\n queryParams: {\n systemGroupId: context.systemGroupId,\n loadAppointments: false\n }\n }\n });\n })\n );\n\n const appointmentMap = new Map();\n\n // Start with all of the user's appointments.\n // eslint-disable-next-line ember/no-array-prototype-extensions\n appointments\n .toArray()\n .filter(filter)\n .sort((a, b) => new Date(a.dateTimeUtc) - new Date(b.dateTimeUtc))\n .forEach((appointment) => {\n const key = this.appointmentKey(appointment);\n\n if (appointmentMap.has(key)) {\n appointmentMap.get(key).push(appointment);\n } else {\n appointmentMap.set(key, [appointment]);\n }\n });\n\n const appointmentObjects = [...appointmentMap].map(\n ([day, appointments]) => ({\n day: new Date(day),\n appointments\n })\n );\n\n if (reverseDayOrder) {\n return appointmentObjects.reverse();\n }\n\n return appointmentObjects;\n }\n\n /**\n * Get all of the user's upcoming appointments (including pending appointments).\n *\n * @type {Array<{day: {Date}, appointments: Array}>}\n */\n @computed('model.appointments.[]')\n get futureAppointments() {\n return this.filteredAppointments((appointment) => {\n // Return future appointments with non-empty date and location.\n return (\n !!appointment.current &&\n !!appointment.dateTimeUtc &&\n !!appointment.fullAddress\n );\n }, false);\n }\n\n /**\n * Get all of the user's past appointments (not including pending appointments).\n *\n * @type {Array<{day: {Date}, appointments: Array}>}\n */\n @computed('model.appointments.[]')\n get pastAppointments() {\n return this.filteredAppointments((appointment) => {\n // Return past appointments with non-empty date and location.\n return (\n !!appointment.past &&\n !!appointment.dateTimeUtc &&\n !!appointment.fullAddress\n );\n }, true);\n }\n\n /**\n * Delete appointment.\n *\n * @param {models.Appointment} appointment\n * @returns {models.Appointment|Promise}\n */\n @action async deleteAppointment(appointment) {\n try {\n await appointment.destroyRecord();\n location.reload();\n } catch (response) {\n return this.ajax.handleAjaxError(\n response,\n \"We couldn't cancel your appointment.\"\n );\n }\n }\n\n /**\n * Check-in the user.\n *\n * @param {models.Appointment} appointment\n */\n @action async checkInAppointment(appointment) {\n const location = await appointment.location;\n const cpidEnabled = location.checkpointIdEnabled;\n await this.checkIn.appointmentCheckIn(location, appointment);\n\n if (cpidEnabled) {\n setProperties(appointment, {\n showCheckIn: false\n });\n\n this.goToLocation(appointment);\n } else {\n window.location.reload();\n }\n }\n\n /**\n * Send user the CPID verification.\n *\n * @param {models.Appointment} appointment\n */\n @action async reVerify(appointment) {\n await this.checkIn.sendCheckpointIdVerification(appointment.id);\n this.goToLocation(appointment);\n }\n\n /**\n * Transition to location page for appointment.\n *\n * @param {models.Appointment} appointment\n */\n @action goToLocation(appointment) {\n const locationId = appointment.belongsTo('location').id();\n\n if (locationId) {\n const contextId = appointment.subdomain;\n\n // If the subdomain is not populated, do not try to transition.\n if (!contextId) {\n return;\n }\n this.router.transitionTo('context.location', contextId, locationId);\n return;\n }\n }\n\n /**\n * Opens a new tab for the community site map.\n *\n * @function\n */\n @action async openCommunitySiteMap(groupId, ev) {\n ev.preventDefault();\n\n await getCommunitySiteMapObjectUrl(\n this.model.context,\n groupId,\n this.ajax\n );\n\n window.open(\n this.model.context.communitySiteMapObjectUrls[groupId],\n '_blank',\n 'noopener noreferrer'\n );\n }\n}\n","import { inject as service } from '@ember/service';\nimport ProtectedRoute from 'unattended-showing/classes/protected-route';\n\n/**\n * @classdesc\n * Route for viewing and managing existing Self-Guided Tours appointments.\n */\nexport default class AppointmentRoute extends ProtectedRoute {\n @service store;\n\n /**\n * @returns {{appointments: (model.appointment|Promise)}}\n */\n model() {\n const { context } = this.modelFor('context'),\n appointments = this.store.findAll('appointment');\n\n return {\n appointments,\n context\n };\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Context from '../../models/context';\n\ninterface ContextModel {\n context: Promise;\n}\n\n/**\n * @classdesc URL is /bookings-sgt3/ but we use AvailableUnitsList in the code.\n *\n * @class availableUnitsListSgt3.AvailableUnitsListSgt3Route\n * @extends Route\n *\n */\nexport default class AvailableUnitsListSgt3Route extends Route {\n @service declare store: ServiceRegistry['store'];\n @service declare router: ServiceRegistry['router'];\n\n /**\n * @param model\n * @returns {{availableUnitsList: (models.availableUnitsList|promise), context: (models.context|promise)}}\n */\n async model(model: { available_units_list_id: string | number }) {\n try {\n const contextModel = this.modelFor('context') as ContextModel;\n const context = await contextModel.context;\n const availableUnitsList = await this.store.findRecord(\n 'available-units-list',\n model.available_units_list_id\n );\n\n return {\n availableUnitsList,\n context\n };\n } catch (error) {\n this.send('error', error);\n\n return {};\n }\n }\n\n /**\n * @param model\n * redirects to not-found page if context does not have SGT3 toggle.\n */\n async afterModel(model: { context: Context }) {\n if (!model.context.useSGT3) {\n this.router.transitionTo('context.not-found', 'not-found');\n }\n }\n}\n","import { tracked } from '@glimmer/tracking';\nimport Controller from '@ember/controller';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { getCommunitySiteMapObjectUrl } from 'unattended-showing/helpers/file-utils';\n\n/**\n * @classdesc\n * Controller for Self-Guided Tours availableUnitsList (bookings) page.\n */\nexport default class AvailableUnitsListController extends Controller {\n @service ajax;\n\n @tracked currentId = null;\n\n /**\n * Redirect user to the scheduling page for the selected location\n *\n * @function\n */\n @action redirectAction() {\n if (this.currentId != null) {\n var locationUrl = 'location/' + String(this.currentId);\n window.open(\n String(window.location).replace(/bookings.*/, locationUrl)\n );\n }\n }\n\n /**\n * Sets the id of the unit that is selected\n *\n * @function\n * @param {models.availableUnitsList.locations.id} locationId\n */\n @action selectLocation(locationId) {\n this.currentId = locationId;\n }\n\n /**\n * Opens a new tab for the community site map.\n *\n * @function\n */\n @action async openCommunitySiteMap(ev) {\n ev.preventDefault();\n\n await getCommunitySiteMapObjectUrl(\n this.model.context,\n this.model.context.systemGroupId,\n this.ajax\n );\n\n window.open(\n this.model.context.communitySiteMapObjectUrls[\n this.model.context.systemGroupId\n ],\n '_blank',\n 'noopener noreferrer'\n );\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\n/**\n * @classdesc Route for Self-Guided Tours Single Link Showings. URL is /bookings/ but we use AvailableUnitsList in the code.\n *\n * @class availableUnitsList.AvailableUnitsListRoute\n * @extends Route\n *\n */\nexport default class AvailableUnitsListRoute extends Route {\n /**\n * Inject notification manager to show messages.\n */\n @service notificationManager;\n @service store;\n @service cookies;\n\n /**\n * @param model\n * @returns {{availableUnitsList: (models.availableUnitsList|promise), context: (models.context|promise)}}\n */\n async model(model) {\n try {\n const context = this.modelFor('context').context;\n const availableUnitsList = await this.store.findRecord(\n 'available-units-list',\n model.available_units_list_id\n );\n\n // Construct availableUnitsList Url to restore if the user signs up,\n // but only store it if it is valid (both of the values below exist)\n const validUrl =\n context.id != null && availableUnitsList.id != null;\n\n if (validUrl) {\n const redirectUrl =\n '/' + context.id + '/bookings/' + availableUnitsList.id;\n this.cookies.write(\n 'ember_simple_auth-redirectTarget',\n redirectUrl\n );\n }\n\n return {\n availableUnitsList,\n context\n };\n } catch (error) {\n this.send('error', error);\n }\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Context from '../../models/context';\n\nexport default class ChangePasswordSgt3Route extends Route {\n @service declare router: ServiceRegistry['router'];\n\n async afterModel(model: { context: Context }) {\n if (!model.context.useSGT3) {\n this.router.transitionTo('context.not-found', 'not-found');\n }\n }\n}\n","import { tracked } from '@glimmer/tracking';\nimport Controller from '@ember/controller';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport {\n createRowItem,\n createNativeSubField\n} from '../../components/input-form-row/index';\nimport { validateTextInputPassword } from '../../utils/validators';\n\n/**\n * Controller for changing user's password.\n */\nexport default class ChangePasswordController extends Controller {\n @service notificationManager;\n @service sgtSession;\n @service ajax;\n @service router;\n\n /**\n * Query parameter.\n *\n * @type {[String]}\n */\n queryParams = ['token'];\n\n /**\n * Default token value.\n *\n * @type {String}\n * @default: null\n */\n @tracked token = null;\n\n /**\n * Returns data for template to generate required input fields.\n *\n * @function\n * @returns {Array<{label: {String}, subFields: Array<{inputType: {String}, propertyName: {String}}>, validator: {Function}, errorMessage: {String}}>}\n */\n get userPasswordInfoFields() {\n return [\n createRowItem(\n 'New Password',\n [createNativeSubField('password', 'password')],\n validateTextInputPassword,\n 'Password must contain at least eight characters, one number (0-9), and one capital letter.'\n ),\n createRowItem(\n 'Confirm Password',\n [createNativeSubField('confirmPassword', 'password')],\n validateTextInputPassword,\n 'Please enter the same password again.'\n )\n ];\n }\n\n /**\n * Saves new password.\n *\n * @param {models.ProfilePassword} model\n * @returns {models.ProfilePassword|promise}\n */\n @action save(model) {\n // Set token if it is provided as a query parameter to send along to server. This indicates a password reset.\n if (this.token) {\n this.model.profilePassword.set('token', this.token);\n }\n\n // Save new password.\n return model\n .save()\n .then(() => {\n this.token = null;\n this.router.transitionTo('context.login');\n this.notificationManager.addSuccess(\n 'Your password has been updated.'\n );\n })\n .catch((errors) => {\n return this.ajax.handleAjaxError(\n errors,\n 'Unable to update password. Please try again later.'\n );\n });\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\n/**\n * Route for user password change.\n */\nexport default class ChangePasswordRoute extends Route {\n @service store;\n\n /**\n * Creates new ProfilePassword record.\n *\n * @returns {{profilePassword: (models.ProfilePassword|promise)}}\n */\n model() {\n return {\n profilePassword: this.store.createRecord('profile-password')\n };\n }\n\n /**\n * Deletes created model if not saving when exiting route.\n */\n deactivate() {\n this.currentModel.profilePassword.unloadRecord();\n }\n}\n","import Controller from '@ember/controller';\nimport { computed } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport ENV from 'unattended-showing/config/environment';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type { SafeString } from '@ember/template';\n\n/**\n * The main application controller. Responsible for loading dealer-specific styling.\n */\nexport default class ContextController extends Controller {\n @service declare router: ServiceRegistry['router'];\n\n @computed('router.currentRouteName')\n get showSGT3(): boolean {\n const { currentRouteName } = this.router;\n return (\n currentRouteName?.includes('sgt3') ||\n currentRouteName.includes('credit-card-verification') ||\n currentRouteName.includes('phone-verification') ||\n currentRouteName === 'context.guest-sign-up'\n );\n }\n\n /**\n * The root URL path for all SVG sprites.\n *\n * @type {String}\n */\n get svgSpriteRoot(): SafeString {\n return htmlSafe(`${ENV.rootURL}assets/svg-sprites`);\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your controllers.\ndeclare module '@ember/controller' {\n interface Registry {\n context: ContextController;\n }\n}\n","import Controller from '@ember/controller';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { convertToRecord } from 'unattended-showing/utils/convert-to-record';\nimport { POST } from '@adc/ajax/services/adc-ajax';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type CreditCardVerificationRequest from 'unattended-showing/classes/interfaces/requests/credit-card-verification-request';\n\nexport default class CreditCardVerificationController extends Controller {\n @service declare cookies: ServiceRegistry['cookie'];\n @service declare router: ServiceRegistry['router'];\n @service declare ajax: ServiceRegistry['ajax'];\n @service declare store: ServiceRegistry['store'];\n\n @action\n transitionAction(): void {\n // TODO: POINT-6907\n this.router.transitionTo('context.profile-sgt3');\n }\n\n @action\n backAction(): void {\n // TODO: POINT-4493\n this.router.transitionTo('context.profile-sgt3');\n }\n\n @action\n async verifyApiAction(\n optionsOrType: Record,\n creditCardVerificationRequestBody: CreditCardVerificationRequest\n ): Promise {\n await this.ajax.apiRequest(\n 'creditCardVerifications/account',\n optionsOrType,\n convertToRecord(creditCardVerificationRequestBody),\n POST\n );\n\n // Remove cached versions of profile so next time we read, we grab a new version which should contain fresh cc validation state.\n this.store.unloadAll('profile');\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your controllers.\ndeclare module '@ember/controller' {\n interface Registry {\n 'context/credit-card-verification-sgt3': CreditCardVerificationController;\n }\n}\n","import { inject as service } from '@ember/service';\nimport ProtectedRoute from 'unattended-showing/classes/protected-route';\n\nimport type ArrayProxy from '@ember/array/proxy';\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type ContextModel from 'unattended-showing/models/context';\nimport type Country from 'unattended-showing/models/country';\nimport type Context from '../../../models/context';\n\nexport interface CreditCardVerificationModel {\n context: ContextModel;\n countries: ArrayProxy;\n}\n\ninterface ContextRouteModel {\n context: Promise;\n}\n\n/**\n * @classdesc Route for sign-up SGT3.\n */\nexport default class CreditCardVerificationRoute extends ProtectedRoute {\n @service declare store: ServiceRegistry['store'];\n @service declare router: ServiceRegistry['router'];\n\n declare currentModel: CreditCardVerificationModel;\n\n /**\n * Returns model for new user sign-up.\n */\n async model(): Promise {\n const contextModel = this.modelFor('context') as ContextRouteModel;\n const context = await contextModel.context;\n const countries = await this.store.findAll('country');\n\n return {\n context,\n countries\n };\n }\n\n /**\n * Redirects to not-found page if context does not have SGT3 toggle.\n */\n afterModel(model: { context: Context }): void {\n if (!model.context || !model.context.useSGT3) {\n this.router.transitionTo('context.not-found', 'not-found');\n }\n }\n}\n","import Controller from '@ember/controller';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { convertToRecord } from 'unattended-showing/utils/convert-to-record';\nimport { POST } from '@adc/ajax/services/adc-ajax';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type CreditCardVerificationRequest from 'unattended-showing/classes/interfaces/requests/credit-card-verification-request';\nimport type CreditCardVerificationGuestResponse from 'unattended-showing/classes/interfaces/responses/credit-card-verification-guest-response';\n\nexport default class CreditCardVerificationGuestController extends Controller {\n @service declare router: ServiceRegistry['router'];\n @service declare ajax: ServiceRegistry['ajax'];\n @service declare store: ServiceRegistry['store'];\n\n declare model: any;\n\n @action\n transitionAction(): void {\n this.router.transitionTo('context.guest-appointment', {\n queryParams: {\n jwt: this.model.jwt\n }\n });\n }\n\n @action\n backAction(): void {\n // TODO: POINT-4493\n }\n\n @action\n async verifyApiAction(\n _optionsOrType: Record,\n creditCardVerificationRequestBody: CreditCardVerificationRequest\n ): Promise {\n const optionsOrType = {\n headers: {\n authorization: this.model.jwt\n }\n };\n\n const response =\n await this.ajax.apiRequest(\n 'creditCardVerifications/guest',\n optionsOrType,\n convertToRecord(creditCardVerificationRequestBody),\n POST\n );\n\n this.model.jwt = response.jwt;\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your controllers.\ndeclare module '@ember/controller' {\n interface Registry {\n 'context/credit-card-verification/guest': CreditCardVerificationGuestController;\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nimport type ArrayProxy from '@ember/array/proxy';\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type ContextModel from 'unattended-showing/models/context';\nimport type Country from 'unattended-showing/models/country';\nimport type Context from '../../../models/context';\n\nexport interface CreditCardVerificationGuestModel {\n context: ContextModel;\n countries: ArrayProxy;\n jwt: string;\n}\n\ninterface ContextRouteModel {\n context: Promise;\n}\n\n/**\n * @classdesc Route for sign-up SGT3.\n */\nexport default class CreditCardVerificationGuestRoute extends Route {\n @service declare store: ServiceRegistry['store'];\n @service declare router: ServiceRegistry['router'];\n\n declare currentModel: CreditCardVerificationGuestModel;\n\n queryParams = {\n jwt: {\n refreshModel: true\n }\n };\n\n /**\n * Returns model for new user sign-up.\n */\n async model(params: any): Promise<{\n context: ContextModel;\n countries: ArrayProxy;\n jwt: string;\n }> {\n const contextModel = this.modelFor('context') as ContextRouteModel;\n const context = await contextModel.context;\n const countries = await this.store.findAll('country');\n const { jwt } = params;\n\n return {\n context,\n countries,\n jwt\n };\n }\n\n /**\n * Redirects to not-found page if context does not have SGT3 toggle.\n */\n afterModel(model: { context: Context }): void {\n if (!model.context || !model.context.useSGT3) {\n this.router.transitionTo('context.not-found', 'not-found');\n }\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Context from '../../models/context';\n\nexport default class FaqSgt3Route extends Route {\n @service declare router: ServiceRegistry['router'];\n\n async afterModel(model: { context: Context }) {\n if (!model.context.useSGT3) {\n this.router.transitionTo('context.not-found', 'not-found');\n }\n }\n}\n","import Controller from '@ember/controller';\nimport { computed } from '@ember/object';\n\n/**\n * Controller for FAQ page.\n */\nexport default class FaqController extends Controller {\n /**\n *\n * Function that returns content for FAQ page.\n *\n * @function\n *\n * @returns {Array<{title: String, questions: Array<{title: String, answers: Array}>}>}\n */\n @computed('model.context.{hasPointCentralDealer,poweredByName}')\n get pageContents() {\n return (async () => {\n const poweredByName = await this.model.context.poweredByName;\n const forRentText = (await this.model.context.hasPointCentralDealer)\n ? ' for rent'\n : '';\n const noLongerAvailableText = (await this.model.context\n .hasPointCentralDealer)\n ? 'property has been recently reserved or leased'\n : 'property is no longer available';\n const unlockInstructions = (await this.model.context\n .hasPointCentralDealer)\n ? 'To unlock the door, enter your 6 digit lock code then press the (✔) or (*) key on the lower left corner of the keypad on the lock.'\n : 'To access: (1) if lock keypad has * or Schlage button, press it first. (2) Enter lock code. (3) Press * or Schlage button if present.';\n\n return [\n {\n title: 'Overview',\n questions: [\n {\n title: `How does ${poweredByName}’s Self-Guided Tours feature work?`,\n answers: [\n `After creating an account, you’ll have access to search all properties${forRentText} that have been loaded into the Self-Guided Tours feature by the property manager.`,\n 'After finding your desired property, you can view a calendar of available timeslots in which you can schedule a viewing.',\n 'After selecting a time on the calendar, you will receive a lock code for the front door lock which will be usable for the duration of your scheduled showing.',\n 'When your visit is complete, you’ll simply want to close and lock the door as you leave. That’s it!'\n ]\n },\n {\n title: `Is the property owned or managed by ${poweredByName}?`,\n answers: [\n `No. The property is owned and managed by the property manager independently from ${poweredByName}. ${poweredByName} is the technology provider that the property manager leverages to provide a Self-Guided Tours experience to their tenant prospects.`\n ]\n }\n ]\n },\n {\n title: 'Creating an Account',\n questions: [\n {\n title: 'Why won’t it let me create an account?',\n answers: [\n 'Make sure all requested information is filled out from the Identity verification page. All boxes are required to be completed for sign up.',\n 'Double check that your credit card number is entered correctly.',\n 'If you do not have a credit card, please contact the property manager to see if there are alternative methods for viewing the home.'\n ]\n },\n {\n title: `Does ${poweredByName} keep my Credit/Debit Card info on file?`,\n answers: [\n 'No. We will not store your credit card information after the verification check is complete.'\n ]\n },\n {\n title: 'What if I don’t have a credit card?',\n answers: [\n 'A debit or credit card will be required to create a Self-Guided Tours account for verification purposes. If you do not have a credit card, please contact the property manager for alternative methods of access to view the property.'\n ]\n },\n {\n title: 'Why do I need a credit card?',\n answers: [\n 'A credit card is required to schedule Self-Guided Tours to verify your stated identity.'\n ]\n }\n ]\n },\n {\n title: 'Viewing a Property',\n questions: [\n {\n title: 'Why can’t I find the property I’m looking for?',\n answers: [\n `It’s possible that the property is not integrated with ${poweredByName}’s website, or may no longer be available${forRentText}. If the property you are looking for cannot be found, please contact the property manager to confirm its availability.`\n ]\n },\n {\n title: 'Why won’t it let me schedule a showing on the property?',\n answers: [\n 'The ability to schedule a showing is dependent on wireless communication both in and outside of the home. In the event the lock is unable to communicate through the Self-Guided Tours app, please contact the property manager for alternative methods to schedule and view the property.',\n `Another reason may be that the ${noLongerAvailableText} but not removed yet. Please contact the property manager for alternative methods to schedule and view another property.`\n ]\n },\n {\n title: 'Why doesn’t my lock code unlock the lock?',\n answers: [\n 'Double check that you are trying to use the assigned lock code during the previously scheduled period of time.',\n 'Double check that you are using the correct lock code.',\n unlockInstructions,\n 'If the lock is unable to unlock, contact the property manager for assistance accessing the home.'\n ]\n },\n {\n title: 'Who do I contact if I notice something wrong at the property?',\n answers: [\n 'If you identify property damage, or any other items you feel should be reported, please contact the property manager.'\n ]\n },\n {\n title: 'Can I see a property more than once?',\n answers: [\n 'Yes. If the property is still available, you can feel free to schedule additional showings on a property you’ve already visited.'\n ]\n }\n ]\n }\n ];\n })();\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type SGTSession from 'unattended-showing/services/sgt-session';\nimport type Context from '../../models/context';\n\ninterface ProhibitAuthentication {\n prohibitAuthentication(route: string): void;\n}\n\ntype SessionServiceWithProhibitAuthentication = SGTSession &\n ProhibitAuthentication;\n\nexport default class ForgotPasswordSgt3Route extends Route {\n @service declare router: ServiceRegistry['router'];\n @service declare sgtSession: SessionServiceWithProhibitAuthentication;\n\n beforeModel() {\n this.sgtSession.prohibitAuthentication('context.appointment');\n }\n\n async afterModel(model: { context: Context }) {\n if (!model.context.useSGT3) {\n this.router.transitionTo('context.not-found', 'not-found');\n }\n }\n}\n","import Controller from '@ember/controller';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport ApplicationAdapter from '../../adapters/application';\n\n/**\n * @classdesc\n * Controller for sending password reset requests.\n */\nexport default class ForgotPasswordController extends Controller {\n @service ajax;\n @service notificationManager;\n\n /**\n * Submits password reset request.\n */\n @action async submit() {\n try {\n const { email, notificationManager } = this;\n\n // Send password reset request.\n const response = await this.ajax.request(\n this.ajax.apiBaseUrl + '/login/forgotPassword',\n {\n body: JSON.stringify({\n email: email\n }),\n cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached\n credentials: 'same-origin', // include, same-origin, *omit\n headers: {\n 'content-type': 'application/json'\n },\n method: 'POST', // *GET, POST, PUT, DELETE, etc.\n mode: 'same-origin', // no-cors, cors, *same-origin\n redirect: 'follow', // manual, *follow, error\n referrer: window.location.href // *client, no-referrer\n }\n );\n\n notificationManager.addSuccess(response);\n } catch (exception) {\n // Normalize errors.\n const adapter = ApplicationAdapter.create({});\n const errors = {\n errors: adapter.normalizeErrorResponse(0, '', exception)\n };\n\n (\n errors.errors || [\n 'Unable to request password reset. Please try again later.'\n ]\n ).forEach((error) => this.notificationManager.addError(error));\n\n return Promise.reject(errors.errors);\n }\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\n/**\n * Route for password reset.\n */\nexport default class ForgotPasswordRoute extends Route {\n @service sgtSession;\n\n beforeModel() {\n this.sgtSession.prohibitAuthentication('context.appointment');\n }\n}\n","import Controller from '@ember/controller';\n\nexport default class GuestAppointmentController extends Controller {}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your controllers.\ndeclare module '@ember/controller' {\n interface Registry {\n undefined: GuestAppointmentController;\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Context from '../../models/context';\n\ninterface ContextModel {\n context: Promise;\n}\n\n/**\n * @classdesc\n * Route for viewing Self-Guided Tours Guest appointments.\n */\nexport default class GuestAppointmentRoute extends Route {\n @service declare store: ServiceRegistry['store'];\n @service declare router: ServiceRegistry['router'];\n\n queryParams = {\n jwt: {\n refreshModel: true\n }\n };\n\n /**\n * @param model\n * @returns {{appointments: (model.appointment|Promise), context: (models.context|promise)}}\n */\n async model(params: { jwt: string }) {\n try {\n const contextModel = this.modelFor('context') as ContextModel;\n const context = await contextModel.context;\n const appointment = this.store.queryRecord('guest-appointment', {\n jwt: params.jwt\n });\n\n return {\n appointment,\n context\n };\n } catch (error) {\n this.send('error', error);\n\n return {};\n }\n }\n\n /**\n * @param model\n * redirects to not-found page if context does not have SGT3 toggle.\n */\n async afterModel(model: { context: Context }) {\n if (!model.context.useSGT3) {\n this.router.transitionTo('context.not-found', 'not-found');\n }\n }\n}\n","import { tracked } from '@glimmer/tracking';\nimport Controller from '@ember/controller';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport {\n validatePhoneNumber,\n validateEmail\n} from 'unattended-showing/utils/validators';\n\nimport type NotificationManager from '@adc/ui-components/services/notification-manager';\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Ajax from 'unattended-showing/services/ajax';\nimport type LoginPendingBookingService from 'unattended-showing/services/login-pending-booking';\nimport type { ModelFrom } from '../../../../customer-site/app/utils/type-utils';\nimport type GuestSignUpRoute from './route';\n\n/**\n * @classdesc\n * Controller for Guest Sign Up controller.\n */\nexport default class GuestSignUpController extends Controller {\n @service declare router: ServiceRegistry['router'];\n @service declare ajax: Ajax;\n @service declare store: ServiceRegistry['store'];\n @service declare loginPendingBooking: LoginPendingBookingService;\n @service declare notificationManager: NotificationManager;\n\n declare model: ModelFrom;\n\n @tracked firstName: string = '';\n @tracked lastName: string = '';\n @tracked email: string = '';\n @tracked phoneNumber: string = '';\n\n /**\n * Sends user info to server.\n * If successful, transition to verify phone number page.\n */\n @action\n async signupAsGuest(): Promise {\n //Check that the user inputs are valid.\n try {\n if (!this.firstName || this.firstName.trim() === '') {\n this.notificationManager.addError('First name is required.');\n return;\n }\n\n if (this.firstName.length > 100) {\n this.notificationManager.addError(\n 'First name cannot be longer than 100 characters.'\n );\n return;\n }\n\n if (!this.lastName || this.lastName.trim() === '') {\n this.notificationManager.addError('Last name is required.');\n return;\n }\n\n if (this.lastName.length > 100) {\n this.notificationManager.addError(\n 'Last name cannot be longer than 100 characters.'\n );\n return;\n }\n\n if (!validatePhoneNumber(this.phoneNumber)) {\n this.notificationManager.addError(\n 'Valid U.S. phone number is required.'\n );\n return;\n }\n\n if (!validateEmail(this.email)) {\n this.notificationManager.addError('Valid email is required.');\n return;\n }\n\n if (this.email.length > 100) {\n this.notificationManager.addError(\n 'Email cannot be longer than 100 characters.'\n );\n return;\n }\n\n this.model.guestSignUp = this.store.createRecord('guest-sign-up', {\n firstName: this.firstName,\n lastName: this.lastName,\n email: this.email,\n phoneNumber: this.phoneNumber,\n systemGroupId: this.model.context?.systemGroupId\n });\n\n this.model.guestSignUp = await this.model.guestSignUp.save();\n\n // Transition to phone verification and pass the JWT.\n this.router.transitionTo(\n 'context.phone-verification.guest',\n 'guest-checkout',\n {\n queryParams: {\n jwt: this.model.guestSignUp.jwt\n }\n }\n );\n } catch (error) {\n return this.ajax.handleAjaxError(\n error,\n 'Unable to sign up as guest.'\n );\n }\n }\n\n /**\n * Transitions route back to the login page.\n */\n @action async back(): Promise {\n try {\n this.router.transitionTo('context.login-sgt3');\n } catch (response) {\n return this.ajax.handleAjaxError(\n response,\n 'Unable to go to login page. Please try again later.'\n );\n }\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your controllers.\ndeclare module '@ember/controller' {\n interface Registry {\n 'context/guest-sign-up': GuestSignUpController;\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Context from '../../models/context';\n\ninterface ContextModel {\n context: Promise;\n}\n\n/**\n * @classdesc Route for sign-up SGT3.\n */\nexport default class GuestSignUpRoute extends Route {\n @service declare store: ServiceRegistry['store'];\n @service declare router: ServiceRegistry['router'];\n\n /**\n * Returns model for new user sign-up.\n *\n * @returns {{context: (models.context|promise), guestSignUp: (models.GuestSignUp|promise)}}\n */\n async model() {\n try {\n const contextModel = this.modelFor('context') as ContextModel;\n const context = await contextModel.context;\n const guestSignUp = this.store.createRecord('guest-sign-up');\n\n return { context, guestSignUp };\n } catch (error) {\n this.send('error', error);\n\n return {};\n }\n }\n\n /**\n * @param model\n * redirects to not-found page if context does not have SGT3 toggle.\n */\n async afterModel(model: { context: Context }) {\n if (!model.context || !model.context.useSGT3) {\n this.router.transitionTo('context.not-found', 'not-found');\n }\n }\n}\n","import { tracked } from '@glimmer/tracking';\nimport Controller from '@ember/controller';\nimport { action, computed, setProperties } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { zonedTimeToUtc } from 'date-fns-tz';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Appointment from 'unattended-showing/models/appointment';\nimport type Ajax from 'unattended-showing/services/ajax';\nimport type SGTSession from 'unattended-showing/services/sgt-session';\nimport type { ModelFrom } from '../../../../customer-site/app/utils/type-utils';\nimport type LocationSgt3Route from './route';\n\nexport default class LocationController extends Controller {\n @service declare sgtSession: SGTSession;\n @service declare ajax: Ajax;\n @service declare router: ServiceRegistry['router'];\n @service declare store: ServiceRegistry['store'];\n @service\n declare notificationManager: ServiceRegistry['notification-manager'];\n\n declare model: ModelFrom;\n\n @tracked showReviewAndBook: boolean = false;\n @tracked appointment: Appointment | null = null;\n @tracked targetMoveInDate: Date | null =\n this.model.profile?.targetMoveInDate ?? null;\n\n /**\n * Settings for appointment-schedule component.\n */\n @computed('model.context')\n get appointmentSettings() {\n const { appointmentLength, hoursOfOperationSchedule } =\n this.model.context || {};\n return {\n appointmentLength,\n hoursOfOperationSchedule\n };\n }\n\n /**\n * Creates a new appointment record.\n */\n createNewAppointment(): Promise {\n return (async () => {\n const location = await this.model.location;\n const newAppointment = this.store.createRecord('appointment', {\n context: this.model.context,\n location: location\n });\n return newAppointment;\n })();\n }\n\n /**\n * Actions to perform when the user clicks the Back button on the Book a Tour screen.\n */\n @action bookTourBackAction(): void {\n // TODO POINT-6907\n return;\n }\n\n /**\n * Steps to take when the user clicks Next on the Book a Tour screen.\n */\n @action async bookTourNextAction(\n tourDateTime: Date,\n desiredMoveInDate: Date\n ): Promise {\n const newAppointment: Appointment = await this.createNewAppointment(),\n location = await this.model.location,\n context = this.store.peekAll('context').objectAt(0);\n\n if (!location || !context) {\n this.showDefaultError();\n return;\n }\n\n const appointmentUtcDate = zonedTimeToUtc(\n tourDateTime,\n location.timeZone\n ),\n activePendingIdVerification = location.reverificationRequired,\n geofenceEnabled = location.geofenceEnabled;\n\n setProperties(newAppointment, {\n dateTimeUtc: appointmentUtcDate,\n current: true,\n past: false,\n activePendingIdVerification: activePendingIdVerification,\n showCheckIn: geofenceEnabled,\n subdomain: context.id\n });\n\n // Redirect to the login route if user is not logged in.\n const profileId = this.sgtSession.data?.authenticated?.profileId;\n if (!this.sgtSession.isAuthenticated || !profileId) {\n this.router.transitionTo('context.login-sgt3');\n return;\n }\n\n // Redirect to credit card verification if user has not verified credit card\n // and the dealer requires that the credit card be verified.\n const profile = await this.store.findRecord('profile', profileId);\n if (context.showCCPage && !profile.creditCardValidated) {\n this.router.transitionTo(\n 'context.credit-card-verification.account'\n );\n return;\n }\n\n this.appointment = newAppointment;\n this.targetMoveInDate = desiredMoveInDate;\n this.showReviewAndBook = true;\n return;\n }\n\n /**\n * Actions to perform when the user clicks the back button on the Review & Book screen.\n */\n @action reviewAndBookBackAction(): void {\n this.showReviewAndBook = false;\n return;\n }\n\n /**\n * Actions to perform when the user clicks the Book Tour button on the Review & Book screen.\n */\n @action async reviewAndBookNextAction(): Promise {\n console.log('this was called');\n const location = await this.model.location;\n if (!this.appointment) {\n this.showDefaultError();\n return;\n }\n try {\n await this.appointment.save();\n // TODO POINT-4774: Save the desired move in date.\n if (location) {\n location.reload();\n window.scrollTo(0, 0);\n }\n } catch (response) {\n return this.ajax.handleAjaxError(\n response,\n 'Unable to request Self-Guided Tours appointment. Please try again later.'\n );\n }\n }\n\n /**\n * Display a generic error through the notification manager when an action cannot be taken.\n */\n showDefaultError(): void {\n const defaultErrorMsg =\n 'Unable to request Self-Guided Tours appointment. Please try again later.';\n this.notificationManager.addError(defaultErrorMsg);\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your controllers.\ndeclare module '@ember/controller' {\n interface Registry {\n 'context/location-sgt3': LocationController;\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type SGTSession from 'unattended-showing/services/sgt-session';\nimport type Context from '../../models/context';\n\ninterface ContextModel {\n context: Promise;\n}\n\n/**\n * @classdesc Route for unattended property locationsSGT3.\n */\nexport default class LocationSgt3Route extends Route {\n @service declare sgtSession: SGTSession;\n @service declare store: ServiceRegistry['store'];\n @service declare router: ServiceRegistry['router'];\n\n /**\n * @param model\n * @returns {{location: (models.location|promise), context: (models.context|promise)}}\n */\n async model(model: { location_id: string | number }) {\n try {\n const contextModel = this.modelFor('context') as ContextModel;\n const context = await contextModel.context;\n const location = await this.store.findRecord(\n 'location',\n model.location_id,\n {\n adapterOptions: {\n queryParams: { systemGroupId: context.systemGroupId }\n }\n }\n );\n let profile = null;\n const profileId = this.sgtSession.data?.authenticated?.profileId;\n if (profileId) {\n profile = await this.store.findRecord('profile', profileId);\n }\n\n return {\n context,\n location,\n profile\n };\n } catch (error) {\n this.send('error', error);\n\n return {};\n }\n }\n\n /**\n * @param model\n * redirects to not-found page if context does not have SGT3 toggle.\n */\n async afterModel(model: { context: Context }) {\n if (!model.context.useSGT3) {\n this.router.transitionTo('context.not-found', 'not-found');\n }\n }\n}\n","import Controller from '@ember/controller';\nimport { computed, action, setProperties } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { getCommunitySiteMapObjectUrl } from 'unattended-showing/helpers/file-utils';\nimport { zonedTimeToUtc } from 'date-fns-tz';\n\n/**\n * @classdesc\n * Controller for Self-Guided Tours location page.\n */\nexport default class LocationController extends Controller {\n @service sgtSession;\n @service cookies;\n @service store;\n @service ajax;\n @service loginPendingBooking;\n @service checkIn;\n @service router;\n @service mockTime;\n\n @action\n handleImageError(event) {\n event.target.src = '../../assets/images/property-default-image.png';\n }\n\n /**\n * Settings for appointment-schedule component.\n *\n * @function\n * @returns {appointmentLength: Number, hoursOfOperationSchedule: List of timeblocks ({day: Number, startMinutesLocal: Number, endMinutesLocal: Number})}\n */\n @computed('model.context')\n get appointmentSettings() {\n const { appointmentLength, hoursOfOperationSchedule } =\n this.model.context;\n return {\n appointmentLength,\n hoursOfOperationSchedule\n };\n }\n\n /**\n * Gets user's current appointment at community or creates a new record if it does not exist.\n *\n * @function\n * @returns {models.Appointment}\n */\n @computed('context', 'model.location.hasAppointment')\n get appointment() {\n return (async () => {\n const location = await this.model.location;\n\n // Return existing appointment.\n if (location.hasAppointment) {\n return location.nextAppointment;\n }\n\n // Create a new one since one does not already exist.\n let newAppointment = this.store.createRecord('appointment');\n newAppointment.set('context', this.context);\n newAppointment.set('location', location);\n return newAppointment;\n })();\n }\n\n /**\n * Save new appointment. The Date passed in should be in the local timezone.\n * The Date passed to the backend should be UTC\n *\n * @function\n * @param {Date} date\n * @returns {models.Appointment|promise|null}\n */\n @action async save(date) {\n // Redirect to login route if user is not logged in.\n const context = await this.store.peekAll('context').objectAt(0),\n property = await this.model.location, // This is an ember object, timeZone is local.\n appointmentUtcDate = zonedTimeToUtc(date, property.timeZone),\n appointment = await this.appointment,\n activePendingIdVerification = property.reverificationRequired,\n geofenceEnabled = property.geofenceEnabled;\n\n // Try to save new appointment.\n setProperties(appointment, {\n dateTimeUtc: appointmentUtcDate,\n current: true,\n past: false,\n activePendingIdVerification: activePendingIdVerification,\n showCheckIn: geofenceEnabled,\n subdomain: context.id\n });\n\n if (!this.sgtSession.isAuthenticated) {\n this.loginPendingBooking.loadAppointment(appointment, property);\n this.router.transitionTo('context.login');\n return null;\n }\n\n // Redirect to credit card verification if user has not verified credit card and the dealer\n // requires that the credit card be verified.\n const profile = await this.store.findRecord(\n 'profile',\n this.sgtSession.data.authenticated.profileId\n );\n\n if (context.showCCPage && !profile.creditCardValidated) {\n this.router.transitionTo('context.sign-up.verification');\n return null;\n }\n\n try {\n await appointment.save();\n property.reload();\n window.scrollTo(0, 0);\n } catch (response) {\n return this.ajax.handleAjaxError(\n response,\n 'Unable to request Self-Guided Tours appointment. Please try again later.'\n );\n }\n\n const tourWindowStart = new Date(\n appointmentUtcDate.getTime() - 5 * 60000\n );\n const withinTourWindow =\n tourWindowStart <= (this.mockTime.mockTime ?? new Date());\n\n // Send the CPID verification if user needs to be verified and it is not within tour time.\n if (property.reverificationRequired && !withinTourWindow) {\n await this.checkIn.sendCheckpointIdVerification(\n appointment.id,\n false\n );\n }\n }\n\n /**\n * Cancel existing appointment at location.\n *\n * @function\n * @returns {models.Appointment|promise}\n */\n @action async delete() {\n let appt = await this.appointment;\n\n try {\n await appt.destroyRecord();\n const location = await this.model.location;\n location.reload();\n } catch (response) {\n return this.ajax.handleAjaxError(\n response,\n 'Unable to cancel Self-Guided Tours appointment. Please try again later.'\n );\n }\n }\n\n /**\n * Check-in the current appointment.\n */\n @action async checkInAppointment() {\n const appointment = await this.appointment;\n const property = await appointment.location;\n const cpidEnabled = await property.checkpointIdEnabled;\n await this.checkIn.appointmentCheckIn(property, appointment);\n\n if (cpidEnabled) {\n setProperties(appointment, {\n showCheckIn: false\n });\n } else {\n window.location.reload();\n }\n }\n\n /**\n * Send user the CPID verification.\n *\n * @function\n * @returns {models.Appointment|promise}\n */\n @action async reVerify() {\n const appointment = await this.appointment;\n await this.checkIn.sendCheckpointIdVerification(appointment.id);\n }\n\n /**\n * Opens a new tab for the community site map.\n *\n * @function\n */\n @action async openCommunitySiteMap(ev) {\n ev.preventDefault();\n\n await getCommunitySiteMapObjectUrl(\n this.model.context,\n this.model.context.systemGroupId,\n this.ajax\n );\n\n window.open(\n this.model.context.communitySiteMapObjectUrls[\n this.model.context.systemGroupId\n ],\n '_blank',\n 'noopener noreferrer'\n );\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\n/**\n * Route for unattended property locations.\n */\nexport default class LocationRoute extends Route {\n @service store;\n @service cookies;\n\n /**\n * @param model\n * @returns {{location: (models.location|promise), context: (models.context|promise)}}\n */\n async model(model) {\n try {\n const context = this.modelFor('context').context;\n const location = await this.store.findRecord(\n 'location',\n model.location_id,\n {\n adapterOptions: {\n queryParams: {\n systemGroupId: context.systemGroupId,\n loadImage: true\n }\n }\n }\n );\n\n // Construct this location's Url to restore if the user signs up,\n // but only store it if it is valid (both of the values below exist)\n const validUrl = context.id != null && location.id != null;\n\n if (validUrl) {\n const redirectUrl =\n '/' + context.id + '/location/' + location.id;\n this.cookies.write(\n 'ember_simple_auth-redirectTarget',\n redirectUrl\n );\n }\n\n return {\n location,\n context\n };\n } catch (error) {\n this.send('error', error);\n }\n }\n}\n","import Controller from '@ember/controller';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Ajax from 'unattended-showing/services/ajax';\nimport type LoginPendingBookingService from 'unattended-showing/services/login-pending-booking';\nimport type SGTSession from 'unattended-showing/services/sgt-session';\nimport './_style.scss';\n\n/**\n * @classdesc\n * Controller for login route.\n */\nexport default class LoginController extends Controller {\n @service declare sgtSession: SGTSession;\n @service declare router: ServiceRegistry['router'];\n @service declare ajax: Ajax;\n @service\n declare loginPendingBooking: LoginPendingBookingService;\n declare model: { context: { id: string; systemGroupId: string } };\n\n /**\n * Stores messages from backend requests.\n */\n requestMessage = '';\n\n username?: string;\n password?: string;\n\n /**\n * Attempt to authenticate user.\n */\n @action async login(): Promise {\n const { username, password, sgtSession } = this,\n { context } = this.model;\n\n try {\n // Try to authenticate user against backend.\n await sgtSession.authenticate(\n 'authenticator:credentials',\n username!,\n password!,\n context.systemGroupId\n );\n this.router.transitionTo('context.profile', context.id);\n\n // Pending appointments are appointments the user tried to book before logging\n // in that should be automatically booked upon login.\n if (this.loginPendingBooking.hasPendingAppointments) {\n await this.loginPendingBooking.processPendingAppointments();\n }\n } catch (response) {\n return this.ajax.handleAjaxError(\n response,\n 'Unable to login. Please try again later.'\n );\n }\n }\n\n /**\n * Transitions route to the signup page.\n */\n @action async signup(): Promise {\n const { context } = this.model;\n\n try {\n this.router.transitionTo('context.sign-up-sgt3', context.id);\n } catch (response) {\n return this.ajax.handleAjaxError(\n response,\n 'Unable to sign up. Please try again later.'\n );\n }\n }\n\n /**\n * Transitions route to the continue as guest page.\n */\n @action async continueAsGuest(): Promise {\n const { context } = this.model;\n\n try {\n this.router.transitionTo('context.guest-sign-up', context.id);\n } catch (response) {\n return this.ajax.handleAjaxError(\n response,\n 'Unable to continue as guest. Please try again later.'\n );\n }\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your controllers.\ndeclare module '@ember/controller' {\n interface Registry {\n 'context/login-sgt3': LoginController;\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Context from '../../models/context';\n\n/**\n * @classdesc Route for login SGT3 route.\n */\nexport default class LoginSgt3Route extends Route {\n @service declare router: ServiceRegistry['router'];\n\n /**\n * @param model\n * redirects to not-found page if context does not have SGT3 toggle.\n */\n async afterModel(model: { context: Context }) {\n if (!model.context.useSGT3) {\n this.router.transitionTo('context.not-found', 'not-found');\n }\n }\n}\n","import Controller from '@ember/controller';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\n\n/**\n * @classdesc\n * Controller for login route.\n */\nexport default class LoginController extends Controller {\n @service sgtSession;\n @service router;\n @service ajax;\n @service loginPendingBooking;\n\n /**\n * Stores messages from backend requests.\n *\n * @type {string}\n */\n requestMessage = '';\n\n username;\n password;\n\n /**\n * Attempt to authenticate user.\n *\n * @returns {Promise}\n */\n @action async login() {\n const { username, password, sgtSession } = this,\n { context } = this.model;\n\n try {\n // Try to authenticate user against backend.\n await sgtSession.authenticate(\n 'authenticator:credentials',\n username,\n password,\n context.systemGroupId\n );\n this.router.transitionTo('context.appointment', context.id);\n\n // Pending appointments are appointments the user tried to book before logging\n // in that should be automatically booked upon login.\n if (this.loginPendingBooking.hasPendingAppointments) {\n await this.loginPendingBooking.processPendingAppointments();\n }\n } catch (response) {\n return this.ajax.handleAjaxError(\n response,\n 'Unable to login. Please try again later.'\n );\n }\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\n/**\n * @classdesc Route for login.\n */\nexport default class LoginRoute extends Route {\n @service sgtSession;\n\n beforeModel() {\n this.sgtSession.prohibitAuthentication('context.appointment');\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\n/**\n * Route for logging out user.\n */\nexport default class LogoutRoute extends Route {\n @service router;\n @service sgtSession;\n @service loginPendingBooking;\n\n /**\n * Logs out current user by invalidating session.\n */\n beforeModel() {\n const { sgtSession } = this,\n contextId = this.paramsFor('context').context_id;\n\n if (sgtSession.isAuthenticated) {\n Object.assign(sgtSession.data, { contextId });\n this.loginPendingBooking.resetAppointmentData();\n sgtSession.invalidate();\n return;\n }\n\n this.router.transitionTo('context.login', contextId);\n }\n}\n","import Controller from '@ember/controller';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { POST } from '@adc/ajax/services/adc-ajax';\n\nimport type NotificationManager from '@adc/ui-components/services/notification-manager';\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Ajax from 'unattended-showing/services/ajax';\n\ninterface PhoneVerificationResponse {\n data: {\n attributes: {\n jwt: string;\n userEnteredCode: string;\n };\n };\n}\n\nexport default class ContextPhoneVerificationBaseController extends Controller {\n @service declare store: ServiceRegistry['store'];\n @service declare router: ServiceRegistry['router'];\n @service declare ajax: Ajax;\n @service declare notificationManager: NotificationManager;\n\n declare model: any;\n\n get transitionRoute(): string {\n throw new Error('transitionRoute must be overridden in the subclass');\n }\n\n get apiVerifyEndpoint(): string {\n throw new Error('apiVerifyEndpoint must be overridden in the subclass');\n }\n\n get apiResendEndpoint(): string {\n throw new Error('apiResendEndpoint must be overridden in the subclass');\n }\n\n @action\n async handleVerificationCodeSubmit(code: string): Promise {\n try {\n if (this.model.phoneVerification == null) {\n this.notificationManager.addError(\n 'Phone information is missing.'\n );\n return;\n }\n\n // Save the code to the model.\n this.model.phoneVerification.userEnteredCode = code;\n\n // phone verification POST\n const response = (await this.ajax.apiRequest(\n this.apiVerifyEndpoint,\n undefined,\n this.model.phoneVerification,\n POST\n )) as PhoneVerificationResponse;\n\n this.model.phoneVerification.jwt = response.data.attributes.jwt;\n\n this.notificationManager.addSuccess(\n 'Your phone has been verified!'\n );\n\n this.router.transitionTo(this.transitionRoute, {\n queryParams: {\n jwt: this.model.phoneVerification.jwt\n }\n });\n } catch (error) {\n this.ajax.handleApiRequestError(\n error,\n 'Unable to verify phone number.'\n );\n }\n }\n\n @action\n async handleResendCode(): Promise {\n await this.ajax.apiRequest(\n this.apiResendEndpoint,\n undefined,\n this.model.phoneVerification,\n POST\n );\n\n this.notificationManager.addSuccess(\n 'A new code has been sent to you phone!'\n );\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your controllers.\ndeclare module '@ember/controller' {\n interface Registry {\n 'context/phone-verification/base': ContextPhoneVerificationBaseController;\n }\n}\n","import { action } from '@ember/object';\nimport ContextPhoneVerificationBaseController from '../base/controller';\n\nexport default class ContextPhoneVerificationGuestController extends ContextPhoneVerificationBaseController {\n declare model: any;\n\n get transitionRoute(): string {\n if (this.model.phoneVerification.type === 'guest-appointment') {\n return 'context.guest-appointment';\n }\n\n if (this.model.context.showCCPage) {\n return 'context.credit-card-verification.guest';\n }\n\n // TODO POINT-4774 redirect to correct appointment page.\n return 'context.profile';\n }\n\n get apiVerifyEndpoint(): string {\n return 'phoneVerifications/verifyCodeGuest';\n }\n\n get apiResendEndpoint(): string {\n return 'phoneVerifications/resendCodeGuest';\n }\n\n @action\n async handleVerificationCodeSubmit(code: string): Promise {\n await super.handleVerificationCodeSubmit(code);\n }\n\n @action\n async handleResendCode(): Promise {\n await super.handleResendCode();\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your controllers.\ndeclare module '@ember/controller' {\n interface Registry {\n 'context/phone-verification/guest': ContextPhoneVerificationGuestController;\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type ContextModel from 'unattended-showing/models/context';\nimport type PhoneVerificationGuest from 'unattended-showing/models/phone-verification-guest';\nimport type Context from '../../../models/context';\n\ninterface PhoneVerificationModel {\n context: ContextModel;\n phoneVerification: PhoneVerificationGuest;\n}\n\ninterface ContextRouteModel {\n context: Promise;\n}\n\n/**\n * @classdesc Generic route for guest phone verification.\n */\nexport default class PhoneVerificationGuestRoute extends Route {\n @service declare store: ServiceRegistry['store'];\n\n queryParams = {\n jwt: {\n refreshModel: true\n }\n };\n\n async model(\n params: { type: string },\n transition: any\n ): Promise {\n const { jwt } = transition.to.queryParams;\n const contextModel = this.modelFor('context') as ContextRouteModel;\n const context = await contextModel.context;\n const phoneVerification = this.store.createRecord(\n 'phone-verification-guest'\n ) as PhoneVerificationGuest;\n\n phoneVerification.jwt = jwt;\n phoneVerification.type = params.type;\n\n return { context, phoneVerification };\n }\n}\n","import { inject as service } from '@ember/service';\nimport ProtectedRoute from 'unattended-showing/classes/protected-route';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type SGTSession from 'unattended-showing/services/sgt-session';\nimport type Context from '../../models/context';\n\ninterface ContextModel {\n context: Promise;\n}\n\ninterface ProfileSessionService extends SGTSession {\n data: {\n authenticated: {\n profileId: string;\n };\n };\n}\n\nexport default class ProfileSgt3Route extends ProtectedRoute {\n @service declare router: ServiceRegistry['router'];\n @service declare store: ServiceRegistry['store'];\n @service declare session: ProfileSessionService;\n\n /**\n * Returns profile model.\n *\n * @type {{profile: (models.Profile|promise)}}\n */\n async model() {\n try {\n const contextModel = this.modelFor('context') as ContextModel;\n const context = await contextModel.context;\n const countries = await this.store.findAll('country');\n const profile = await this.store.findRecord(\n 'profile',\n this.session.data.authenticated.profileId\n );\n\n return {\n profile,\n countries,\n context\n };\n } catch (error) {\n this.send('error', error);\n\n return {};\n }\n }\n\n async afterModel(model: { context: Context }) {\n if (!model.context.useSGT3) {\n this.router.transitionTo('context.not-found', 'not-found');\n }\n }\n}\n","import Controller from '@ember/controller';\nimport { computed } from '@ember/object';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport {\n createRowItem,\n createNativeSubField\n} from '../../components/input-form-row/index';\nimport {\n validateTextInputCustomRegex,\n validateTextInputEmail\n} from '../../utils/validators';\n\n/**\n * @classdesc\n * Controller for user profile.\n */\nexport default class ProfileController extends Controller {\n @service notificationManager;\n @service ajax;\n @service modals;\n @service router;\n\n /**\n * Save profile model.\n *\n * @type {models.Profile|promise}\n */\n @action async save(profile) {\n try {\n const result = await profile.save();\n this.notificationManager.addSuccess(\n 'Your profile has been updated.'\n );\n return result;\n } catch (response) {\n this.ajax.handleAjaxError(\n response,\n 'Unable to update profile. Please try again later.'\n );\n }\n }\n\n /**\n * Deletes a user's account.\n *\n * @param {*} profile\n */\n @action delete(profile) {\n this.modals.showConfirmationDialog(\n 'Confirm Delete',\n 'Are you sure you want to delete your account?',\n {\n text: 'Confirm',\n css: 'delete-profile',\n action: async () => {\n try {\n await profile.destroyRecord();\n this.router.transitionTo('context.logout');\n } catch (response) {\n this.ajax.handleAjaxError(\n response,\n 'Unable to delete profile. Please try again later.'\n );\n }\n }\n }\n );\n }\n\n /**\n * Returns object for country data\n *\n * @type {Array<{zipValidator: {Function}}>}\n */\n @computed('model.countries')\n get zipValidators() {\n return this.model.countries.map((country) =>\n validateTextInputCustomRegex.bind(\n null,\n new RegExp(country.zipValidator)\n )\n );\n }\n\n /**\n * Returns data needed to construct user input form on template.\n *\n * @type {Array<{label: {String}, subFields: Array<{inputType: {String}, propertyName: {String}}>, validator: {Function}, errorMessage: {String}}>}\n */\n get userInfoFields() {\n const fnTextValidate = validateTextInputCustomRegex.bind(\n null,\n /[a-zA-Z]+/\n );\n const fnNumberValidate = validateTextInputCustomRegex.bind(\n null,\n /^[0-9]+$/\n );\n const postalCodeValidate = (input) =>\n this.zipValidators.some((validator) => validator(input));\n\n return [\n createRowItem(\n 'First name',\n [createNativeSubField('firstName')],\n fnTextValidate,\n 'Please enter your first name.'\n ),\n createRowItem(\n 'Last name',\n [createNativeSubField('lastName')],\n fnTextValidate,\n 'Please enter your last name.'\n ),\n createRowItem(\n 'Email',\n [createNativeSubField('email')],\n validateTextInputEmail,\n 'Please enter a valid email.'\n ),\n createRowItem(\n 'Mobile number',\n [createNativeSubField('mobileNumber', 'text', 11)],\n fnNumberValidate,\n 'Please enter a valid mobile number (include area code).'\n ),\n createRowItem(\n 'Postal code',\n [createNativeSubField('zipCode', 'text', 5)],\n postalCodeValidate,\n 'Please enter a valid postal code.'\n )\n ];\n }\n}\n","import { inject as service } from '@ember/service';\nimport ProtectedRoute from 'unattended-showing/classes/protected-route';\n\n/**\n * @classdesc\n * Route for user profile.\n */\nexport default class ProfileRoute extends ProtectedRoute {\n @service sgtSession;\n @service store;\n\n /**\n * Returns profile model.\n *\n * @type {{profile: (models.Profile|promise)}}\n */\n async model() {\n const countries = await this.store.findAll('country');\n\n return {\n profile: this.store.findRecord(\n 'profile',\n this.sgtSession.data.authenticated.profileId\n ),\n countries\n };\n }\n\n /**\n * Rollback model if not saving when exiting route.\n */\n async deactivate() {\n const profile = await this.currentModel.profile;\n if (profile.hasDirtyAttributes && !profile.isSaving) {\n profile.rollbackAttributes();\n }\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\n/**\n * Route for redirecting to location's scheduling page using dealer's external identifier.\n */\nexport default class RedirectRoute extends Route {\n @service store;\n @service router;\n\n /** @override **/\n model(param) {\n return {\n externalIdentifier: this.store.findRecord(\n 'external-identifier',\n param.external_identifier_id,\n {\n adapterOptions: {\n queryParams: {\n systemGroupId:\n this.modelFor('context').context.systemGroupId\n }\n }\n }\n )\n };\n }\n\n /** @override **/\n async afterModel(model) {\n const externalIdentifier = await model.externalIdentifier;\n this.router.transitionTo(\n 'context.location',\n externalIdentifier.internalId\n );\n }\n}\n","import { action } from '@ember/object';\nimport Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\n/**\n * Calculate hex color code for luminance changes. Taken from: http://www.sitepoint.com/javascript-generate-lighter-darker-color/.\n *\n * @param {String} hex\n * @param {Number} lum\n *\n * @returns {String}\n *\n * @private\n */\nfunction changeBrightness(hex, lum) {\n // Validate hex string.\n hex = String(hex).replace(/[^0-9a-f]/gi, '');\n if (hex.length < 6) {\n hex = hex.replace(/(.)/g, '$1$1');\n }\n\n lum = lum || 0;\n\n // Convert to decimal and change luminosity.\n let rgb = '#',\n c;\n for (let i = 0; i < 3; ++i) {\n c = parseInt(hex.substr(i * 2, 2), 16);\n c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16);\n rgb += ('00' + c).substr(c.length);\n }\n\n return rgb;\n}\n\n/**\n * @classdesc\n * Parent route for any pages that need dealer context.\n */\nexport default class ContextRoute extends Route {\n @service notificationManager;\n @service errorReporting;\n @service store;\n @service router;\n\n /**\n * @returns {{Context: (models.Context|Promise)}}\n */\n async model(param) {\n return {\n context: await this.store.findRecord('context', param.context_id)\n };\n }\n\n afterModel(model) {\n const dealerBrandedColor = model.context.backgroundColor;\n if (dealerBrandedColor) {\n const rootStyle = document.documentElement.style;\n rootStyle.setProperty(`--dealer-branded-color`, dealerBrandedColor);\n rootStyle.setProperty(\n `--dealer-branded-color-hover`,\n changeBrightness(dealerBrandedColor, -0.2)\n );\n }\n\n // Update favIcon.\n const favIcon = document.querySelector(\"link[rel*='icon']\");\n if (favIcon) {\n favIcon.href = `/app/assets/images/${\n model.context.hasPointCentralDealer ? 'pcfavicon' : 'adcfavicon'\n }.png`;\n }\n\n // Set context for Sentry error reporting\n this.errorReporting.setContext({\n user: {\n id: model.context.id\n },\n tags: model.context.toJSON(),\n extra: { model: model.context }\n });\n }\n\n @action error(error) {\n const context = this.store.peekAll('context').objectAt(0);\n\n if (context) {\n let errorMessages = error?.errors?.errors ?? error?.errors ?? [];\n\n // Make sure errorMessages is an array.\n if (typeof errorMessages === 'string') {\n errorMessages = [errorMessages];\n }\n\n // Show the error message first since we're handling the error here.\n errorMessages.forEach((error) =>\n this.notificationManager.addError(error.detail ?? error)\n );\n this.router.transitionTo('context.not-found', 'not-found');\n } else {\n // If no context was found, the error cannot be handled here. Let the application error route handle it.\n return true;\n }\n\n // Let error reporting service report it.\n throw error;\n }\n}\n","import { tracked } from '@glimmer/tracking';\nimport Controller from '@ember/controller';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport {\n validateEmail,\n validatePhoneNumber\n} from 'unattended-showing/utils/validators';\nimport { POST } from '@adc/ajax/services/adc-ajax';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type { ModelFrom } from '../../../../customer-site/app/utils/type-utils';\nimport type SignUpSgt3Route from './route';\n\n/**\n * The default value of the passwordStrengthData property. This is declared here\n * to be able to reset to the default value when leaving the password screen or\n * no value is available yet.\n */\nconst DEFAULT_PASSWORD_STRENGTH_DATA = {\n strength: NaN,\n suggestions: [] as string[],\n warningKey: ''\n};\n\ninterface PasswordStrengthData {\n strength: number;\n suggestions: string[];\n warningKey: string;\n}\n\nexport default class SignUpSgt3Controller extends Controller {\n @service\n declare ajax: ServiceRegistry['ajax'];\n @service\n declare notificationManager: ServiceRegistry['notification-manager'];\n @service\n declare router: ServiceRegistry['router'];\n @service\n declare sgtSession: ServiceRegistry['sgt-session'];\n @service\n declare store: ServiceRegistry['store'];\n\n @tracked firstName = '';\n @tracked lastName = '';\n @tracked phoneNumber = '';\n @tracked email = '';\n @tracked password = '';\n @tracked passwordConfirmation = '';\n @tracked passwordStrengthData = DEFAULT_PASSWORD_STRENGTH_DATA;\n\n declare model: ModelFrom;\n\n /**\n * Makes an API call to get password strength data for the change password component.\n * This data includes a strength value as well as relevant strong password tips.\n */\n @action\n async getPasswordStrength(): Promise {\n if (this.password !== '') {\n await this.ajax\n .apiRequest(\n 'passwordStrength/getPasswordStrength',\n undefined,\n { password: this.password },\n POST\n )\n .then((response: { value: PasswordStrengthData }) => {\n const value = response.value;\n if (value) {\n this.passwordStrengthData = value;\n }\n })\n .catch((response: any) => {\n response.errors = (response.errors ?? []).filter(\n ({ source }: { source: { pointer: string } }) =>\n source && source.pointer\n );\n return Promise.reject(response);\n });\n } else {\n this.passwordStrengthData = DEFAULT_PASSWORD_STRENGTH_DATA;\n }\n }\n\n /**\n * Create the new account if all inputs are valid.\n */\n @action async createAccount(): Promise {\n if (!this.validateUserInputs()) {\n return;\n }\n\n try {\n const signUpRequestBody = {\n profile: {\n firstName: this.firstName,\n lastName: this.lastName,\n mobileNumber: Number(this.phoneNumber.replace(/\\D/g, '')),\n email: this.email\n },\n password: {\n password: this.password,\n confirmPassword: this.passwordConfirmation\n },\n systemGroupId: this.model.context.systemGroupId\n };\n\n await this.ajax.apiRequest(\n 'signUps',\n undefined,\n signUpRequestBody,\n POST\n );\n\n await this.sgtSession.authenticate(\n 'authenticator:credentials',\n this.email,\n this.password\n );\n\n // TODO POINT-6907: Handle transitions while booking tour\n this.router.transitionTo(\n 'context.appointment-sgt3',\n this.model.context.id\n );\n } catch (response) {\n this.ajax.handleApiRequestError(\n response,\n 'Unable sign up new user.'\n );\n }\n }\n\n /**\n * Check the user inputs for errors.\n */\n validateUserInputs(): boolean {\n const errors: string[] = [],\n requiredFields = new Map([\n ['First Name', this.firstName],\n ['Last Name', this.lastName],\n ['Phone Number', this.phoneNumber],\n ['Email', this.email],\n ['Password', this.password],\n ['Confirm Password', this.passwordConfirmation]\n ]);\n\n requiredFields.forEach((value, label) => {\n if (!value) {\n errors.push(`${label} is required.`);\n }\n });\n\n if (!validatePhoneNumber(this.phoneNumber)) {\n errors.push('Invalid Phone Number.');\n }\n if (!validateEmail(this.email)) {\n errors.push('Invalid Email.');\n }\n\n if (this.password !== this.passwordConfirmation) {\n errors.push('Passwords do not match.');\n }\n\n if (errors.length > 0) {\n this.notificationManager.addError(errors[0]);\n return false;\n }\n\n return true;\n }\n\n /**\n * Button action to return to the previous page.\n */\n @action back(): void {\n // TODO: Add back functionality in POINT-4493\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your controllers.\ndeclare module '@ember/controller' {\n interface Registry {\n 'context/sign-up-sgt3/index': SignUpSgt3Controller;\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Context from '../../models/context';\n\ninterface SignUpRouteModel {\n context: Context;\n mostCommonPasswordTips: string[];\n}\n\ninterface ContextRouteModel {\n context: Promise;\n}\n\n/**\n * @classdesc Route for sign-up SGT3.\n */\nexport default class SignUpSgt3Route extends Route {\n @service declare ajax: ServiceRegistry['ajax'];\n @service declare router: ServiceRegistry['router'];\n @service declare sgtSession: ServiceRegistry['sgt-session'];\n @service declare store: ServiceRegistry['store'];\n\n declare currentModel: SignUpRouteModel;\n\n /**\n * Verify that user is not logged in; otherwise redirect user to appointments page.\n * We do not use the UnauthenticatedRouteMixin here because we login the user after signing up.\n * That mixin will cause the user to be redirected immediately.\n */\n beforeModel(): void {\n this.sgtSession.prohibitAuthentication('context.appointment-sgt3');\n }\n\n /**\n * Returns model for new user sign-up.\n */\n async model(): Promise {\n const contextModel = this.modelFor('context') as ContextRouteModel;\n const context = await contextModel.context;\n let mostCommonPasswordTips: string[] = [];\n await this.ajax\n .apiRequest('passwordStrength/getCommonPasswordTips')\n .then((response: { value: string[] }) => {\n mostCommonPasswordTips = response.value;\n });\n return { context, mostCommonPasswordTips };\n }\n\n /**\n * Redirects to not-found page if context does not have SGT3 toggle.\n */\n afterModel(model: { context: Context }): void {\n if (!model.context || !model.context.useSGT3) {\n this.router.transitionTo('context.not-found', 'not-found');\n }\n }\n}\n","import Controller from '@ember/controller';\nimport { computed, action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport {\n createRowItem,\n createNativeSubField\n} from '../../../components/input-form-row/index';\nimport {\n validateTextInputPassword,\n validateTextInputEmail,\n validateTextInputCustomRegex\n} from '../../../utils/validators';\n\n/**\n * Controller for personal-information sign-up sub-route.\n */\nexport default class SignUpPersonalInformationController extends Controller {\n @service sgtSession;\n @service cookies;\n @service store;\n @service router;\n @service ajax;\n @service loginPendingBooking;\n\n /**\n * Response message from server requests.\n *\n * @type {String}\n * @default ''\n */\n requestMessage = '';\n\n /**\n * Returns object for country data\n *\n * @function\n * @returns {Array<{zipValidator: {Function}}>}\n */\n @computed('model.countries')\n get zipValidators() {\n return this.model.countries.map((country) =>\n validateTextInputCustomRegex.bind(\n null,\n new RegExp('^' + country.zipValidator + '$')\n )\n );\n }\n\n /**\n * Returns fields needed for template to generate sign up fields for user's personal information.\n *\n * @function\n * @returns {Array<{label: {String}, subFields: Array<{inputType: {String}, propertyName: {String}}>, validator: {Function}, errorMessage: {String}}>}\n */\n @computed('zipValidators')\n get userInfoFields() {\n const fnTextValidate = validateTextInputCustomRegex.bind(\n null,\n /[a-zA-Z]+/\n );\n const fnNumberValidate = validateTextInputCustomRegex.bind(\n null,\n /^[0-9]+$/\n );\n const postalCodeValidate = (input) =>\n this.zipValidators.some((validator) => validator(input));\n\n return [\n createRowItem(\n 'First name',\n [createNativeSubField('firstName')],\n fnTextValidate,\n 'Please enter your first name.'\n ),\n createRowItem(\n 'Last name',\n [createNativeSubField('lastName')],\n fnTextValidate,\n 'Please enter your last name.'\n ),\n createRowItem(\n 'Email',\n [createNativeSubField('email')],\n validateTextInputEmail,\n 'Please enter a valid email.'\n ),\n createRowItem(\n 'Mobile number',\n [createNativeSubField('mobileNumber', 'text', 11)],\n fnNumberValidate,\n 'Please enter a valid mobile number (include area code).'\n ),\n createRowItem(\n 'Postal code',\n [createNativeSubField('zipCode', 'text', 6)],\n postalCodeValidate,\n 'Please enter a valid postal code.'\n )\n ];\n }\n\n /**\n * Returns fields needed for template to generate sign up fields for user's password.\n *\n * @function\n * @returns {Array<{label: {String}, subFields: Array<{inputType: {String}, propertyName: {String}}>, validator: {Function}, errorMessage: {String}}>}\n */\n get userPasswordFields() {\n return [\n createRowItem(\n 'Password',\n [createNativeSubField('password', 'password')],\n validateTextInputPassword,\n 'Password must contain at least eight characters, one number (0-9), and one capital letter.'\n ),\n createRowItem(\n 'Confirm password',\n [createNativeSubField('confirmPassword', 'password')],\n validateTextInputPassword,\n 'Please enter the same password again.'\n )\n ];\n }\n\n /**\n * Save new user profile.\n *\n * @param {models.SignUp} model\n * @returns {models.SignUp|promise}\n */\n @action async save(model) {\n const signUp = await model.signUp,\n profile = await model.signUp.profile,\n password = await model.signUp.password,\n { cookies, router } = this;\n\n // Save user profile and then transition to credit card verification route.\n try {\n await signUp.save();\n\n // Cache and restore redirect URL cookie value because authentication call will wipe it.\n const redirectUrl = this.cookies.read(\n 'ember_simple_auth-redirectTarget'\n );\n\n await this.sgtSession.authenticate(\n 'authenticator:credentials',\n profile.email,\n password.password\n );\n\n // If the redirect cookie was set before the authenticate call, then restore it.\n if (redirectUrl) {\n cookies.write('ember_simple_auth-redirectTarget', redirectUrl);\n }\n\n // If the dealer requires credit card verification, redirect to cc verification\n // Else if the user has a pending appointment (appointment selected prior to logging in),\n // then that appointment should be automatically booked.\n // Otherwise, redirect user to the saved cookie, if it exists.\n const context = await this.store.peekAll('context').objectAt(0);\n if (context.showCCPage) {\n router.transitionTo('context.sign-up.verification', context.id);\n } else if (this.loginPendingBooking.hasPendingAppointments) {\n await this.loginPendingBooking.processPendingAppointments();\n } else {\n // eslint-disable-next-line ember/no-array-prototype-extensions\n cookies.clear('ember_simple_auth-redirectTarget');\n router.transitionTo(\n redirectUrl || 'context.appointment',\n context.id\n );\n }\n } catch (response) {\n return this.ajax.handleAjaxError(\n response,\n 'Unable sign up new user.'\n );\n }\n }\n}\n","import Route from '@ember/routing/route';\nimport { run } from '@ember/runloop';\nimport { inject as service } from '@ember/service';\n\n/**\n * @classdesc Personal Information sub-route for user sign-up.\n */\nexport default class SignUpPersonalInformationRoute extends Route {\n @service sgtSession;\n @service store;\n\n /**\n * Verify that user is not logged in; otherwise redirect user to appointments page. We do not use the UnauthenticatedRouteMixin\n * mixin here because we login the user after signing up. That mixin will cause the user to be redirected immediately.\n */\n beforeModel() {\n this.sgtSession.prohibitAuthentication('context.appointment');\n }\n\n /**\n * Returns model for new user sign-up.\n *\n * @returns {{signUp: (models.SignUp|promise)}}\n */\n async model() {\n const signUp = this.store.createRecord('sign-up');\n const countries = await this.store.findAll('country');\n signUp.set('profile', this.store.createRecord('profile'));\n signUp.set('password', this.store.createRecord('profile-password'));\n\n return { signUp, countries };\n }\n\n /**\n * Deletes created model if not saving when exiting route.\n */\n async deactivate() {\n const profile = await this.currentModel.signUp.profile;\n const password = await this.currentModel.signUp.password;\n\n // Need the explicit run loops here for unit tests.\n // Do not copy this deprecated usage. If you see this, please convert to using ember-lifeline.\n // eslint-disable-next-line ember/no-runloop\n run(() => profile.unloadRecord());\n // Do not copy this deprecated usage. If you see this, please convert to using ember-lifeline.\n // eslint-disable-next-line ember/no-runloop\n run(() => password.unloadRecord());\n // Do not copy this deprecated usage. If you see this, please convert to using ember-lifeline.\n // eslint-disable-next-line ember/no-runloop\n run(() => this.currentModel.signUp.unloadRecord());\n }\n}\n","import Controller from '@ember/controller';\nimport { computed, action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport DropdownSelectItem from '@adc/ui-components/utils/dropdown-select-item';\nimport {\n createRowItem,\n createNativeSubField,\n createDropdownSubField\n} from '../../../components/input-form-row/index';\nimport { validateTextInputCustomRegex } from '../../../utils/validators';\n\n/**\n * Get DropdownSelectItem options for credit card expiration year.\n *\n * @function\n * @private\n * @static\n * @returns [Array]\n */\nfunction creditCardExpirationMonthOptions() {\n const monthNames = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n ];\n\n return Array.from(new Array(12), (_, index) =>\n DropdownSelectItem.create({\n name:\n (index + 1).toLocaleString('en-US', {\n minimumIntegerDigits: 2\n }) +\n ' - ' +\n monthNames[index],\n value: index + 1\n })\n );\n}\n\n/**\n * Get DropdownSelectItem options for credit card expiration month.\n *\n * @function\n * @private\n * @static\n * @returns {Array}\n */\nfunction creditCardExpirationYearOptions() {\n const currentDate = new Date();\n\n return Array.from(new Array(11)).map((_, index) => {\n const newDate = new Date(currentDate);\n newDate.setFullYear(currentDate.getFullYear() + index);\n const year = newDate.getFullYear();\n\n return DropdownSelectItem.create({\n name: year,\n value: year\n });\n });\n}\n\n/**\n * Get DropdownSelectItem options for country dropdown.\n *\n * @function\n * @private\n * @static\n * @returns {Array}\n */\nfunction createCountryListItems(countryData) {\n return Object.keys(countryData).map((enumValue) =>\n DropdownSelectItem.create({\n name: countryData[enumValue].name,\n value: enumValue\n })\n );\n}\n\n/**\n * Get DropdownSelectItem options for states dropdown.\n *\n * @function\n * @private\n * @static\n * @returns {Array}\n */\nfunction createStateListItems(states) {\n return (states || []).map((name) =>\n DropdownSelectItem.create({\n name,\n value: name\n })\n );\n}\n\nconst fnTextValidate = validateTextInputCustomRegex.bind(null, /[a-zA-Z]+/);\nconst fnNumberValidate = validateTextInputCustomRegex.bind(null, /^[0-9]+$/);\n\n/**\n * @classdesc Verification controller for user sign-up.\n *\n * @class context.sign-up.verification.SignUpVerificationController\n * @extends Controller\n *\n */\nexport default class SignUpVerificationController extends Controller {\n @service cookies;\n @service store;\n @service ajax;\n @service loginPendingBooking;\n @service router;\n\n /**\n * Returns object for country data\n *\n * @function\n * @returns {Array<{name: {String}, states: Array, address: {zipLength: {Number}, zipValidator: {Function}}}>}\n */\n @computed('model.countries')\n get countryData() {\n // eslint-disable-next-line ember/no-array-prototype-extensions\n return this.model.countries\n .toArray()\n .map((country) => {\n return {\n [country.id]: {\n name: country.countryName,\n states: country.states,\n address: {\n zipLength: country.zipLength,\n zipValidator: validateTextInputCustomRegex.bind(\n null,\n new RegExp(country.zipValidator)\n )\n },\n zipFieldName: country.zipFieldName,\n stateFieldName: country.stateFieldName\n }\n };\n })\n .reduce(function (obj, item) {\n for (let key in item) obj[key] = item[key];\n return obj;\n }, {});\n }\n\n /**\n * Returns object for generating credit card verification user input fields.\n *\n * @function\n * @returns {Array<{label: {String}, subFields: Array<{inputType: {String}, propertyName: {String}, placeHolder: {String}, valueChange: {Function}, dropdownItems: Array, maxLength: {Number}}>, validator: {Function}, errorMessage: {String}}>}\n */\n @computed(\n 'countryData',\n 'model.creditCardVerification',\n 'updateModelProperty'\n )\n get userInfoFields() {\n return [\n createRowItem(\n 'First name',\n [createNativeSubField('firstName')],\n fnTextValidate,\n 'Please enter your first name.'\n ),\n createRowItem(\n 'Last name',\n [createNativeSubField('lastName')],\n fnTextValidate,\n 'Please enter your last name.'\n ),\n createRowItem(\n 'Card number',\n [createNativeSubField('cardNumber', 'text', 16)],\n fnNumberValidate,\n 'Please enter a valid credit card number.'\n ),\n createRowItem('Expiration', [\n createDropdownSubField(\n 'expirationMonth',\n this.updateModelProperty,\n creditCardExpirationMonthOptions(),\n 'Month'\n ),\n createDropdownSubField(\n 'expirationYear',\n this.updateModelProperty,\n creditCardExpirationYearOptions(),\n 'Year'\n )\n ]),\n createRowItem(\n 'Security code',\n [createNativeSubField('securityCode', 'password')],\n fnNumberValidate,\n 'Please enter the security code on the credit card.'\n ),\n createRowItem('Country', [\n createDropdownSubField(\n 'country',\n this.updateModelProperty,\n createCountryListItems(this.countryData),\n 'Country'\n )\n ])\n ];\n }\n\n /**\n * Returns object for generating billing address user input fields.\n *\n * @function\n * @returns {Array<{label: {String}, subFields: Array<{inputType: {String}, propertyName: {String}, placeHolder: {String}, valueChange: {Function}, dropdownItems: Array, maxLength: {Number}}>, validator: {Function}, errorMessage: {String}}>}\n */\n @computed(\n 'updateModelProperty',\n 'countryData',\n 'model.creditCardVerification.country'\n )\n get addressInfoFields() {\n const countryData = this.countryData;\n const selectedCountry = this.model.creditCardVerification.country;\n return selectedCountry === 0\n ? []\n : [\n createRowItem(\n 'Address',\n [createNativeSubField('address')],\n fnTextValidate,\n 'Please enter your address.'\n ),\n createRowItem(\n 'City',\n [createNativeSubField('city')],\n fnTextValidate,\n 'Please enter your city.'\n ),\n createRowItem(countryData[selectedCountry].stateFieldName, [\n createDropdownSubField(\n 'state',\n this.updateModelProperty,\n createStateListItems(\n countryData[selectedCountry].states\n ),\n countryData[selectedCountry].stateFieldName\n )\n ]),\n createRowItem(\n countryData[selectedCountry].zipFieldName,\n [\n createNativeSubField(\n 'zipCode',\n 'text',\n countryData[selectedCountry].address.zipLength\n )\n ],\n countryData[selectedCountry].address.zipValidator,\n `Please enter your ${countryData[selectedCountry].zipFieldName}.`\n )\n ];\n }\n\n /**\n * Sends user credit card information to backend server to be verified.\n *\n * @function\n * @param {models.CreditCardVerification} model\n * @returns {models.CreditCardVerification|promise}\n */\n @action async save(model) {\n // Send credit card information to backend and redirect to profile route if successful.\n try {\n let creditCardVerification = await model.creditCardVerification;\n await creditCardVerification.save();\n\n // Remove cached versions of profile so next time we read, we grab a new version which should contain\n // fresh cc validation state.\n this.store.unloadAll('profile');\n const redirectUrl = this.cookies.read(\n 'ember_simple_auth-redirectTarget'\n );\n // eslint-disable-next-line ember/no-array-prototype-extensions\n this.cookies.clear('ember_simple_auth-redirectTarget');\n if (this.loginPendingBooking.hasPendingAppointments) {\n await this.loginPendingBooking.processPendingAppointments();\n } else {\n this.router.transitionTo(redirectUrl || 'context.profile');\n }\n } catch (response) {\n return this.ajax.handleAjaxError(\n response,\n 'Unable to verify credit card information. Please try again later.'\n );\n }\n }\n\n /**\n * Helper action to set model properties. Used by the ADC dropdown on-change.\n *\n * @function\n * @param model\n * @param property\n * @param value\n */\n updateModelProperty(model, property, value) {\n model.set(property, value);\n }\n}\n","import { inject as service } from '@ember/service';\nimport ProtectedRoute from 'unattended-showing/classes/protected-route';\n\n/**\n * @classdesc\n * Verification sub-route for user sign-up.\n */\nexport default class SignUpVerificationRoute extends ProtectedRoute {\n @service store;\n\n /**\n * Creates new credit card verification model.\n *\n * @returns {{creditCardVerification: (models.CreditCardVerification|promise)}}\n */\n async model() {\n const countries = await this.store.findAll('country');\n return {\n creditCardVerification: this.store.createRecord(\n 'credit-card-verification'\n ),\n countries\n };\n }\n\n /**\n * Deletes created model if not saving when exiting route.\n */\n async deactivate() {\n const creditCardVerificationModel = await this.currentModel\n .creditCardVerification;\n creditCardVerificationModel.unloadRecord();\n }\n}\n","/**\n * @module\n */\n\n/**\n * @enum {number}\n */\nexport const NotSet = 0;\n/**\n * @enum {number}\n */\nexport const USA = 1;\n/**\n * @enum {number}\n */\nexport const Canada = 2;\n","/**\n * Utility file containing URLs used throughout the application.\n * @module\n */\n\n/**\n * Default logo to display in the header if no dealer logo is provided.\n */\nexport const DefaultLogo =\n 'https://alarmadmin.alarm.com//api/PublishedImage.ashx?guid=C7E50E3E-5E8C-4FC2-9F8F-042FA9A52572';\n\n/**\n * Link to pointcentral.com.\n */\nexport const PointCentralSite = 'https://www.pointcentral.com/';\n\n/**\n * Link to alarm.com.\n */\nexport const AlarmSite = 'https://www.alarm.com/';\n\n/**\n * Link to PointCentral's privacy policy.\n */\nexport const PointCentralPrivacyPolicy =\n 'https://www.pointcentral.com/privacy-policy/';\n\n/**\n * Link to Alarm.com's privacy policy.\n */\nexport const AlarmPrivacyPolicy = 'https://alarm.com/privacy/';\n\n/**\n * Link to PointCentral's terms of use.\n */\nexport const PointCentralTerms = 'https://www.pointcentral.com/terms-of-use/';\n\n/**\n * Link to Alarm.com's terms of use.\n */\nexport const AlarmTerms = 'https://www.alarm.com/terms_conditions.aspx/';\n","/**\n * Create an object url from a data url.\n *\n * @param {string} dataUrl\n * @returns {string} The object url\n */\nexport function dataUrlToObjectUrl(dataUrl) {\n if (!dataUrl) {\n return null;\n }\n\n const data = dataUrl.split(',');\n const byteString = window.atob(data[1]);\n const fileType = data[0].split(':')[1].split(';')[0];\n\n const bytes = new Uint8Array(byteString.length);\n for (let i = 0; i < byteString.length; i++) {\n bytes[i] = byteString.charCodeAt(i);\n }\n\n const file = new Blob([bytes.buffer], { type: fileType });\n return URL.createObjectURL(file);\n}\n\n/**\n * Gets the community site map object url and caches it in the context.\n *\n * @param {ContextModel} context\n * @param {Number} groupId\n * @param {Ajax} ajax\n */\nexport async function getCommunitySiteMapObjectUrl(context, groupId, ajax) {\n // Initialize cache if undefined.\n if (!context.communitySiteMapObjectUrls) {\n context.communitySiteMapObjectUrls = {};\n }\n\n // Fetch the map if it is not cached.\n // There can be multiple upcoming appointments from different groups with different maps.\n if (!(groupId in context.communitySiteMapObjectUrls)) {\n const dataUrl = await ajax.apiRequest(`/fileUploads/map/${groupId}`);\n\n context.communitySiteMapObjectUrls[groupId] = dataUrlToObjectUrl(\n dataUrl.value\n );\n }\n}\n","import Helper from '@ember/component/helper';\nimport { assert } from '@ember/debug';\nimport * as LinkUrl from 'unattended-showing/enums/LinkUrl';\n\nexport interface GetLinkUrlSignature {\n Args: {\n Positional: [keyof typeof LinkUrl];\n };\n Return: string;\n}\n\n/**\n * Template helper that accepts the name of a URL from LinkUrl and returns the URL string.\n *\n * @example\n * Alarm.com\n */\nexport default class getLinkUrl extends Helper {\n compute([\n urlName\n ]: GetLinkUrlSignature['Args']['Positional']): GetLinkUrlSignature['Return'] {\n const url = LinkUrl[urlName];\n assert(\n `Invalid url name \"${urlName}\" passed to [get-link-url] template helper`,\n !!url\n );\n return url;\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n 'get-link-url': typeof getLinkUrl;\n }\n}\n","import Controller from '@ember/controller';\nimport { htmlSafe } from '@ember/template';\nimport ENV from 'unattended-showing/config/environment';\n\nexport default class LandingPageController extends Controller {\n /**\n * The root URL path for all SVG sprites.\n *\n * @type {String}\n */\n get svgSpriteRoot() {\n return htmlSafe(`${ENV.rootURL}assets/svg-sprites`);\n }\n\n /**\n * Returns check list items for title area section of landing page.\n *\n * @type {Array<{String}>}\n */\n get titleAreaCheckList() {\n return [\n 'Around 30% of prospects who stop by a leasing office find the leasing office closed',\n \"Over 40% of U.S. adults have searched for an apartment in the last two years, yet four in ten have passed on an apartment because they couldn't find time to see it\"\n ];\n }\n\n /**\n * Returns \"How it Works\" steps for landing page.\n *\n * @type {{step: string, text: string}[]}\n */\n get howItWorksSteps() {\n return [\n 'Enable Self-Guided Tours links on your property page',\n 'Prospective resident finds a property online and schedules Self-Guided Tours via the Self-Guided Tours link',\n 'The renter receives a confirmation text with a temporary lock code to access the property',\n 'A notification is sent to the property manager or builder letting them know it is being viewed',\n 'When the tour is complete, the temporary digital smart key is deleted and another notification is sent to the property manager or builder, allowing them to follow up with the prospective resident'\n ].map((text, idx) => ({\n step: idx + 1,\n text\n }));\n }\n\n get solutionExplanation() {\n return [\n {\n id: 1,\n header: 'Self-Guided Tours',\n description:\n 'Prospective homeowners or renters can schedule a tour whenever convenient with a user code that keeps all access secure and accounted for.',\n icon: 'touchpad-lock',\n homeOwner: true,\n propertyManager: true\n },\n {\n id: 2,\n header: 'Operational Efficiencies and Asset Protection',\n description:\n \"Self-Guided Tours, keyless locks that don't need to be rekeyed, leak detectors, HVAC efficiency and predictive notifications, curb to couch access control,\" +\n ' and other services help your staff save time and money, while also helping operators better protect assets.',\n icon: 'thermostat',\n propertyManager: true\n },\n {\n id: 3,\n header: 'Resident Amenity',\n description:\n 'Keyless access, HVAC savings and add-ons like video cameras or monitored life safety services provide in-demand amenities that short and long term renters are looking for.',\n icon: 'lock',\n propertyManager: true\n },\n {\n id: 4,\n header: 'Upsell Options',\n description:\n 'Provide an easy upgrade path to professionally monitored security, life safety, and video monitoring.',\n icon: 'video',\n homeOwner: true,\n propertyManager: true\n },\n {\n id: 5,\n header: 'Single App Experience',\n description:\n \"Seamlessly integrate with homeowners' devices. Control the system through one application, via computer, tablet or smartphone.\",\n icon: 'phone',\n homeOwner: true,\n propertyManager: true\n }\n ];\n }\n\n /**\n * Returns FAQ items for landing page. Each question must have a unique id in order for dropdown tabs to work.\n *\n * @type {Array<{section: {String}, questions: Array<{id: {Number}, question: {String}, answers: Array<{String}>}>}>}\n */\n get faq() {\n return [\n {\n section: 'Overview',\n questions: [\n {\n id: 1,\n question:\n 'How does Alarm.com’s Self-Guided Tours feature work?',\n answers: [\n 'After creating an account, you’ll have access to search all properties that have been loaded into the Self-Guided Tours feature by the property manager.',\n 'After finding your desired property, you can view a calendar of available timeslots in which you can schedule a viewing.',\n 'After selecting a time on the calendar, you will receive a lock code for the front door lock which will be usable for the duration of your scheduled showing.',\n 'When your visit is complete, you’ll simply want to close and lock the door as you leave. That’s it!'\n ]\n },\n {\n id: 2,\n question: 'Do Prospects need to download an app?',\n answers: [\n 'No app is needed. Simply input the code that is emailed to you in the lock at the property.'\n ]\n },\n {\n id: 3,\n question: 'Is Wi-Fi needed?',\n answers: [\n 'No, you can implement Self-Guided Tours with a cellular lock and a hub.'\n ]\n },\n {\n id: 4,\n question:\n 'Is the property owned or managed by Alarm.com?',\n answers: [\n 'No, the property is owned and managed by the property manager independently from Alarm.com. Alarm.com is the technology provider that the property manager leverages to provide a self-guided tour to their tenant prospects.'\n ]\n }\n ]\n },\n {\n section: 'Creating an Account',\n questions: [\n {\n id: 5,\n question: 'Why won’t it let me create an account?',\n answers: [\n 'Make sure all requested information is filled out from the Identity verification page. All boxes are required to be completed for sign up.',\n 'Double check that your credit card number is entered correctly.',\n 'If you do not have a credit card, please contact the property manager to see if there are alternative methods for viewing the home.'\n ]\n },\n {\n id: 6,\n question:\n 'Does Alarm.com keep my Credit/Debit Card info on file?',\n answers: [\n 'No, we will not store your credit card information after the verification check is complete.'\n ]\n },\n {\n id: 7,\n question: \"What if I don't have a credit card?\",\n answers: [\n 'A debit or credit card will be required to create a Self-Guided Tours account for verification purposes. If you do not have a credit card, please contact the property manager for alternative methods of access to view the property.'\n ]\n },\n {\n id: 8,\n question: 'Why do I need a credit card?',\n answers: [\n 'A credit card is required to schedule Self-Guided Tours to verify your stated identity.'\n ]\n }\n ]\n },\n {\n section: 'Viewing a Property',\n questions: [\n {\n id: 9,\n question:\n 'Why can’t I find the property I’m looking for?',\n answers: [\n 'It’s possible that the property is not integrated with Alarm.com’s website, or may no longer be available. If the property you are looking for cannot be found, please contact the property manager to confirm its availability.'\n ]\n },\n {\n id: 10,\n question:\n 'Why won’t it let me schedule a showing on the property?',\n answers: [\n 'The ability to schedule a showing is dependent on wireless communication both in and outside of the home. In the event the lock is unable to communicate through the Self-Guided Tours app, please contact the property manager for alternative methods to schedule and view the property.',\n 'Another reason may be that the property is no longer available but not removed yet. Please contact the property manager for alternative methods to schedule and view another property.'\n ]\n },\n {\n id: 11,\n question: 'Why doesn’t my lock code unlock the lock?',\n answers: [\n 'Double check that you are trying to use the assigned lock code during the previously scheduled period of time.',\n 'Double check that you are using the correct lock code.',\n 'To access: (1) if lock keypad has * or Schlage button, press it first. (2) Enter lock code. (3) Press * or Schlage button if present.',\n 'If the lock in unable to unlock, contact the property manager for assistance accessing the home.'\n ]\n },\n {\n id: 12,\n question:\n 'Who do I contact if I notice something wrong at the property?',\n answers: [\n 'If you identify property damage, or any other items you feel should be reported, please contact the property manager.'\n ]\n },\n {\n id: 13,\n question: 'Can I see a property more than once?',\n answers: [\n 'Yes, if the property is still available, then feel free to schedule additional showings on a property you’ve already visited.'\n ]\n }\n ]\n }\n ];\n }\n}\n","import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nexport default class IndexRoute extends Route {\n @service router;\n @service metrics;\n\n constructor(...args) {\n super(...args);\n\n const { router } = this;\n\n this.metrics.trackPage({\n page: router.currentURL,\n title: router.currentRouteName || 'unknown'\n });\n }\n}\n","import ENV from 'unattended-showing/config/environment';\n\n/**\n * Environment settings instance initializer\n *\n * @param {Ember.ApplicationInstance} applicationInstance\n */\nexport function initialize(applicationInstance) {\n let envSettings = applicationInstance.lookup('service:envSettings');\n if (envSettings) {\n envSettings.setEnvironment(ENV);\n }\n}\n\nexport default {\n initialize\n};\n","import Model, { attr, belongsTo } from '@ember-data/model';\nimport { computed } from '@ember/object';\nimport { alias } from '@ember/object/computed';\n\nimport type { AsyncBelongsTo } from '@ember-data/model';\nimport type Context from './context';\nimport type Location from './location';\n\n/**\n * @classdesc\n * Model for user appointment data.\n */\nexport default class Appointment extends Model {\n /**\n * Date appointment was created.\n */\n @attr('date') declare createdAt: Date;\n\n /**\n * Date appointment was updated.\n */\n @attr('date') declare updatedAt: Date;\n\n /**\n * Appointment lock code.\n */\n @attr('string') declare userCode: string;\n\n /**\n * Code for onsite non-ADC integrated gate.\n */\n @attr('string') declare gateCode: string;\n\n /**\n * Appointment date and time. The dateTimeUtc passed from the backend should be in UTC.\n * Note: This time will be converted to the browser's local time.\n */\n @attr('date') declare dateTimeUtc: Date;\n\n /**\n * Appointment date and time in system's local timezone as a string for displaying.\n * The `dateTimeLocal` property creates a date time object from this string, so use\n * that object when displaying the local date time of an appointment for the end-user.\n */\n @attr('string') declare localAppointmentStartTime: string;\n\n /**\n * Whether the appointment is an upcoming appointment.\n */\n @attr('boolean') declare activePendingIdVerification: boolean;\n\n /**\n * Appointment location.\n */\n @belongsTo('location', { async: true, inverse: null })\n declare location: AsyncBelongsTo;\n\n /**\n * Appointment's dealer.\n */\n @belongsTo('context', { async: true, inverse: null })\n declare context: AsyncBelongsTo;\n\n /**\n * Whether the appointment is a current appointment (i.e. not expired).\n */\n @attr('boolean') declare current: boolean;\n\n /**\n * Whether the appointment is a past appointment (i.e. completed successfully).\n */\n @attr('boolean') declare past: boolean;\n\n /**\n * Returns street address of associated location.\n */\n @alias('location.streetAddress')\n declare streetAddress: Location['streetAddress'];\n\n /**\n * Returns region of associated location.\n */\n @alias('location.region') declare region: Location['region'];\n\n /**\n * Returns full address of associated location.\n */\n @alias('location.fullAddress') declare fullAddress: Location['fullAddress'];\n\n /**\n * Appointment subdomain.\n */\n @attr('string') declare subdomain: string;\n\n /**\n * Whether the check-in button should be displayed.\n */\n @attr('boolean') declare showCheckIn: boolean;\n\n /**\n * Returns the timezone of the appointment.\n */\n @computed('location.timeZone')\n get timeZone(): string {\n // DO NOT COPY THIS, PLEASE IMPLEMENT THE SUGGESTION AND TEST.\n // @ts-expect-error `location` is async so we have to await it before we query it's properties.\n return this.location.timeZone;\n }\n\n /**\n * Local appointment date and time.\n */\n @computed('localAppointmentStartTime')\n get dateTimeLocal(): Date {\n return new Date(this.localAppointmentStartTime);\n }\n\n /**\n * Appointment length.\n */\n @attr('number') declare length: number;\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your models.\ndeclare module 'ember-data/types/registries/model' {\n export default interface ModelRegistry {\n appointment: Appointment;\n }\n}\n","import { hasMany } from '@ember-data/model';\nimport BaseLocation from './base-location';\n\n/**\n * @classdesc\n * Model for storing Self-Guided Tours availableUnitsList (Single Link Showings) information.\n */\nexport default class AvailableUnitsList extends BaseLocation {\n /**\n * List of properties in this Self-Guided Tours group.\n *\n * @type {model.Location[]}\n */\n // Do not copy this deprecated usage. If you see this, please fix it\n // eslint-disable-next-line ember/require-async-inverse-relationship\n @hasMany('location', { async: true })\n locations;\n}\n","import Model, { attr, belongsTo } from '@ember-data/model';\nimport { computed } from '@ember/object';\nimport { bool } from '@ember/object/computed';\n\nimport type { AsyncBelongsTo } from '@ember-data/model';\nimport type Appointment from './appointment';\n\n/**\n * @classdesc\n * Base model for common data in models.Location.\n */\nexport default class BaseLocation extends Model {\n /**\n * Street address line 1 for Self-Guided Tours location.\n */\n @attr('string')\n declare street1: string;\n\n /**\n * Street address line 2 for Self-Guided Tours location.\n */\n @attr('string')\n declare street2: string;\n\n /**\n * City for Self-Guided Tours location address.\n */\n @attr('string')\n declare city: string;\n\n /**\n * State for Self-Guided Tours location address.\n */\n @attr('string')\n declare state: string;\n\n /**\n * Zip code for Self-Guided Tours location address.\n */\n @attr('string')\n declare zipCode: string;\n\n /**\n * URL of picture for Self-Guided Tours location.\n */\n @attr('string')\n declare pictureUrl: string;\n\n /**\n * Current user's appointment slot.\n */\n @belongsTo('appointment', { async: true, inverse: null })\n declare nextAppointment: AsyncBelongsTo;\n\n /**\n * Time zone of Self-Guided Tours location.\n */\n @attr('string')\n declare timeZone: string;\n\n /**\n * Abbreviation of the time zone of Self-Guided Tours location.\n */\n @attr('string')\n declare timeZoneAbbreviation: string;\n\n /**\n * Returns the appointment ID if the user has an appointment scheduled at this location.\n */\n @bool('nextAppointment.id')\n declare hasAppointment: boolean;\n\n /**\n * If the unit requires photo verification in order to tour\n */\n @attr('boolean')\n declare checkpointIdEnabled: boolean;\n\n /**\n * Whether this location has geofencing enabled.\n */\n @attr('boolean')\n declare geofenceEnabled: boolean;\n\n /**\n * If the user needs to be verified\n */\n @attr('boolean')\n declare reverificationRequired: boolean;\n\n /**\n * UserId\n */\n @attr('string')\n declare userId: string;\n\n /**\n * GroupId\n */\n @attr('string')\n declare groupId: string;\n\n /**\n * Location ID for CheckpointID\n */\n @attr('string')\n declare checkpointIDLocationID: string;\n\n /**\n * API Key for CheckpointID\n */\n @attr('string')\n declare checkpointIDApiKey: string;\n\n /**\n * Returns the street address of the location.\n */\n @computed('street1', 'street2')\n get streetAddress(): string {\n if (!this.street2) {\n return this.street1;\n }\n return `${this.street1}, ${this.street2}`;\n }\n\n /**\n * Returns the region portion of the location.\n */\n @computed('city', 'state', 'zipCode')\n get region(): string {\n return `${this.city}, ${this.state} ${this.zipCode}`;\n }\n\n /**\n * Returns the full address of the location.\n */\n @computed('streetAddress', 'region')\n get fullAddress(): string {\n return `${this.streetAddress}, ${this.region}`;\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your models.\ndeclare module 'ember-data/types/registries/model' {\n export default interface ModelRegistry {\n 'base-location': BaseLocation;\n }\n}\n","import Model, { attr } from '@ember-data/model';\nimport { get } from '@ember/object';\n\n/**\n * @classdesc\n * Model for loading dealer-specific branding and styling.\n */\nexport default class ContextModel extends Model {\n /**\n * Color of application body.\n *\n * @type {String}\n */\n @attr('string')\n backgroundColor;\n\n /**\n * URL of dealer logo.\n *\n * @type {String}\n */\n @attr('string')\n logoUrl;\n\n /**\n * Length of Self-Guided Tours appointments. Default is 90 minutes.\n *\n * @type {Number}\n * @default 90\n */\n @attr('number', { defaultValue: 90 })\n appointmentLength;\n\n /**\n * System Group ID for context.\n *\n * @type {number}\n */\n @attr('number')\n systemGroupId;\n\n /**\n * Does the dealer require credit card verification\n *\n * @type {boolean}\n */\n @attr('boolean')\n showCCPage;\n\n /**\n * Is the dealer a PointCentral dealer?\n *\n * @type {boolean}\n */\n @attr('boolean')\n hasPointCentralDealer;\n\n /**\n * What name should we show as powering the website?\n *\n * @type {String}\n */\n @attr('string')\n poweredByName;\n\n /**\n * Whether there is a community site map.\n *\n * @type {boolean}\n */\n @attr('boolean')\n hasCommunitySiteMap;\n\n /**\n * Whether there are terms and conditions a prospect must accept in order to book a tour.\n *\n * @type {boolean}\n */\n @attr('boolean')\n hasTermsAndConditions;\n\n /**\n * Cache for community site map object urls for different groups.\n * The Appointments page can have upcoming apppointments for different groups with different maps.\n *\n * @type {Object.}\n */\n @attr()\n communitySiteMapObjectUrls;\n\n /**\n * Object url for the terms and conditions file.\n *\n * @type {String}\n */\n @attr('string')\n termsAndConditionsObjectUrl;\n\n /**\n * Name of the PointCentral community.\n *\n * @type {String}\n */\n @attr('string')\n communityName;\n\n /**\n * Schedule for available tour times.\n *\n * @type {object}\n */\n @attr('hours-of-operation')\n hoursOfOperationSchedule;\n\n /**\n * Whether the group context can use Self-Guided Tours 3.0.\n *\n * @type {boolean}\n */\n @attr('boolean', { defaultValue: false })\n useSGT3;\n\n toJSON() {\n const json = {};\n this.eachAttribute((a) => (json[a] = get(this, a)));\n return json;\n }\n}\n","import Model, { attr } from '@ember-data/model';\n\n/**\n * @classdesc\n * Model for storing countries Self-Guided Tours is available in.\n */\nexport default class Country extends Model {\n /**\n * Name of country\n */\n @attr('string')\n declare countryName: string;\n\n /**\n * Array of states for country\n */\n @attr()\n declare states: string[];\n\n /**\n * Name of \"Zip\" type field for country\n */\n @attr('string')\n declare zipFieldName: string;\n\n /**\n * Name of \"State\" type field for country\n */\n @attr('string')\n declare stateFieldName: string;\n\n /**\n * Required length for zip/postal code for country\n */\n @attr('number')\n declare zipLength: number;\n\n /**\n * Regex, as a string, for zip/postal code validation\n */\n @attr('string')\n declare zipValidator: string;\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your models.\ndeclare module 'ember-data/types/registries/model' {\n export default interface ModelRegistry {\n country: Country;\n }\n}\n","import Model, { attr } from '@ember-data/model';\n\n/**\n * Model for storing credit card validation information.\n */\nexport default class CreditCardVerification extends Model {\n /**\n * First name on credit card.\n */\n @attr('string')\n declare firstName: string;\n\n /**\n * Last name on credit card.\n */\n @attr('string')\n declare lastName: string;\n\n /**\n * Credit card number.\n */\n @attr('string')\n declare cardNumber: string;\n\n /**\n * Credit card expiration month in MM.\n */\n @attr('number')\n declare expirationMonth: number;\n\n /**\n * Credit card expiration year in YYYY.\n */\n @attr('number')\n declare expirationYear: number;\n\n /**\n * Credit card security code.\n */\n @attr('number')\n declare securityCode: number;\n\n /**\n * Credit card billing street address.\n */\n @attr('string')\n declare address: string;\n\n /**\n * Credit card billing address city.\n */\n @attr('string')\n declare city: string;\n\n /**\n * Credit card billing address state.\n */\n @attr('string')\n declare state: string;\n\n /**\n * Credit card billing address zip code.\n */\n @attr('string')\n declare zipCode: string;\n\n /**\n * Credit card billing address country.\n */\n @attr('number', { defaultValue: 0 })\n declare country: number;\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your models.\ndeclare module 'ember-data/types/registries/model' {\n export default interface ModelRegistry {\n 'credit-card-verification': CreditCardVerification;\n }\n}\n","import Model, { attr } from '@ember-data/model';\n\n/**\n * @classdesc\n * Model for storing mapping information between dealer external identifier and internal ID.\n */\nexport default class ExternalIdentifier extends Model {\n /**\n * Internal ID mapped to external identifier.\n *\n * @type {number}\n */\n @attr('number', { defaultValue: 0 })\n internalId;\n}\n","import Model, { attr } from '@ember-data/model';\n\nexport default class GuestAppointment extends Model {\n /**\n * The JWT used to store information for guest checkouts and appointments\n */\n @attr('string') declare jwt: string;\n\n /**\n * Whether the user has verified their phone to view this appointment\n */\n @attr('boolean') declare isPhoneVerifiedForViewing: boolean;\n\n /**\n * The appointment Id.\n */\n @attr('number') declare appointmentId: number;\n\n /**\n * The user id.\n */\n @attr('number') declare userId: number;\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your models.\ndeclare module 'ember-data/types/registries/model' {\n export default interface ModelRegistry {\n 'guest-appointment': GuestAppointment;\n }\n}\n","import Model, { attr } from '@ember-data/model';\n\nexport default class GuestSignUp extends Model {\n @attr('string') declare firstName: string;\n @attr('string') declare lastName: string;\n @attr('string') declare phoneNumber: string;\n @attr('string') declare email: string;\n @attr('number') declare systemGroupId: number;\n @attr('string') declare jwt: string | null;\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your models.\ndeclare module 'ember-data/types/registries/model' {\n export default interface ModelRegistry {\n 'guest-sign-up': GuestSignUp;\n }\n}\n","import { attr, hasMany } from '@ember-data/model';\nimport { computed } from '@ember/object';\nimport BaseLocation from './base-location';\n\nimport type { AsyncHasMany } from '@ember-data/model';\nimport type SanitizedAppointment from './sanitized-appointment';\n\n/**\n * @classdesc\n * Model for storing Self-Guided Tours property information.\n */\nexport default class LocationModel extends BaseLocation {\n /**\n * Number of bedrooms for Self-Guided Tours property.\n */\n @attr('number') declare numberOfBedrooms: number;\n\n /**\n * Number of bathrooms for Self-Guided Tours property.\n */\n @attr('number') declare numberOfBathrooms: number;\n\n /**\n * Square footage of Self-Guided Tours property.\n */\n @attr('number') declare squareFootage: number;\n\n /**\n * Rent for Self-Guided Tours property.\n */\n @attr('number') declare rent: number;\n\n /**\n * Localized string for rent or price\n */\n @attr('string') declare rentOrPriceString: string;\n\n /**\n * Unit name\n */\n @attr('string') declare unitDescription: string;\n\n /**\n * Creation date for Self-Guided Tours property record.\n */\n @attr('date') declare createdAt: Date;\n\n /**\n * Last updated date for Self-Guided Tours property record.\n */\n @attr('date') declare updatedAt: Date;\n\n /**\n * Appointment slots for property that are unavailable.\n */\n @hasMany('sanitized-appointment', {\n inverse: 'location',\n async: true\n })\n declare unavailablePeriods: AsyncHasMany;\n\n /**\n * Appointment slots retrieved from the CRM integration if the property is integrated.\n */\n @attr() declare appointmentTimeSlotsFromCrmLocal: any;\n\n /**\n * Whether the location's community has a site map.\n */\n @attr('boolean') declare hasCommunitySiteMap: boolean;\n\n /**\n * Returns property details along with its label.\n */\n @computed(\n 'formattedRent',\n 'numberOfBathrooms',\n 'numberOfBedrooms',\n 'rent',\n 'rentOrPriceString',\n 'squareFootage'\n )\n get availableDetails(): { title: string; value: string }[] {\n return [\n ['Beds', this.numberOfBedrooms.toLocaleString()],\n ['Baths', this.numberOfBathrooms.toLocaleString()],\n ['Sq. Ft.', this.squareFootage.toLocaleString()],\n [this.rentOrPriceString, this.formattedRent]\n ]\n .map(([title, value]) => ({ title, value }))\n .filter((attribute) => attribute.value);\n }\n\n /**\n * Returns the locations rent as a formatted string.\n */\n @computed('rent')\n get formattedRent(): string {\n if (!this.rent) {\n return '-';\n }\n\n const wholeNumberRent = Math.trunc(this.rent);\n return `$${wholeNumberRent.toLocaleString()}`;\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your models.\ndeclare module 'ember-data/types/registries/model' {\n export default interface ModelRegistry {\n location: LocationModel;\n }\n}\n","import { attr } from '@ember-data/model';\nimport PhoneVerification from './phone-verification';\n\n/**\n * @classdesc\n * Model for storing Self-Guided Tours phone verification info for guest checkout.\n */\nexport default class PhoneVerificationGuest extends PhoneVerification {\n /**\n * The JWT used to store information for guest checkouts and appointments\n */\n @attr('string') declare jwt: string | null;\n\n /**\n * The type of guest phone verification, booking or appointment\n */\n declare type: string;\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your models.\ndeclare module 'ember-data/types/registries/model' {\n export default interface ModelRegistry {\n 'phone-verification-guest': PhoneVerificationGuest;\n }\n}\n","import Model, { attr } from '@ember-data/model';\n\n/**\n * @classdesc\n * Model for storing Self-Guided Tours phone verification info for guest checkout.\n */\nexport default class PhoneVerification extends Model {\n /**\n * The code the user has entered.\n */\n @attr('string') declare userEnteredCode: string;\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your models.\ndeclare module 'ember-data/types/registries/model' {\n export default interface ModelRegistry {\n 'phone-verification': PhoneVerification;\n }\n}\n","import Model, { attr } from '@ember-data/model';\n\n/**\n * @classdesc\n * Model for storing user profile password.\n */\nexport default class ProfilePassword extends Model {\n /**\n * User's new password.\n */\n @attr('string')\n declare password: string;\n\n /**\n * User's password confirmation.\n */\n @attr('string')\n declare confirmPassword: string;\n\n /**\n * Authorization token used when resetting password.\n */\n @attr('string')\n declare token: string;\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your models.\ndeclare module 'ember-data/types/registries/model' {\n export default interface ModelRegistry {\n 'profile-password': ProfilePassword;\n }\n}\n","import Model, { attr } from '@ember-data/model';\nimport { computed } from '@ember/object';\n\n/**\n * @classdesc\n * Model for storing user profile information.\n */\nexport default class ProfileModel extends Model {\n /**\n * First name of user.\n */\n @attr('string')\n declare firstName: string;\n\n /**\n * Last name of user.\n */\n @attr('string')\n declare lastName: string;\n\n /**\n * Email of user.\n */\n @attr('string')\n declare email: string;\n\n /**\n * Mobile phone number of user.\n */\n @attr('number')\n declare mobileNumber: number;\n\n /**\n * Zip code of user.\n */\n @attr('string')\n declare zipCode: string;\n\n /**\n * User profile creation date.\n */\n @attr('date')\n declare createdAt: Date;\n\n /**\n * User profile last updated date.\n */\n @attr('date')\n declare updatedAt: Date;\n\n /**\n * Whether a forced password reset is required.\n */\n @attr('boolean', { defaultValue: false })\n declare forcePasswordReset: boolean;\n\n /**\n * Whether user's credit card has been validated.\n */\n @attr('boolean', { defaultValue: false })\n declare creditCardValidated: boolean;\n\n /**\n * User's desired move in date.\n */\n @attr('date')\n declare targetMoveInDate: Date;\n\n /**\n * Return full name of user.\n *\n * @type {String}\n */\n @computed('firstName', 'lastName')\n get fullName(): string {\n return `${this.firstName} ${this.lastName}`;\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your models.\ndeclare module 'ember-data/types/registries/model' {\n export default interface ModelRegistry {\n profile: ProfileModel;\n }\n}\n","import Model, { attr, belongsTo } from '@ember-data/model';\n\nimport type { AsyncBelongsTo } from '@ember-data/model';\nimport type LocationModel from './location';\n\n/**\n * @classdesc\n * Model for storing locations' unavailable appointment slots.\n */\nexport default class SanitizedAppointment extends Model {\n /**\n * Date of unavailable appointment slot.\n */\n @attr('date')\n declare dateTimeUtc: Date;\n\n /**\n * Whether the appointment is a Tour Now.\n */\n @attr('boolean')\n declare isTourNow: boolean;\n\n /**\n * Location reference of unavailable appointment slot.\n */\n @belongsTo('location', { inverse: 'unavailablePeriods', async: true })\n declare location: AsyncBelongsTo;\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your models.\ndeclare module 'ember-data/types/registries/model' {\n export default interface ModelRegistry {\n 'sanitized-appointment': SanitizedAppointment;\n }\n}\n","import Model, { belongsTo } from '@ember-data/model';\n\nimport type ProfileModel from './profile';\nimport type ProfilePassword from './profile-password';\n\n/**\n * @classdesc\n * Model for storing new user's signup information.\n */\nexport default class SignUpModel extends Model {\n /**\n * New user's profile\n */\n @belongsTo('profile', { async: true, inverse: null })\n declare profile: ProfileModel;\n\n /**\n * New user's password.\n */\n @belongsTo('profile-password', { async: true, inverse: null })\n declare password: ProfilePassword;\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your models.\ndeclare module 'ember-data/types/registries/model' {\n export default interface ModelRegistry {\n 'sign-up': SignUpModel;\n }\n}\n","import FormatNumberModifier from './number-formatter';\n\n/**\n * Formats an input field in the format ###-###-####.\n */\nexport default class FormatPhoneNumberModifier extends FormatNumberModifier {\n maxDigits = 10;\n\n format(value: string): string {\n if (value.length > 3 && value.length <= 6) {\n return value.replace(/(\\d{3})(\\d+)/, '$1-$2');\n } else if (value.length > 6) {\n return value.replace(/(\\d{3})(\\d{3})(\\d+)/, '$1-$2-$3');\n }\n return value;\n }\n}\n","import { registerDestructor } from '@ember/destroyable';\nimport { action } from '@ember/object';\nimport Modifier from 'ember-modifier';\n\nconst NON_DIGIT_REGEX = /\\D/g;\n\nfunction removeListener(instance: FormatNumberModifier): void {\n instance.element?.removeEventListener('input', instance.handleInput);\n}\n\n/**\n * Base class for formatting a digit-based input.\n */\nexport default abstract class FormatNumberModifier extends Modifier {\n element?: HTMLInputElement;\n abstract maxDigits: number;\n\n modify(element: HTMLInputElement): void {\n this.addListener(element);\n this.element = element;\n registerDestructor(this, removeListener);\n }\n\n addListener(element: HTMLInputElement): void {\n element.addEventListener('input', this.handleInput);\n }\n\n @action\n handleInput(event: Event): void {\n if (event.target) {\n const target = event.target as HTMLInputElement,\n sanitizedValue = this.sanitizeValue(target.value);\n target.value = this.format(sanitizedValue);\n }\n }\n\n /**\n * Override this method to format the value.\n * The value parameter is stripped of non-digits and trimmed.\n */\n abstract format(value: string): string;\n\n /**\n * Remove non-digit characters from the value.\n */\n sanitizeValue(value: string): string {\n return value.replace(NON_DIGIT_REGEX, '').substring(0, this.maxDigits);\n }\n}\n","import Resolver from 'ember-resolver';\n\nexport default Resolver;\n","import Ember from 'ember';\nimport { registerWaiter } from '@ember/test';\n\n// this ensures that if @ember/test-waiters exists in multiple places in the\n// build output we will still use a single map of waiters (there really should\n// only be one of them, or else `settled` will not work at all)\nconst WAITERS = function () {\n const HAS_SYMBOL = typeof Symbol !== 'undefined';\n let symbolName = 'TEST_WAITERS';\n let symbol = HAS_SYMBOL ? Symbol.for(symbolName) : symbolName;\n let global = getGlobal();\n let waiters = global[symbol];\n if (waiters === undefined) {\n waiters = global[symbol] = new Map();\n }\n return waiters;\n}();\nfunction indexable(input) {\n return input;\n}\nfunction getGlobal() {\n // eslint-disable-next-line node/no-unsupported-features/es-builtins\n if (typeof globalThis !== 'undefined') return indexable(globalThis);\n if (typeof self !== 'undefined') return indexable(self);\n if (typeof window !== 'undefined') return indexable(window);\n if (typeof global !== 'undefined') return indexable(global);\n throw new Error('unable to locate global object');\n}\n/**\n * Backwards compatibility with legacy waiters system.\n *\n * We want to always register a waiter using the legacy waiter system, as right\n * now if consumers are not on the right version of @ember/test-helpers, using\n * this addon will result in none of these waiters waiting.\n */\n// eslint-disable-next-line ember/new-module-imports\n\nif (Ember.Test) {\n registerWaiter(() => !hasPendingWaiters());\n}\n/**\n * Registers a waiter.\n *\n * @public\n * @param waiter {Waiter} A test waiter instance\n */\n\nexport function register(waiter) {\n WAITERS.set(waiter.name, waiter);\n}\n/**\n * Un-registers a waiter.\n *\n * @public\n * @param waiter {Waiter} A test waiter instance\n */\n\nexport function unregister(waiter) {\n WAITERS.delete(waiter.name);\n}\n/**\n * Gets an array of all waiters current registered.\n *\n * @public\n * @returns {Waiter[]}\n */\n\nexport function getWaiters() {\n let result = [];\n WAITERS.forEach(value => {\n result.push(value);\n });\n return result;\n}\n/**\n * Clears all waiters.\n *\n * @private\n */\n\nexport function _reset() {\n for (let waiter of getWaiters()) {\n waiter.isRegistered = false;\n }\n WAITERS.clear();\n}\n/**\n * Gets the current state of all waiters. Any waiters whose\n * `waitUntil` method returns false will be considered `pending`.\n *\n * @returns {PendingWaiterState} An object containing a count of all waiters\n * pending and a `waiters` object containing the name of all pending waiters\n * and their debug info.\n */\n\nexport function getPendingWaiterState() {\n let result = {\n pending: 0,\n waiters: {}\n };\n WAITERS.forEach(waiter => {\n if (!waiter.waitUntil()) {\n result.pending++;\n let debugInfo = waiter.debugInfo();\n result.waiters[waiter.name] = debugInfo || true;\n }\n });\n return result;\n}\n/**\n * Determines if there are any pending waiters.\n *\n * @returns {boolean} `true` if there are pending waiters, otherwise `false`.\n */\n\nexport function hasPendingWaiters() {\n let state = getPendingWaiterState();\n return state.pending > 0;\n}","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { DEBUG } from '@glimmer/env';\nimport { warn } from '@ember/debug';\nimport Token from './token';\nimport { register } from './waiter-manager';\nconst WAITER_NAME_PATTERN = /^[^:]*:?.*/;\nlet WAITER_NAMES = DEBUG ? new Set() : undefined;\nexport function _resetWaiterNames() {\n WAITER_NAMES = new Set();\n}\nfunction getNextToken() {\n return new Token();\n}\nclass TestWaiterImpl {\n constructor(name, nextToken) {\n _defineProperty(this, \"isRegistered\", false);\n _defineProperty(this, \"items\", new Map());\n _defineProperty(this, \"completedOperationsForTokens\", new WeakMap());\n _defineProperty(this, \"completedOperationsForPrimitives\", new Map());\n this.name = name; // @ts-ignore\n\n this.nextToken = nextToken || getNextToken;\n }\n beginAsync(token = this.nextToken(), label) {\n this._register();\n if (this.items.has(token)) {\n throw new Error(`beginAsync called for ${token} but it is already pending.`);\n }\n let error = new Error();\n this.items.set(token, {\n get stack() {\n return error.stack;\n },\n label\n });\n return token;\n }\n endAsync(token) {\n if (!this.items.has(token) && !this._getCompletedOperations(token).has(token)) {\n throw new Error(`testWaiter.endAsync called with no preceding testWaiter.beginAsync call.\n Test waiter calls should always be paired. This can occur when a test waiter's paired calls are invoked in a non-deterministic order.\n\n See https://github.com/emberjs/ember-test-waiters#keep-beginasyncendasync-in-same-block-scope for more information.`);\n }\n this.items.delete(token); // Mark when a waiter operation has completed so we can distinguish\n // whether endAsync is being called before a prior beginAsync call above.\n\n this._getCompletedOperations(token).set(token, true);\n }\n waitUntil() {\n return this.items.size === 0;\n }\n debugInfo() {\n let result = [];\n this.items.forEach(value => {\n result.push(value);\n });\n return result;\n }\n reset() {\n this.items.clear();\n }\n _register() {\n if (!this.isRegistered) {\n register(this);\n this.isRegistered = true;\n }\n }\n _getCompletedOperations(token) {\n let type = typeof token;\n let isFunction = type === 'function';\n let isObject = token !== null && type === 'object';\n let isPrimitive = !isFunction && !isObject;\n return isPrimitive ? this.completedOperationsForPrimitives : this.completedOperationsForTokens;\n }\n}\nclass NoopTestWaiter {\n constructor(name) {\n this.name = name;\n }\n beginAsync() {\n return this;\n }\n endAsync() {}\n waitUntil() {\n return true;\n }\n debugInfo() {\n return [];\n }\n reset() {}\n}\n/**\n * Builds and returns a test waiter. The type of the\n * returned waiter is dependent on whether the app or\n * addon is in `DEBUG` mode or not.\n *\n * @public\n *\n * @param name {string} The name of the test waiter\n * @returns {TestWaiter}\n *\n * @example\n *\n * import Component from '@ember/component';\n * import { buildWaiter } from '@ember/test-waiters';\n *\n * if (DEBUG) {\n * let waiter = buildWaiter('friend-waiter');\n * }\n *\n * export default class Friendz extends Component {\n * didInsertElement() {\n * let token = waiter.beginAsync(this);\n *\n * someAsyncWork().then(() => {\n * waiter.endAsync(token);\n * });\n * }\n * }\n */\n\nexport default function buildWaiter(name) {\n if (DEBUG) {\n warn(`The waiter name '${name}' is already in use`, !WAITER_NAMES.has(name), {\n id: '@ember/test-waiters.duplicate-waiter-name'\n });\n WAITER_NAMES.add(name);\n }\n if (!DEBUG) {\n return new NoopTestWaiter(name);\n } else {\n warn(`You must provide a name that contains a descriptive prefix separated by a colon.\n\n Example: ember-fictitious-addon:some-file\n\n You passed: ${name}`, WAITER_NAME_PATTERN.test(name), {\n id: '@ember/test-waiters.invalid-waiter-name'\n });\n return new TestWaiterImpl(name);\n }\n}","/* eslint-disable ember/no-private-routing-service */\n/*\n This code is adapted from ember-engines/addon/-private/router-ext.js.\n*/\nimport EmberRouter from '@ember/routing/router';\nimport { buildWaiter } from '@ember/test-waiters';\nimport { macroCondition, getGlobalConfig } from '@embroider/macros';\n\ninterface GlobalConfig {\n '@embroider/core'?: { active: boolean };\n}\n\nlet Router: typeof EmberRouter;\n\ninterface GetRoute {\n (name: string): unknown;\n isEmbroiderRouterHandler?: true;\n}\n\ninterface Internals {\n _engineInfoByRoute: Record;\n _routerMicrolib: {\n getRoute: GetRoute;\n };\n}\n\ninterface EmbroiderBundle {\n names: string[];\n loaded?: true;\n load: () => Promise;\n}\n\nif (macroCondition(getGlobalConfig()['@embroider/core']?.active ?? false)) {\n const waiter = buildWaiter('@embroider/router:lazy-route-waiter');\n\n function embroiderBundles(): {\n _embroiderEngineBundles_?: EmbroiderBundle[];\n _embroiderRouteBundles_?: EmbroiderBundle[];\n } {\n return window as ReturnType;\n }\n\n class EmbroiderRouter extends EmberRouter {\n private seenByRoute = new Set();\n\n private lazyRoute(this: this & Internals, routeName: string): EmbroiderBundle | undefined {\n let bundles = embroiderBundles();\n if (bundles._embroiderRouteBundles_) {\n return bundles._embroiderRouteBundles_.find(bundle => bundle.names.indexOf(routeName) !== -1);\n }\n return undefined;\n }\n\n private lazyEngine(this: this & Internals, routeName: string): EmbroiderBundle | undefined {\n // Here we map engine names to route names. We need to do this because\n // engines can be specified with \"as\" such as:\n //\n // this.mount('lazy-engine', { path: '/use-lazy-engine', as: 'use-lazy-engine' });\n //\n // This presents a problem at build time since we cant get this \"mount point\" name. This is because the\n // router is dynamic and the string could be defined as anything. Luckly, this._engineInfoByRoute contains\n // mappings from routeName to the engines \"original name\" (which we know at build time).\n let bundles = embroiderBundles();\n let engine = this._engineInfoByRoute[routeName];\n if (engine && bundles._embroiderEngineBundles_) {\n let engineName = engine.name;\n return bundles._embroiderEngineBundles_.find(bundle => bundle.names.indexOf(engineName) !== -1);\n }\n return undefined;\n }\n\n private isEngine(this: this & Internals, name: string): boolean {\n return Boolean(this._engineInfoByRoute[name]);\n }\n\n // This is necessary in order to prevent the premature loading of lazy routes\n // when we are merely trying to render a link-to that points at them.\n // Unfortunately the stock query parameter behavior pulls on routes just to\n // check what their previous QP values were.\n _getQPMeta(this: this & Internals, handlerInfo: { name: string }, ...rest: unknown[]) {\n let bundle = this.lazyRoute(handlerInfo.name);\n if (bundle && !bundle.loaded) {\n // unloaded split routes\n return undefined;\n }\n\n if (this.isEngine(handlerInfo.name) && !this.seenByRoute.has(handlerInfo.name)) {\n // unvisited engines, whether loaded or not, because the same bundle\n // could by mounted multiple places and engines expect to only run the\n // super._getQPMeta after they've been visited.\n return undefined;\n }\n\n bundle = this.lazyEngine(handlerInfo.name);\n if (bundle && !bundle.loaded) {\n // unloaded lazy engines\n return undefined;\n }\n\n // @ts-expect-error extending private method\n return super._getQPMeta(handlerInfo, ...rest);\n }\n\n // This is the framework method that we're overriding to provide our own\n // handlerResolver.\n setupRouter(this: this & Internals, ...args: unknown[]) {\n // @ts-expect-error extending private method\n let isSetup = super.setupRouter(...args);\n let microLib = this._routerMicrolib;\n if (!microLib.getRoute.isEmbroiderRouterHandler) {\n microLib.getRoute = this._handlerResolver(microLib.getRoute.bind(microLib));\n }\n return isSetup;\n }\n\n private _handlerResolver(this: this & Internals, original: (name: string) => unknown) {\n let handler = ((name: string) => {\n const bundle = this.lazyRoute(name) ?? this.lazyEngine(name);\n this.seenByRoute.add(name);\n if (!bundle || bundle.loaded) {\n return original(name);\n }\n\n let token = waiter.beginAsync();\n\n return bundle.load().then(\n () => {\n waiter.endAsync(token);\n bundle.loaded = true;\n return original(name);\n },\n err => {\n waiter.endAsync(token);\n throw err;\n }\n );\n }) as GetRoute;\n handler.isEmbroiderRouterHandler = true;\n return handler;\n }\n }\n\n Router = EmbroiderRouter;\n} else {\n Router = EmberRouter;\n}\n\nexport default Router;\n","import { DEBUG } from '@glimmer/env';\nimport buildWaiter from './build-waiter';\nconst PROMISE_WAITER = buildWaiter('@ember/test-waiters:promise-waiter');\n/**\n * A convenient utility function to simplify waiting for a promise.\n *\n * @public\n * @param promise {Promise | RSVP.Promise} The promise to track async operations for\n * @param label {string} An optional string to identify the promise\n *\n * @example\n *\n * import Component from '@ember/component';\n * import { waitForPromise } from '@ember/test-waiters';\n *\n * export default class Friendz extends Component {\n * didInsertElement() {\n * waitForPromise(new Promise(resolve => {\n * doSomeWork();\n * resolve();\n * }));\n * }\n * }\n */\n\nexport default function waitForPromise(promise, label) {\n let result = promise;\n if (DEBUG) {\n PROMISE_WAITER.beginAsync(promise, label);\n result = promise.then(value => {\n PROMISE_WAITER.endAsync(promise);\n return value;\n }, error => {\n PROMISE_WAITER.endAsync(promise);\n throw error;\n });\n }\n return result;\n}","import { DEBUG } from '@glimmer/env';\nimport waitForPromise from './wait-for-promise';\nimport buildWaiter from './build-waiter';\nexport default function waitFor(...args) {\n let isFunction = args.length < 3;\n if (isFunction) {\n let [fn, label] = args;\n return wrapFunction(fn, label);\n } else {\n let [,, descriptor, label] = args;\n if (!DEBUG) {\n return descriptor;\n }\n let fn = descriptor.value;\n descriptor.value = wrapFunction(fn, label);\n return descriptor;\n }\n}\nfunction wrapFunction(fn, label) {\n if (!DEBUG) {\n return fn;\n }\n return function (...args) {\n let result = fn.call(this, ...args);\n if (isThenable(result)) {\n return waitForPromise(result, label);\n } else if (isGenerator(result)) {\n return waitForGenerator(result, label);\n } else {\n return result;\n }\n };\n}\nfunction isThenable(maybePromise) {\n let type = typeof maybePromise;\n return (maybePromise !== null && type === 'object' || type === 'function') && typeof maybePromise.then === 'function';\n}\nfunction isGenerator(maybeGenerator) {\n // Because we don't have Symbol.iterator in IE11\n return typeof maybeGenerator.next === 'function' && typeof maybeGenerator.return === 'function' && typeof maybeGenerator.throw === 'function';\n}\nconst GENERATOR_WAITER = buildWaiter('@ember/test-waiters:generator-waiter');\nfunction waitForGenerator(generator, label) {\n GENERATOR_WAITER.beginAsync(generator, label);\n let isWaiting = true;\n function stopWaiting() {\n if (isWaiting) {\n GENERATOR_WAITER.endAsync(generator);\n isWaiting = false;\n }\n }\n return {\n next(...args) {\n let hasErrored = true;\n try {\n let val = generator.next(...args);\n hasErrored = false;\n if (val.done) {\n stopWaiting();\n }\n return val;\n } finally {\n // If generator.next() throws, we need to stop waiting. But if we catch\n // and re-throw exceptions, it could move the location from which the\n // uncaught exception is thrown, interfering with the developer\n // debugging experience if they have break-on-exceptions enabled. So we\n // use a boolean flag and a finally block to emulate a catch block.\n if (hasErrored) {\n stopWaiting();\n }\n }\n },\n return(...args) {\n stopWaiting();\n return generator.return(...args);\n },\n throw(...args) {\n stopWaiting();\n return generator.throw(...args);\n }\n };\n}","import config from 'unattended-showing/config/environment';\nimport EmberRouter from '@embroider/router';\n\nexport default class Router extends EmberRouter {\n location = config.locationType;\n rootURL = config.rootURL;\n}\n\nRouter.map(function () {\n this.route('context', { path: '/:context_id' }, function () {\n this.route('login');\n this.route('logout');\n this.route('forgot-password');\n this.route('sign-up', function () {\n this.route('verification');\n });\n this.route('profile');\n this.route('appointment', { path: '/' });\n this.route('location', { path: '/location/:location_id' });\n this.route('loading');\n this.route('change-password');\n this.route('faq');\n this.route('available-units-list', {\n path: '/bookings/:available_units_list_id'\n });\n this.route('redirect', { path: '/redirect/:external_identifier_id' });\n this.route('not-found', { path: '/*path' });\n this.route('available-units-list-sgt3', {\n path: '/bookings-sgt3/:available_units_list_id'\n });\n this.route('location-sgt3', { path: '/location-sgt3/:location_id' });\n this.route('login-sgt3');\n this.route('sign-up-sgt3');\n this.route('appointment-sgt3');\n this.route('guest-appointment');\n this.route('forgot-password-sgt3');\n this.route('change-password-sgt3');\n this.route('faq-sgt3');\n this.route('profile-sgt3');\n this.route('guest-sign-up');\n this.route('phone-verification', function () {\n this.route('guest', { path: '/:type' });\n });\n this.route('credit-card-verification', function () {\n this.route('account');\n this.route('guest');\n });\n });\n this.route('not-found', { path: '/*path' });\n});\n","import BaseSerializer from '@adc/app-infrastructure/serializers/base-serializer';\n\nexport default BaseSerializer;\n","import { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\nimport ApplicationSerializer from './application';\n\n/**\n * @classdesc\n * Serializer for SignUp model so profile and password data are sent along to backend.\n */\nexport default class SignUpSerializer extends ApplicationSerializer.extend(\n EmbeddedRecordsMixin\n) {\n isEmbeddedRecordsMixinCompatible = true;\n\n /** override **/\n attrs = {\n profile: {\n embedded: 'always'\n },\n password: {\n embedded: 'always'\n }\n };\n}\n","import { inject as service } from '@ember/service';\nimport BaseAjaxService from '@adc/ajax/services/adc-ajax';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\n\nexport default class Ajax extends BaseAjaxService {\n @service\n declare notificationManager: ServiceRegistry['notification-manager'];\n\n /**\n * Error handling method to use when Ember data is used to make a request.\n */\n handleAjaxError(response: any, defaultMessage: string): Promise {\n const errors = [{ detail: defaultMessage, message: response.errors }];\n\n return Promise.reject(errors);\n }\n\n /**\n * Error handling method to use when ajax.apiRequest is used to make a request.\n */\n handleApiRequestError(\n response: any,\n defaultMessage: string\n ): Promise {\n let errorMessages = response?.errors?.errors ?? response?.errors ?? [];\n if (typeof errorMessages === 'string') {\n errorMessages = [errorMessages];\n }\n\n const errors = [{ detail: defaultMessage, message: errorMessages }];\n\n errorMessages.forEach((errorMessage: { detail: any }) =>\n this.notificationManager.addError(\n errorMessage.detail ?? defaultMessage\n )\n );\n\n return Promise.reject(errors);\n }\n}\n","import { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport Service from '@ember/service';\nimport { inject as service } from '@ember/service';\n\nexport default class CheckInService extends Service {\n @service ajax;\n @service sgtSession;\n @service notificationManager;\n\n @tracked isSendCheckpointIdVerificationDisabled = false;\n\n /**\n * Check the prospect in. If geofencing is enabled, perform a location scan. If CPID is enabled and the prospect\n * needs to scan, transition to CPID.\n */\n @action async appointmentCheckIn(property, appointment) {\n if (property.geofenceEnabled) {\n await this.validateLocation(appointment);\n }\n\n if (appointment.get('activePendingIdVerification')) {\n await this.sendCheckpointIdVerification(\n appointment.get('id'),\n false\n );\n }\n }\n\n /**\n * Validate prospect's coordinates.\n */\n @action async validateLocation(appointment) {\n try {\n const options = {\n enableHighAccuracy: false,\n timeout: 60000,\n maximumAge: 0\n };\n await new Promise((resolve, reject) => {\n navigator.geolocation.getCurrentPosition(\n async (position) => {\n try {\n await this.compareLocation(position, appointment);\n resolve();\n } catch (error) {\n reject(error);\n }\n },\n async () => {\n reject(this.locationShareError);\n },\n options\n );\n });\n } catch (response) {\n this.notificationManager.addError(response);\n return this.ajax.handleAjaxError(response, 'Unable to check-in.');\n }\n }\n\n /**\n * Takes in position and appointment arguments and makes a request to determine if the\n * prospect is within the geofence.\n */\n @action async compareLocation(position, appointment) {\n const loadedAppointment = await appointment,\n appointmentId = parseInt(loadedAppointment.id),\n latitude = position.coords.latitude,\n longitude = position.coords.longitude;\n\n const requestUrl = '/appointments/checkin',\n newOptions = this.getAuthHeaders(),\n body = JSON.stringify({\n appointmentId,\n latitude,\n longitude\n }),\n httpMethod = 'POST';\n\n try {\n await this.ajax.apiRequest(\n requestUrl,\n newOptions,\n body,\n httpMethod\n );\n } catch (error) {\n const errorMessage = error.errors[0].detail;\n return Promise.reject(errorMessage);\n }\n }\n\n /**\n * Error message if prospect chooses to not share location.\n */\n locationShareError =\n 'Please enable location services on your device and share your location in the browser in order to check-in.';\n\n /**\n * Gets necessary authorization for header.\n */\n getAuthHeaders() {\n const { token } = this.sgtSession.data.authenticated;\n return {\n headers: {\n authorization: token\n }\n };\n }\n\n /**\n * Formats error to be displayed for the prospect.\n */\n formatError(error) {\n const response = {\n errors: {\n errors: [\n {\n detail: error\n }\n ]\n }\n };\n return response;\n }\n\n /**\n * Send CPID verification to the user.\n * @param {string} appointmentId\n * @param {boolean} disableButton\n * @returns\n */\n async sendCheckpointIdVerification(appointmentId, disableButton = true) {\n if (this.isSendCheckpointIdVerificationDisabled) {\n return;\n }\n\n const requestUrl = '/checkpointId/verify',\n newOptions = this.getAuthHeaders(),\n body = JSON.stringify({\n appointmentId\n }),\n httpMethod = 'POST';\n\n try {\n await this.ajax.apiRequest(\n requestUrl,\n newOptions,\n body,\n httpMethod\n );\n } catch (error) {\n const formattedError = this.formatError(error.errors[0].detail);\n return this.ajax.handleAjaxError(\n formattedError,\n 'Unable to send id verification text.'\n );\n } finally {\n if (disableButton) {\n this.isSendCheckpointIdVerificationDisabled = true;\n\n setTimeout(\n () => (this.isSendCheckpointIdVerificationDisabled = false),\n 30000\n );\n }\n }\n }\n}\n","import { set } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport BaseErrorReporting from '@adc/app-infrastructure/services/base-error-reporting';\n\n/**\n * @classdesc\n * The Sentry error reporting service.\n */\nexport default class ErrorReportingService extends BaseErrorReporting {\n @service envSettings;\n @service router;\n @service store;\n\n /** @override */\n get errorsToIgnore() {\n return [\n ...super.errorsToIgnore,\n ...['Unhandled Promise error detected', 'TransitionAborted'].map(\n (value) => ({\n propertyType: 'message',\n value\n })\n )\n ];\n }\n\n /**\n * Initializes error reporting.\n */\n initializeForSession() {\n const {\n errorReporting: { dsn, environment, showDebugInfo, isEnabled } = {}\n } = this.envSettings.getEnvironment();\n if (dsn) {\n this.configure({ dsn, environment, showDebugInfo });\n }\n\n set(this, 'isEnabled', isEnabled);\n }\n\n /** @override **/\n beforeSend(event) {\n event = super.beforeSend(...arguments);\n const { isEnabled } = this;\n return isEnabled ? event : null;\n }\n}\n","import ADCIntlService from '@adc/i18n/services/adc-intl';\n\nexport default class UnattendedShowingIntlService extends ADCIntlService {}\n","import { tracked } from '@glimmer/tracking';\nimport Service from '@ember/service';\nimport { inject as service } from '@ember/service';\nimport { subMinutes } from 'date-fns';\n\nimport type { AsyncBelongsTo } from '@ember-data/model';\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type Appointment from 'unattended-showing/models/appointment';\nimport type LocationModel from 'unattended-showing/models/location';\nimport type AjaxService from './ajax';\nimport type CheckInService from './check-in';\n\nexport default class LoginPendingBookingService extends Service {\n @service declare router: ServiceRegistry['router'];\n @service declare ajax: AjaxService;\n @service declare checkIn: CheckInService;\n\n /**\n * Flag to determine whether user tried to book appointment before\n * logging in or signing up.\n */\n @tracked hasPendingAppointments = false;\n\n /**\n * Flag to determine whether to load scheduling page before saving\n * pending appointment.\n */\n @tracked enableTemporaryLoading = false;\n\n /**\n * Appointment object to be booked upon logging in or signing up.\n */\n @tracked appointment?: Appointment;\n\n /**\n * Location that appointment is booked at.\n */\n @tracked property?: LocationModel;\n\n loadAppointment(appointment: Appointment, property: LocationModel) {\n (this.hasPendingAppointments = true),\n (this.appointment = appointment),\n (this.property = property);\n }\n\n resetAppointmentData() {\n this.hasPendingAppointments = false;\n this.enableTemporaryLoading = false;\n this.appointment = undefined;\n this.property = undefined;\n }\n\n transitionRoute() {\n if (this.property) {\n this.enableTemporaryLoading = true;\n const propertyId = this.property.id;\n const baseRoute = 'context.location';\n this.router.transitionTo(baseRoute, propertyId);\n }\n }\n\n async processPendingAppointments() {\n this.transitionRoute();\n if (this.appointment && this.property) {\n try {\n // Save the appointment.\n await this.appointment.save();\n // DO NOT COPY THIS, PLEASE IMPLEMENT THE SUGGESTION AND TEST.\n // @ts-expect-error `location` is async so this code should be replaced with: `await (await this.appointment.location).reload();`.\n await this.appointment.location.reload();\n\n this.property.nextAppointment = this\n .appointment as unknown as AsyncBelongsTo;\n\n const tourWindowStart = new Date(\n subMinutes(this.appointment.dateTimeUtc, 5)\n );\n const withinTourWindow =\n tourWindowStart <= this.appointment.createdAt;\n\n // Send the CPID verification if user needs to be verified and it is not within tour time.\n if (this.property.reverificationRequired && !withinTourWindow) {\n await this.checkIn.sendCheckpointIdVerification(\n this.appointment.id,\n false\n );\n }\n } catch (response) {\n return this.ajax.handleAjaxError(\n response,\n 'Unable to request Self-Guided Tours appointment. Please try again later.'\n );\n } finally {\n // Reset stored appointment data.\n this.resetAppointmentData();\n }\n }\n }\n}\n","import addMinutes from \"../addMinutes/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name subMinutes\n * @category Minute Helpers\n * @summary Subtract the specified number of minutes from the given date.\n *\n * @description\n * Subtract the specified number of minutes from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the minutes subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 30 minutes from 10 July 2014 12:00:00:\n * const result = subMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 11:30:00\n */\n\nexport default function subMinutes(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMinutes(dirtyDate, -amount);\n}","import Service from '@ember/service';\n\nexport default class MockTimeService extends Service {\n mockTime?: Date = undefined;\n}\n","import SessionService from 'ember-simple-auth/services/session';\nimport ENV from 'unattended-showing/config/environment';\n\n/**\n * Class extending Ember Simple Auth's SessionService.\n * By default, ESA will redirect to the rootURL specified in environment.js when the session is invalidated.\n * This class is extended so that we can send the user to the login page upon session invalidation rather than rootURL.\n * Ideally, we would be able to provide a custom route for handleInvalidation, but this is not an available feature as of 2025-01-06.\n * A GitHub issue has been raised: https://github.com/mainmatter/ember-simple-auth/issues/2915\n */\nexport default class SGTSession extends SessionService {\n handleInvalidation(routeAfterInvalidation: string): void {\n const id = this.data?.contextId;\n super.handleInvalidation(\n id ? `${ENV.rootURL}${id}` : routeAfterInvalidation\n );\n }\n}\n","import CookieStore from 'ember-simple-auth/session-stores/cookie';\n\nexport default class ApplicationSessionStore extends CookieStore {}\n","import Transform from '@ember-data/serializer/transform';\nimport { A } from '@ember/array';\n\nexport default class HoursOfOperation extends Transform {\n deserialize(scheduleDictionary) {\n return A(\n Object.keys(scheduleDictionary || {}).map((scheduleDay) => {\n const { startMinutesLocal, durationMinutes, day } =\n scheduleDictionary[Number(scheduleDay)];\n\n return {\n day,\n startMinutesLocal,\n endMinutesLocal: startMinutesLocal + durationMinutes\n };\n })\n );\n }\n\n serialize(schedule) {\n return schedule.reduce(\n (\n scheduleDictionary,\n { day, startMinutesLocal, endMinutesLocal },\n index\n ) => {\n scheduleDictionary[index] = {\n day,\n startMinutesLocal,\n durationMinutes: endMinutesLocal - startMinutesLocal\n };\n return scheduleDictionary;\n },\n {}\n );\n }\n}\n","export type ConvertToRecord = {\n [K in keyof T]: T[K];\n};\n\nexport function convertToRecord(obj: T): ConvertToRecord {\n return { ...obj };\n}\n","/**\n * Returns true if the two dates are on the same day, else false.\n * @param {Date} date1 First date to compare.\n * @param {Date} date2 Second date to compare.\n * @returns a boolean based on if the dates are on the same day.\n */\nexport function datesAreOnSameDay(date1, date2) {\n return (\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n}\n","/**\n * Utility helper module for validating inputs.\n * @module\n */\n\n/**\n * Takes a Regex and an input and checks if the input with Regex selected characters removed is greater than 0.\n *\n * EXAMPLE: Passing /\\D/g as regEx and '123456' as input will return true.\n *\n * @function\n *\n * @param {RegExp} regEx\n * @param {String} input\n * @returns {Boolean}\n */\nexport function validateCustomRegex(regEx, input) {\n return regEx.test(input.toString());\n}\n\n/**\n * Takes an email, as a string, for emailInput and checks if it meets the RFC5322 standard (https://www.ietf.org/rfc/rfc5322.txt).\n *\n * @function\n *\n * @param {String} emailInput\n * @returns {Boolean}\n */\nexport function validateEmail(emailInput) {\n return /^((([!#$%'*+\\-/0-9=?A-Z^_'a-z{|}~]{1,})|(\"([^\"\\r\\n]|(\\\\[.\\n\\r]))*\"))(\\.(([!#$%'*+\\-/0-9=?A-Z^_'a-z{|}~]{1,})|(\"([^\"\\r\\n]|(\\\\[.\\n\\r]))*\")))*)@(([-0-9a-zA-Z]{1,})(\\.([-0-9a-zA-Z]{1,})){1,})$/.test(\n emailInput.toString()\n );\n}\n\n/**\n * Takes a password, as a string, for passwordInput and checks if it has at least 1 number, 8 or more characters, and at least 1 uppercase character.\n *\n * @function\n *\n * @param {String} passwordInput\n * @returns {Boolean}\n */\nexport function validatePassword(passwordInput) {\n return (\n passwordInput.toString().replace(/\\D/g, '').length > 0 &&\n passwordInput.toString().replace(/\\s/g, '').length >= 8 &&\n passwordInput.toString().replace(/[^A-Z]/g, '').length > 0\n );\n}\n\n/**\n * Takes a Regex and an input and checks if the input with Regex selected characters removed is greater than 0.\n * Also returns true for empty and undefined inputs (to not display error messages on input boxes for empty inputs).\n *\n * EXAMPLE: Passing /\\D/g as regEx and '123456' as input will return true.\n * EXAMPLE: Passing /\\s/g as regEx and '' as input will return true.\n *\n * @function\n *\n * @param {RegExp} regEx\n * @param {String} input\n * @returns {Boolean}\n */\nexport function validateTextInputCustomRegex(regEx, input) {\n return (\n input === undefined || input === '' || validateCustomRegex(regEx, input)\n );\n}\n\n/**\n * Takes an email, as a string, for emailInput and checks if it meets the RFC5322 standard (https://www.ietf.org/rfc/rfc5322.txt).\n * Also returns true for empty and undefined inputs (to not display error messages on input boxes for empty inputs).\n *\n * @function\n *\n * @param {String} emailInput\n * @returns {Boolean}\n */\nexport function validateTextInputEmail(emailInput) {\n return (\n emailInput === undefined ||\n emailInput === '' ||\n validateEmail(emailInput)\n );\n}\n\n/**\n * Takes a password, as a string, for passwordInput and checks if it has at least 1 number, 8 or more characters, and at least 1 uppercase character.\n * Also returns true for empty and undefined inputs (to not display error messages on input boxes for empty inputs).\n *\n * @function\n *\n * @param {String} passwordInput\n * @returns {Boolean}\n */\nexport function validateTextInputPassword(passwordInput) {\n return (\n passwordInput === undefined ||\n passwordInput === '' ||\n validatePassword(passwordInput)\n );\n}\n\n/**\n * Takes a phone number as a string and checks if it is 10 numbers with optional dashes.\n * The number must be formatted with the dashes in the correct location, e.g. 123-456-7890.\n *\n * @function\n *\n * @param {String} phoneNumber\n * @returns {Boolean}\n */\nexport function validatePhoneNumber(phoneNumber) {\n const phoneRegex = /^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/;\n return phoneRegex.test(phoneNumber);\n}\n","const newline = /\\r?\\n/;\nexport default function parseResponseHeaders(headersString) {\n const headers = Object.create(null);\n if (!headersString) {\n return headers;\n }\n const headerPairs = headersString.split(newline);\n for (let i = 0; i < headerPairs.length; i++) {\n let header = headerPairs[i];\n let j = 0;\n let foundSep = false;\n for (; j < header.length; j++) {\n if (header.charCodeAt(j) === 58 /* ':' */) {\n foundSep = true;\n break;\n }\n }\n if (foundSep === false) {\n continue;\n }\n let field = header.substring(0, j).trim();\n let value = header.substring(j + 1, header.length).trim();\n if (value) {\n let lowerCasedField = field.toLowerCase();\n headers[lowerCasedField] = value;\n headers[field] = value;\n }\n }\n return headers;\n}","import { warn } from '@ember/debug';\nimport { DEBUG } from '@glimmer/env';\nimport continueOnReject from './continue-on-reject';\n/*\n * Function that always attempts to parse the response as json, and if an error is thrown,\n * returns `undefined` if the response is successful and has a status code of 204 (No Content),\n * or 205 (Reset Content) or if the request method was 'HEAD', and the plain payload otherwise.\n */\nfunction _determineContent(response, requestData, payload) {\n let ret = payload;\n let error = null;\n if (!response.ok) {\n return payload;\n }\n let status = response.status;\n let payloadIsEmpty = payload === '' || payload === null;\n let statusIndicatesEmptyResponse = status === 204 || status === 205 || requestData.method === 'HEAD';\n if (DEBUG) {\n if (payloadIsEmpty && !statusIndicatesEmptyResponse) {\n let message = `The server returned an empty string for ${requestData.method} ${requestData.url}, which cannot be parsed into a valid JSON. Return either null or {}.`;\n if (payload === '') {\n warn(message, {\n id: 'ds.adapter.returned-empty-string-as-JSON'\n });\n }\n }\n }\n if (response.ok && (statusIndicatesEmptyResponse || payloadIsEmpty)) {\n return;\n }\n try {\n ret = JSON.parse(payload);\n } catch (e) {\n if (!(e instanceof SyntaxError)) {\n return e;\n }\n e.payload = payload;\n error = e;\n }\n if (error) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.warn('This response was unable to be parsed as json.', payload);\n }\n return error;\n }\n return ret;\n}\nexport function determineBodyPromise(response, requestData) {\n // response.text() may resolve or reject\n // it is a native promise, may not have finally\n return continueOnReject(response.text()).then(payload => _determineContent(response, requestData, payload));\n}","import { resolve } from 'rsvp';\nexport default function continueOnReject(promise) {\n return resolve(promise).catch(e => e);\n}","const RBRACKET = /\\[\\]$/;\nfunction isPlainObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\n/*\n * Helper function that turns the data/body of a request into a query param string.\n * This is directly copied from jQuery.param.\n */\nexport function serializeQueryParams(queryParamsObject) {\n let s = [];\n function buildParams(prefix, obj) {\n let i, len, key;\n if (prefix) {\n if (Array.isArray(obj)) {\n for (i = 0, len = obj.length; i < len; i++) {\n if (RBRACKET.test(prefix)) {\n add(s, prefix, obj[i]);\n } else {\n buildParams(prefix + '[' + (typeof obj[i] === 'object' && obj[i] !== null ? i : '') + ']', obj[i]);\n }\n }\n } else if (isPlainObject(obj)) {\n for (key in obj) {\n buildParams(prefix + '[' + key + ']', obj[key]);\n }\n } else {\n add(s, prefix, obj);\n }\n } else if (Array.isArray(obj)) {\n for (i = 0, len = obj.length; i < len; i++) {\n add(s, obj[i].name, obj[i].value);\n }\n } else {\n for (key in obj) {\n buildParams(key, obj[key]);\n }\n }\n return s;\n }\n return buildParams('', queryParamsObject).join('&');\n}\n\n/*\n * Part of the `serializeQueryParams` helper function.\n */\nfunction add(s, k, v) {\n // Strip out keys with undefined value and replace null values with\n // empty strings (mimics jQuery.ajax)\n if (v === undefined) {\n return;\n } else if (v === null) {\n v = '';\n }\n v = typeof v === 'function' ? v() : v;\n s[s.length] = `${encodeURIComponent(k)}=${encodeURIComponent(v)}`;\n}","import require, { has } from 'require';\nlet _fetch = null;\nexport default function getFetchFunction() {\n if (_fetch !== null) {\n return _fetch();\n }\n if (has('fetch')) {\n // use `fetch` module by default, this is commonly provided by ember-fetch\n let fetchFn = require('fetch').default;\n _fetch = () => fetchFn;\n } else if (typeof fetch === 'function') {\n // fallback to using global fetch\n _fetch = () => fetch;\n } else {\n throw new Error('cannot find the `fetch` module or the `fetch` global. Did you mean to install the `ember-fetch` addon?');\n }\n return _fetch();\n}","import Mixin from '@ember/object/mixin';\nimport { camelize } from '@ember/string';\nimport { pluralize } from 'ember-inflector';\n\n/**\n @module @ember-data/adapter\n*/\n\n/*\n The structure of this file is such because typing Mixins is hard. Here we've structured it in\n such a way as to maximize the type information that a consumer can utilize. There are simpler\n ways to type a mixin but we would not be able to provide the nice overload signature for buildURL\n*/\n// the interface must fully declare the function signatures that the individual functions\n// will also declare. If instead we try to keep them in sync by doing something like\n// `interface BuildURLMixin { buildURL: typeof buildURL }`\n// then an extending class overwriting one of the methods will break because typescript\n// thinks it is a switch from an instance prop (that is a method) to an instance method.\n\n// prevents the final constructed object from needing to add\n// host and namespace which are provided by the final consuming\n// class to the prototype which can result in overwrite errors\n\n/**\n ## Using BuildURLMixin\n\n To use URL building, include the mixin when extending an adapter, and call `buildURL` where needed.\n The default behaviour is designed for RESTAdapter.\n\n ### Example\n\n ```javascript\n import Adapter, { BuildURLMixin } from '@ember-data/adapter';\n\n export default class ApplicationAdapter extends Adapter.extend(BuildURLMixin) {\n findRecord(store, type, id, snapshot) {\n var url = this.buildURL(type.modelName, id, snapshot, 'findRecord');\n return this.ajax(url, 'GET');\n }\n }\n ```\n\n ### Attributes\n\n The `host` and `namespace` attributes will be used if defined, and are optional.\n\n @class BuildURLMixin\n @public\n*/\n/**\n Builds a URL for a given type and optional ID.\n\n By default, it pluralizes the type's name (for example, 'post'\n becomes 'posts' and 'person' becomes 'people'). To override the\n pluralization see [pathForType](./pathForType?anchor=pathForType).\n\n If an ID is specified, it adds the ID to the path generated\n for the type, separated by a `/`.\n\n When called by `RESTAdapter.findMany()` the `id` and `snapshot` parameters\n will be arrays of ids and snapshots.\n\n @method buildURL\n @public\n @param {String} modelName\n @param {(String|Array|Object)} id single id or array of ids or query\n @param {(Snapshot|SnapshotRecordArray)} snapshot single snapshot or array of snapshots\n @param {String} requestType\n @param {Object} query object of query parameters to send for query requests.\n @return {String} url\n */\n\nfunction buildURL(modelName, id, snapshot, requestType, query) {\n /*\n Switch statements in typescript don't currently narrow even when the function is implemented\n with overloads.\n We still extract this to stand alone so that we can provide nice overloads for calling signatures,\n but we will still require all of this casting (or a ridiculous number of assertsthat narrow it down\n for us).\n */\n switch (requestType) {\n case 'findRecord':\n return this.urlForFindRecord(id, modelName, snapshot);\n case 'findAll':\n return this.urlForFindAll(modelName, snapshot);\n case 'query':\n return this.urlForQuery(query || {}, modelName);\n case 'queryRecord':\n return this.urlForQueryRecord(query || {}, modelName);\n case 'findMany':\n return this.urlForFindMany(id, modelName, snapshot);\n case 'findHasMany':\n return this.urlForFindHasMany(id, modelName, snapshot);\n case 'findBelongsTo':\n return this.urlForFindBelongsTo(id, modelName, snapshot);\n case 'createRecord':\n return this.urlForCreateRecord(modelName, snapshot);\n case 'updateRecord':\n return this.urlForUpdateRecord(id, modelName, snapshot);\n case 'deleteRecord':\n return this.urlForDeleteRecord(id, modelName, snapshot);\n default:\n // this is the 'never' case but someone may call `buildURL` manually so\n // we try to do something for them.\n return this._buildURL(modelName, id);\n }\n}\n\n/**\n @method _buildURL\n @private\n @param {String} modelName\n @param {String} id\n @return {String} url\n */\nfunction _buildURL(modelName, id) {\n let path;\n let url = [];\n let {\n host\n } = this;\n let prefix = this.urlPrefix();\n if (modelName) {\n path = this.pathForType(modelName);\n if (path) {\n url.push(path);\n }\n }\n if (id) {\n url.push(encodeURIComponent(id));\n }\n if (prefix) {\n url.unshift(prefix);\n }\n let urlString = url.join('/');\n if (!host && urlString && urlString.charAt(0) !== '/') {\n urlString = '/' + urlString;\n }\n return urlString;\n}\n\n/**\n Builds a URL for a `store.findRecord(type, id)` call.\n\n Example:\n\n ```app/adapters/user.js\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n urlForFindRecord(id, modelName, snapshot) {\n let baseUrl = this.buildURL(modelName, id, snapshot);\n return `${baseUrl}/users/${snapshot.adapterOptions.user_id}/playlists/${id}`;\n }\n }\n ```\n\n @method urlForFindRecord\n @public\n @param {String} id\n @param {String} modelName\n @param {Snapshot} snapshot\n @return {String} url\n\n */\nfunction urlForFindRecord(id, modelName, snapshot) {\n return this._buildURL(modelName, id);\n}\n\n/**\n Builds a URL for a `store.findAll(type)` call.\n\n Example:\n\n ```app/adapters/comment.js\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n urlForFindAll(modelName, snapshot) {\n let baseUrl = this.buildURL(modelName);\n return `${baseUrl}/data/comments.json`;\n }\n }\n ```\n\n @method urlForFindAll\n @public\n @param {String} modelName\n @param {SnapshotRecordArray} snapshot\n @return {String} url\n */\nfunction urlForFindAll(modelName, snapshots) {\n return this._buildURL(modelName);\n}\n\n/**\n Builds a URL for a `store.query(type, query)` call.\n\n Example:\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n host = 'https://api.github.com';\n urlForQuery (query, modelName) {\n switch(modelName) {\n case 'repo':\n return `https://api.github.com/orgs/${query.orgId}/repos`;\n default:\n return super.urlForQuery(...arguments);\n }\n }\n }\n ```\n\n @method urlForQuery\n @public\n @param {Object} query\n @param {String} modelName\n @return {String} url\n */\nfunction urlForQuery(query, modelName) {\n return this._buildURL(modelName);\n}\n\n/**\n Builds a URL for a `store.queryRecord(type, query)` call.\n\n Example:\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n urlForQueryRecord({ slug }, modelName) {\n let baseUrl = this.buildURL();\n return `${baseUrl}/${encodeURIComponent(slug)}`;\n }\n }\n ```\n\n @method urlForQueryRecord\n @public\n @param {Object} query\n @param {String} modelName\n @return {String} url\n */\nfunction urlForQueryRecord(query, modelName) {\n return this._buildURL(modelName);\n}\n\n/**\n Builds a URL for coalescing multiple `store.findRecord(type, id)`\n records into 1 request when the adapter's `coalesceFindRequests`\n property is `true`.\n\n Example:\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n urlForFindMany(ids, modelName) {\n let baseUrl = this.buildURL();\n return `${baseUrl}/coalesce`;\n }\n }\n ```\n\n @method urlForFindMany\n @public\n @param {Array} ids\n @param {String} modelName\n @param {Array} snapshots\n @return {String} url\n */\nfunction urlForFindMany(ids, modelName, snapshots) {\n return this._buildURL(modelName);\n}\n\n/**\n Builds a URL for fetching an async `hasMany` relationship when a URL\n is not provided by the server.\n\n Example:\n\n ```app/adapters/application.js\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n urlForFindHasMany(id, modelName, snapshot) {\n let baseUrl = this.buildURL(modelName, id);\n return `${baseUrl}/relationships`;\n }\n }\n ```\n\n @method urlForFindHasMany\n @public\n @param {String} id\n @param {String} modelName\n @param {Snapshot} snapshot\n @return {String} url\n */\nfunction urlForFindHasMany(id, modelName, snapshot) {\n return this._buildURL(modelName, id);\n}\n\n/**\n Builds a URL for fetching an async `belongsTo` relationship when a url\n is not provided by the server.\n\n Example:\n\n ```app/adapters/application.js\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n urlForFindBelongsTo(id, modelName, snapshot) {\n let baseUrl = this.buildURL(modelName, id);\n return `${baseUrl}/relationships`;\n }\n }\n ```\n\n @method urlForFindBelongsTo\n @public\n @param {String} id\n @param {String} modelName\n @param {Snapshot} snapshot\n @return {String} url\n */\nfunction urlForFindBelongsTo(id, modelName, snapshot) {\n return this._buildURL(modelName, id);\n}\n\n/**\n Builds a URL for a `record.save()` call when the record was created\n locally using `store.createRecord()`.\n\n Example:\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n urlForCreateRecord(modelName, snapshot) {\n return super.urlForCreateRecord(...arguments) + '/new';\n }\n }\n ```\n\n @method urlForCreateRecord\n @public\n @param {String} modelName\n @param {Snapshot} snapshot\n @return {String} url\n */\nfunction urlForCreateRecord(modelName, snapshot) {\n return this._buildURL(modelName);\n}\n\n/**\n Builds a URL for a `record.save()` call when the record has been updated locally.\n\n Example:\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n urlForUpdateRecord(id, modelName, snapshot) {\n return `/${id}/feed?access_token=${snapshot.adapterOptions.token}`;\n }\n }\n ```\n\n @method urlForUpdateRecord\n @public\n @param {String} id\n @param {String} modelName\n @param {Snapshot} snapshot\n @return {String} url\n */\nfunction urlForUpdateRecord(id, modelName, snapshot) {\n return this._buildURL(modelName, id);\n}\n\n/**\n Builds a URL for a `record.save()` call when the record has been deleted locally.\n\n Example:\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n urlForDeleteRecord(id, modelName, snapshot) {\n return super.urlForDeleteRecord(...arguments) + '/destroy';\n }\n }\n ```\n\n @method urlForDeleteRecord\n @public\n @param {String} id\n @param {String} modelName\n @param {Snapshot} snapshot\n @return {String} url\n */\nfunction urlForDeleteRecord(id, modelName, snapshot) {\n return this._buildURL(modelName, id);\n}\n\n/**\n @method urlPrefix\n @private\n @param {String} path\n @param {String} parentURL\n @return {String} urlPrefix\n */\nfunction urlPrefix(path, parentURL) {\n let {\n host,\n namespace\n } = this;\n if (!host || host === '/') {\n host = '';\n }\n if (path) {\n // Protocol relative url\n if (/^\\/\\//.test(path) || /http(s)?:\\/\\//.test(path)) {\n // Do nothing, the full host is already included.\n return path;\n\n // Absolute path\n } else if (path.charAt(0) === '/') {\n return `${host}${path}`;\n // Relative path\n } else {\n return `${parentURL}/${path}`;\n }\n }\n\n // No path provided\n let url = [];\n if (host) {\n url.push(host);\n }\n if (namespace) {\n url.push(namespace);\n }\n return url.join('/');\n}\n\n/**\n Determines the pathname for a given type.\n\n By default, it pluralizes the type's name (for example,\n 'post' becomes 'posts' and 'person' becomes 'people').\n\n ### Pathname customization\n\n For example, if you have an object `LineItem` with an\n endpoint of `/line_items/`.\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n import { decamelize } from '@ember/string';\n import { pluralize } from 'ember-inflector';\n\n export default class ApplicationAdapter extends RESTAdapter {\n pathForType(modelName) {\n var decamelized = decamelize(modelName);\n return pluralize(decamelized);\n }\n }\n ```\n\n @method pathForType\n @public\n @param {String} modelName\n @return {String} path\n **/\nfunction pathForType(modelName) {\n let camelized = camelize(modelName);\n return pluralize(camelized);\n}\n\n// we build it this way vs casting to BuildURLMixin so that any\n// changes to the interface surface as errors here.\nconst mixinProps = {\n buildURL,\n _buildURL,\n urlForFindRecord,\n urlForFindAll,\n urlForQueryRecord,\n urlForQuery,\n urlForFindMany,\n urlForFindHasMany,\n urlForFindBelongsTo,\n urlForCreateRecord,\n urlForDeleteRecord,\n urlForUpdateRecord,\n urlPrefix,\n pathForType\n};\nexport default Mixin.create(mixinProps);","import { assert } from '@ember/debug';\nexport default function serializeIntoHash(store, modelClass, snapshot, options = {\n includeId: true\n}) {\n const serializer = store.serializerFor(modelClass.modelName);\n assert(`Cannot serialize record, no serializer defined`, serializer);\n if (typeof serializer.serializeIntoHash === 'function') {\n const data = {};\n serializer.serializeIntoHash(data, modelClass, snapshot, options);\n return data;\n }\n return serializer.serialize(snapshot, options);\n}","/**\n @module @ember-data/adapter/error\n */\nimport { assert } from '@ember/debug';\nimport EmberError from '@ember/error';\n\n/**\n A `AdapterError` is used by an adapter to signal that an error occurred\n during a request to an external API. It indicates a generic error, and\n subclasses are used to indicate specific error states. The following\n subclasses are provided:\n\n - `InvalidError`\n - `TimeoutError`\n - `AbortError`\n - `UnauthorizedError`\n - `ForbiddenError`\n - `NotFoundError`\n - `ConflictError`\n - `ServerError`\n\n To create a custom error to signal a specific error state in communicating\n with an external API, extend the `AdapterError`. For example, if the\n external API exclusively used HTTP `503 Service Unavailable` to indicate\n it was closed for maintenance:\n\n ```app/adapters/maintenance-error.js\n import AdapterError from '@ember-data/adapter/error';\n\n export default AdapterError.extend({ message: \"Down for maintenance.\" });\n ```\n\n This error would then be returned by an adapter's `handleResponse` method:\n\n ```app/adapters/application.js\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n import MaintenanceError from './maintenance-error';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n handleResponse(status) {\n if (503 === status) {\n return new MaintenanceError();\n }\n\n return super.handleResponse(...arguments);\n }\n }\n ```\n\n And can then be detected in an application and used to send the user to an\n `under-maintenance` route:\n\n ```app/routes/application.js\n import Route from '@ember/routing/route';\n import MaintenanceError from '../adapters/maintenance-error';\n\n export default class ApplicationRoute extends Route {\n actions: {\n error(error, transition) {\n if (error instanceof MaintenanceError) {\n this.transitionTo('under-maintenance');\n return;\n }\n\n // ...other error handling logic\n }\n }\n }\n ```\n\n @main @ember-data/adapter/error\n @class AdapterError\n @public\n*/\nfunction AdapterError(errors, message = 'Adapter operation failed') {\n this.isAdapterError = true;\n let error = EmberError.call(this, message);\n\n // in ember 3.8+ Error is a Native Error and we don't\n // gain these automatically from the EmberError.call\n if (error) {\n this.stack = error.stack;\n this.description = error.description;\n this.fileName = error.fileName;\n this.lineNumber = error.lineNumber;\n this.message = error.message;\n this.name = error.name;\n this.number = error.number;\n }\n this.errors = errors || [{\n title: 'Adapter Error',\n detail: message\n }];\n}\nexport default AdapterError;\nfunction extendFn(ErrorClass) {\n return function ({\n message: defaultMessage\n } = {}) {\n return extend(ErrorClass, defaultMessage);\n };\n}\nfunction extend(ParentErrorClass, defaultMessage) {\n let ErrorClass = function (errors, message) {\n assert('`AdapterError` expects json-api formatted errors array.', Array.isArray(errors || []));\n ParentErrorClass.call(this, errors, message || defaultMessage);\n };\n ErrorClass.prototype = Object.create(ParentErrorClass.prototype);\n ErrorClass.extend = extendFn(ErrorClass);\n return ErrorClass;\n}\nAdapterError.prototype = Object.create(EmberError.prototype);\nAdapterError.prototype.code = 'AdapterError';\nAdapterError.extend = extendFn(AdapterError);\n\n/**\n A `InvalidError` is used by an adapter to signal the external API\n was unable to process a request because the content was not\n semantically correct or meaningful per the API. Usually, this means a\n record failed some form of server-side validation. When a promise\n from an adapter is rejected with a `InvalidError` the record will\n transition to the `invalid` state and the errors will be set to the\n `errors` property on the record.\n\n For Ember Data to correctly map errors to their corresponding\n properties on the model, Ember Data expects each error to be\n a valid JSON-API error object with a `source/pointer` that matches\n the property name. For example, if you had a Post model that\n looked like this.\n\n ```app/models/post.js\n import Model, { attr } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @attr('string') title;\n @attr('string') content;\n }\n ```\n\n To show an error from the server related to the `title` and\n `content` properties your adapter could return a promise that\n rejects with a `InvalidError` object that looks like this:\n\n ```app/adapters/post.js\n import RSVP from 'RSVP';\n import RESTAdapter from '@ember-data/adapter/rest';\n import { InvalidError } from '@ember-data/adapter/error';\n\n export default class ApplicationAdapter extends RESTAdapter {\n updateRecord() {\n // Fictional adapter that always rejects\n return RSVP.reject(new InvalidError([\n {\n detail: 'Must be unique',\n source: { pointer: '/data/attributes/title' }\n },\n {\n detail: 'Must not be blank',\n source: { pointer: '/data/attributes/content'}\n }\n ]));\n }\n }\n ```\n\n Your backend may use different property names for your records the\n store will attempt to extract and normalize the errors using the\n serializer's `extractErrors` method before the errors get added to\n the model. As a result, it is safe for the `InvalidError` to\n wrap the error payload unaltered.\n\n @class InvalidError\n @public\n @extends AdapterError\n*/\nexport const InvalidError = extend(AdapterError, 'The adapter rejected the commit because it was invalid');\nInvalidError.prototype.code = 'InvalidError';\n\n/**\n A `TimeoutError` is used by an adapter to signal that a request\n to the external API has timed out. I.e. no response was received from\n the external API within an allowed time period.\n\n An example use case would be to warn the user to check their internet\n connection if an adapter operation has timed out:\n\n ```app/routes/application.js\n import Route from '@ember/routing/route';\n import { TimeoutError } from '@ember-data/adapter/error';\n import { action } from '@ember/object';\n\n export default class ApplicationRoute extends Route {\n @action\n error(error, transition) {\n if (error instanceof TimeoutError) {\n // alert the user\n alert('Are you still connected to the Internet?');\n return;\n }\n\n // ...other error handling logic\n }\n }\n ```\n\n @class TimeoutError\n @public\n @extends AdapterError\n*/\nexport const TimeoutError = extend(AdapterError, 'The adapter operation timed out');\nTimeoutError.prototype.code = 'TimeoutError';\n\n/**\n A `AbortError` is used by an adapter to signal that a request to\n the external API was aborted. For example, this can occur if the user\n navigates away from the current page after a request to the external API\n has been initiated but before a response has been received.\n\n @class AbortError\n @public\n @extends AdapterError\n*/\nexport const AbortError = extend(AdapterError, 'The adapter operation was aborted');\nAbortError.prototype.code = 'AbortError';\n\n/**\n A `UnauthorizedError` equates to a HTTP `401 Unauthorized` response\n status. It is used by an adapter to signal that a request to the external\n API was rejected because authorization is required and has failed or has not\n yet been provided.\n\n An example use case would be to redirect the user to a login route if a\n request is unauthorized:\n\n ```app/routes/application.js\n import Route from '@ember/routing/route';\n import { UnauthorizedError } from '@ember-data/adapter/error';\n import { action } from '@ember/object';\n\n export default class ApplicationRoute extends Route {\n @action\n error(error, transition) {\n if (error instanceof UnauthorizedError) {\n // go to the login route\n this.transitionTo('login');\n return;\n }\n\n // ...other error handling logic\n }\n }\n ```\n\n @class UnauthorizedError\n @public\n @extends AdapterError\n*/\nexport const UnauthorizedError = extend(AdapterError, 'The adapter operation is unauthorized');\nUnauthorizedError.prototype.code = 'UnauthorizedError';\n\n/**\n A `ForbiddenError` equates to a HTTP `403 Forbidden` response status.\n It is used by an adapter to signal that a request to the external API was\n valid but the server is refusing to respond to it. If authorization was\n provided and is valid, then the authenticated user does not have the\n necessary permissions for the request.\n\n @class ForbiddenError\n @public\n @extends AdapterError\n*/\nexport const ForbiddenError = extend(AdapterError, 'The adapter operation is forbidden');\nForbiddenError.prototype.code = 'ForbiddenError';\n\n/**\n A `NotFoundError` equates to a HTTP `404 Not Found` response status.\n It is used by an adapter to signal that a request to the external API\n was rejected because the resource could not be found on the API.\n\n An example use case would be to detect if the user has entered a route\n for a specific model that does not exist. For example:\n\n ```app/routes/post.js\n import Route from '@ember/routing/route';\n import { NotFoundError } from '@ember-data/adapter/error';\n import { inject as service } from '@ember/service';\n import { action } from '@ember/object';\n\n export default class PostRoute extends Route {\n @service store;\n model(params) {\n return this.get('store').findRecord('post', params.post_id);\n }\n @action\n error(error, transition) {\n if (error instanceof NotFoundError) {\n // redirect to a list of all posts instead\n this.transitionTo('posts');\n } else {\n // otherwise let the error bubble\n return true;\n }\n }\n }\n ```\n\n @class NotFoundError\n @public\n @extends AdapterError\n*/\nexport const NotFoundError = extend(AdapterError, 'The adapter could not find the resource');\nNotFoundError.prototype.code = 'NotFoundError';\n\n/**\n A `ConflictError` equates to a HTTP `409 Conflict` response status.\n It is used by an adapter to indicate that the request could not be processed\n because of a conflict in the request. An example scenario would be when\n creating a record with a client-generated ID but that ID is already known\n to the external API.\n\n @class ConflictError\n @public\n @extends AdapterError\n*/\nexport const ConflictError = extend(AdapterError, 'The adapter operation failed due to a conflict');\nConflictError.prototype.code = 'ConflictError';\n\n/**\n A `ServerError` equates to a HTTP `500 Internal Server Error` response\n status. It is used by the adapter to indicate that a request has failed\n because of an error in the external API.\n\n @class ServerError\n @public\n @extends AdapterError\n*/\nexport const ServerError = extend(AdapterError, 'The adapter operation failed due to a server error');\nServerError.prototype.code = 'ServerError';\nexport { errorsHashToArray, errorsArrayToHash } from '@ember-data/store/-private';","var _class, _descriptor;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n/**\n ## Overview\n\n In order to properly fetch and update data, EmberData\n needs to understand how to connect to your API.\n\n `Adapters` accept various kinds of requests from the store\n and manage fulfillment of the request from your API.\n\n ### Request Flow\n\n When the store decides it needs to issue a request it uses the\n following flow to manage the request and process the data.\n\n - find the appropriate adapter\n - issue the request to the adapter\n - await the adapter's response\n - if an error occurs reject with the error\n - if no error\n - if there is response data\n - pass the response data to the appropriate serializer\n - update the cache using the JSON:API formatted data from the serializer's response\n - return the primary record(s) associated with the request\n\n ### Request Errors\n\n When a request errors and your adapter does not have the ability to recover from the error,\n you may either reject the promise returned by your adapter method with the error or simply\n throw the error.\n\n If the request was for a `createRecord` `updateRecord` or `deleteRecord` special rules\n apply to how this error will affect the state of the store and additional properties on\n the `Error` class may be used. See the documentation for these methods in the\n `MinimumAdapterInterface` for more information.\n\n ### Implementing an Adapter\n\n There are seven required adapter methods, one for each of\n the primary request types that EmberData issues.\n\n They are:\n\n - findRecord\n - findAll\n - queryRecord\n - query\n - createRecord\n - updateRecord\n - deleteRecord\n\n Each of these request types has a matching store method that triggers it\n and matching `requestType` that is passed to the serializer's\n `normalizeResponse` method.\n\n If your app only reads data but never writes data, it is not necessary\n to implement the methods for create, update, and delete. This extends to\n all of the store's find methods with the exception of `findRecord` (`findAll`,\n `query`, `queryRecord`): if you do not use the store method in your app then\n your Adapter does not need the method.\n\n ```ts\n import EmberObject from '@ember/object';\n\n async function fetchData(url, options = {}) {\n let response = await fetch(url, options);\n return response.toJSON();\n }\n\n export default class ApplicationAdapter extends EmberObject {\n findRecord(_, { modelName }, id) {\n return fetchData(`./${modelName}s/${id}`);\n }\n }\n ```\n\n ### Adapter Resolution\n\n `store.adapterFor(name)` will lookup adapters defined in `app/adapters/` and\n return an instance.\n\n `adapterFor` first attempts to find an adapter with an exact match on `name`,\n then falls back to checking for the presence of an adapter named `application`.\n\n If no adapter is found, an error will be thrown.\n\n ```ts\n store.adapterFor('author');\n\n // lookup paths (in order) =>\n // app/adapters/author.js\n // app/adapters/application.js\n ```\n\n Most requests in EmberData are made with respect to a particular `type` (or `modelName`)\n (e.g., \"get me the full collection of **books**\" or \"get me the **employee** whose id is 37\"). We\n refer to this as the **primary** resource `type`.\n\n `adapterFor` is used by the store to find an adapter with a name matching that of the primary\n resource `type` for the request, which then falls back to the `application` adapter.\n\n It is recommended that applications define only a single `application` adapter and serializer\n where possible, only implementing an adapter specific to the `type` when absolutely necessary.\n\n If you need to support multiple API versions for the same type, the per-type strategy for\n defining adapters might not be adequate.\n\n If you have multiple APIs or multiple API versions and the single application adapter and per-type\n strategy does not suite your needs, one strategy is to write an `application` adapter and serializer\n that make use of `options` to specify the desired format when making a request, then forwards to the\n request to the desired adapter or serializer as needed.\n\n ```app/adapters/application.js\n export default class Adapter extends EmberObject {\n findRecord(store, schema, id, snapshot) {\n let { apiVersion } = snapshot.adapterOptions;\n return this.adapterFor(`-api-${apiVersion}`).findRecord(store, schema, id, snapshot);\n }\n }\n ```\n\n ### Using an Adapter\n\n Any adapter in `app/adapters/` can be looked up by `name` using `store.adapterFor(name)`.\n\n ### Default Adapters\n\n Applications whose API's structure endpoint URLs *very close to* or *exactly* the **REST**\n or **JSON:API** convention, the `@ember-data/adapter` package contains implementations\n these applications can extend.\n\n Many applications will find writing their own adapter to be allow greater flexibility,\n customization, and maintenance than attempting to override methods in these adapters.\n\n @module @ember-data/adapter\n @main @ember-data/adapter\n*/\n\nimport EmberObject from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { DEBUG } from '@glimmer/env';\nimport { Promise as RSVPPromise } from 'rsvp';\n/**\n An adapter is an object that receives requests from a store and\n translates them into the appropriate action to take against your\n persistence layer. The persistence layer is usually an HTTP API but\n may be anything, such as the browser's local storage. Typically the\n adapter is not invoked directly instead its functionality is accessed\n through the `store`.\n\n ### Creating an Adapter\n\n Create a new subclass of `Adapter` in the `app/adapters` folder:\n\n ```app/adapters/application.js\n import Adapter from '@ember-data/adapter';\n\n export default Adapter.extend({\n // ...your code here\n });\n ```\n\n Model-specific adapters can be created by putting your adapter\n class in an `app/adapters/` + `model-name` + `.js` file of the application.\n\n ```app/adapters/post.js\n import Adapter from '@ember-data/adapter';\n\n export default Adapter.extend({\n // ...Post-specific adapter code goes here\n });\n ```\n\n `Adapter` is an abstract base class that you should override in your\n application to customize it for your backend. The minimum set of methods\n that you should implement is:\n\n * `findRecord()`\n * `createRecord()`\n * `updateRecord()`\n * `deleteRecord()`\n * `findAll()`\n * `query()`\n\n To improve the network performance of your application, you can optimize\n your adapter by overriding these lower-level methods:\n\n * `findMany()`\n\n\n For an example of the implementation, see `RESTAdapter`, the\n included REST adapter.\n\n @class Adapter\n @public\n @extends Ember.EmberObject\n*/\nlet Adapter = (_class = class Adapter extends EmberObject {\n constructor(...args) {\n super(...args);\n _initializerDefineProperty(this, \"store\", _descriptor, this);\n }\n /**\n The `findRecord()` method is invoked when the store is asked for a record that\n has not previously been loaded. In response to `findRecord()` being called, you\n should query your persistence layer for a record with the given ID. The `findRecord`\n method should return a promise that will resolve to a JavaScript object that will be\n normalized by the serializer.\n Here is an example of the `findRecord` implementation:\n ```app/adapters/application.js\n import Adapter from '@ember-data/adapter';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n export default class ApplicationAdapter extends Adapter {\n findRecord(store, type, id, snapshot) {\n return new RSVP.Promise(function(resolve, reject) {\n $.getJSON(`/${type.modelName}/${id}`).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n reject(jqXHR);\n });\n });\n }\n }\n ```\n @method findRecord\n @param {Store} store\n @param {Model} type\n @param {String} id\n @param {Snapshot} snapshot\n @return {Promise} promise\n @public\n */\n findRecord(store, type, id, snapshot) {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a findRecord override');\n }\n return RSVPPromise.resolve();\n }\n\n /**\n The `findAll()` method is used to retrieve all records for a given type.\n Example\n ```app/adapters/application.js\n import Adapter from '@ember-data/adapter';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n export default class ApplicationAdapter extends Adapter {\n findAll(store, type) {\n return new RSVP.Promise(function(resolve, reject) {\n $.getJSON(`/${type.modelName}`).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n reject(jqXHR);\n });\n });\n }\n }\n ```\n @method findAll\n @param {Store} store\n @param {Model} type\n @param {undefined} neverSet a value is never provided to this argument\n @param {SnapshotRecordArray} snapshotRecordArray\n @return {Promise} promise\n @public\n */\n findAll(store, type, neverSet, snapshotRecordArray) {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a findAll override');\n }\n return RSVPPromise.resolve();\n }\n\n /**\n This method is called when you call `query` on the store.\n Example\n ```app/adapters/application.js\n import Adapter from '@ember-data/adapter';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n export default class ApplicationAdapter extends Adapter {\n query(store, type, query) {\n return new RSVP.Promise(function(resolve, reject) {\n $.getJSON(`/${type.modelName}`, query).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n reject(jqXHR);\n });\n });\n }\n }\n ```\n @method query\n @param {Store} store\n @param {Model} type\n @param {Object} query\n @param {AdapterPopulatedRecordArray} recordArray\n @param {Object} adapterOptions\n @return {Promise} promise\n @public\n */\n query(store, type, query) {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a query override');\n }\n return RSVPPromise.resolve();\n }\n\n /**\n The `queryRecord()` method is invoked when the store is asked for a single\n record through a query object.\n In response to `queryRecord()` being called, you should always fetch fresh\n data. Once found, you can asynchronously call the store's `push()` method\n to push the record into the store.\n Here is an example `queryRecord` implementation:\n Example\n ```app/adapters/application.js\n import Adapter, { BuildURLMixin } from '@ember-data/adapter';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n export default class ApplicationAdapter extends Adapter.extend(BuildURLMixin) {\n queryRecord(store, type, query) {\n return new RSVP.Promise(function(resolve, reject) {\n $.getJSON(`/${type.modelName}`, query).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n reject(jqXHR);\n });\n });\n }\n }\n ```\n @method queryRecord\n @param {Store} store\n @param {subclass of Model} type\n @param {Object} query\n @param {Object} adapterOptions\n @return {Promise} promise\n @public\n */\n queryRecord(store, type, query, adapterOptions) {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a queryRecord override');\n }\n return RSVPPromise.resolve();\n }\n\n /**\n If the globally unique IDs for your records should be generated on the client,\n implement the `generateIdForRecord()` method. This method will be invoked\n each time you create a new record, and the value returned from it will be\n assigned to the record's `primaryKey`.\n Most traditional REST-like HTTP APIs will not use this method. Instead, the ID\n of the record will be set by the server, and your adapter will update the store\n with the new ID when it calls `didCreateRecord()`. Only implement this method if\n you intend to generate record IDs on the client-side.\n The `generateIdForRecord()` method will be invoked with the requesting store as\n the first parameter and the newly created record as the second parameter:\n ```javascript\n import Adapter from '@ember-data/adapter';\n import { v4 } from 'uuid';\n export default class ApplicationAdapter extends Adapter {\n generateIdForRecord(store, type, inputProperties) {\n return v4();\n }\n }\n ```\n @method generateIdForRecord\n @param {Store} store\n @param {Model} type the Model class of the record\n @param {Object} inputProperties a hash of properties to set on the\n newly created record.\n @return {(String|Number)} id\n @public\n */\n\n /**\n Proxies to the serializer's `serialize` method.\n Example\n ```app/adapters/application.js\n import Adapter from '@ember-data/adapter';\n export default class ApplicationAdapter extends Adapter {\n createRecord(store, type, snapshot) {\n let data = this.serialize(snapshot, { includeId: true });\n let url = `/${type.modelName}`;\n // ...\n }\n }\n ```\n @method serialize\n @param {Snapshot} snapshot\n @param {Object} options\n @return {Object} serialized snapshot\n @public\n */\n serialize(snapshot, options) {\n return snapshot.serialize(options);\n }\n\n /**\n Implement this method in a subclass to handle the creation of\n new records.\n Serializes the record and sends it to the server.\n Example\n ```app/adapters/application.js\n import Adapter from '@ember-data/adapter';\n import { run } from '@ember/runloop';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n export default class ApplicationAdapter extends Adapter {\n createRecord(store, type, snapshot) {\n let data = this.serialize(snapshot, { includeId: true });\n return new RSVP.Promise(function (resolve, reject) {\n $.ajax({\n type: 'POST',\n url: `/${type.modelName}`,\n dataType: 'json',\n data: data\n }).then(function (data) {\n run(null, resolve, data);\n }, function (jqXHR) {\n jqXHR.then = null; // tame jQuery's ill mannered promises\n run(null, reject, jqXHR);\n });\n });\n }\n }\n ```\n @method createRecord\n @param {Store} store\n @param {Model} type the Model class of the record\n @param {Snapshot} snapshot\n @return {Promise} promise\n @public\n */\n createRecord(store, type, snapshot) {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a createRecord override');\n }\n return RSVPPromise.resolve();\n }\n\n /**\n Implement this method in a subclass to handle the updating of\n a record.\n Serializes the record update and sends it to the server.\n The updateRecord method is expected to return a promise that will\n resolve with the serialized record. This allows the backend to\n inform the Ember Data store the current state of this record after\n the update. If it is not possible to return a serialized record\n the updateRecord promise can also resolve with `undefined` and the\n Ember Data store will assume all of the updates were successfully\n applied on the backend.\n Example\n ```app/adapters/application.js\n import Adapter from '@ember-data/adapter';\n import { run } from '@ember/runloop';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n export default class ApplicationAdapter extends Adapter {\n updateRecord(store, type, snapshot) {\n let data = this.serialize(snapshot, { includeId: true });\n let id = snapshot.id;\n return new RSVP.Promise(function(resolve, reject) {\n $.ajax({\n type: 'PUT',\n url: `/${type.modelName}/${id}`,\n dataType: 'json',\n data: data\n }).then(function(data) {\n run(null, resolve, data);\n }, function(jqXHR) {\n jqXHR.then = null; // tame jQuery's ill mannered promises\n run(null, reject, jqXHR);\n });\n });\n }\n }\n ```\n @method updateRecord\n @param {Store} store\n @param {Model} type the Model class of the record\n @param {Snapshot} snapshot\n @return {Promise} promise\n @public\n */\n updateRecord(store, type, snapshot) {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a updateRecord override');\n }\n return RSVPPromise.resolve();\n }\n\n /**\n Implement this method in a subclass to handle the deletion of\n a record.\n Sends a delete request for the record to the server.\n Example\n ```app/adapters/application.js\n import Adapter from '@ember-data/adapter';\n import { run } from '@ember/runloop';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n export default class ApplicationAdapter extends Adapter {\n deleteRecord(store, type, snapshot) {\n let data = this.serialize(snapshot, { includeId: true });\n let id = snapshot.id;\n return new RSVP.Promise(function(resolve, reject) {\n $.ajax({\n type: 'DELETE',\n url: `/${type.modelName}/${id}`,\n dataType: 'json',\n data: data\n }).then(function(data) {\n run(null, resolve, data);\n }, function(jqXHR) {\n jqXHR.then = null; // tame jQuery's ill mannered promises\n run(null, reject, jqXHR);\n });\n });\n }\n }\n ```\n @method deleteRecord\n @param {Store} store\n @param {Model} type the Model class of the record\n @param {Snapshot} snapshot\n @return {Promise} promise\n @public\n */\n deleteRecord(store, type, snapshot) {\n if (DEBUG) {\n throw new Error('You subclassed the Adapter class but missing a deleteRecord override');\n }\n return RSVPPromise.resolve();\n }\n\n /**\n By default the store will try to coalesce all `findRecord` calls within the same runloop\n into as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call.\n You can opt out of this behaviour by either not implementing the findMany hook or by setting\n coalesceFindRequests to false.\n @property coalesceFindRequests\n @public\n @type {boolean}\n */\n get coalesceFindRequests() {\n let coalesceFindRequests = this._coalesceFindRequests;\n if (typeof coalesceFindRequests === 'boolean') {\n return coalesceFindRequests;\n }\n return this._coalesceFindRequests = true;\n }\n set coalesceFindRequests(value) {\n this._coalesceFindRequests = value;\n }\n\n /**\n The store will call `findMany` instead of multiple `findRecord`\n requests to find multiple records at once if coalesceFindRequests\n is true.\n ```app/adapters/application.js\n import Adapter from '@ember-data/adapter';\n import { run } from '@ember/runloop';\n import RSVP from 'RSVP';\n import $ from 'jquery';\n export default class ApplicationAdapter extends Adapter {\n findMany(store, type, ids, snapshots) {\n return new RSVP.Promise(function(resolve, reject) {\n $.ajax({\n type: 'GET',\n url: `/${type.modelName}/`,\n dataType: 'json',\n data: { filter: { id: ids.join(',') } }\n }).then(function(data) {\n run(null, resolve, data);\n }, function(jqXHR) {\n jqXHR.then = null; // tame jQuery's ill mannered promises\n run(null, reject, jqXHR);\n });\n });\n }\n }\n ```\n @method findMany\n @param {Store} store\n @param {Model} type the Model class of the records\n @param {Array} ids\n @param {Array} snapshots\n @return {Promise} promise\n @public\n */\n\n /**\n Organize records into groups, each of which is to be passed to separate\n calls to `findMany`.\n For example, if your API has nested URLs that depend on the parent, you will\n want to group records by their parent.\n The default implementation returns the records as a single group.\n @method groupRecordsForFindMany\n @public\n @param {Store} store\n @param {Array} snapshots\n @return {Array} an array of arrays of records, each of which is to be\n loaded separately by `findMany`.\n */\n groupRecordsForFindMany(store, snapshots) {\n return [snapshots];\n }\n\n /**\n This method is used by the store to determine if the store should\n reload a record from the adapter when a record is requested by\n `store.findRecord`.\n If this method returns `true`, the store will re-fetch a record from\n the adapter. If this method returns `false`, the store will resolve\n immediately using the cached record.\n For example, if you are building an events ticketing system, in which users\n can only reserve tickets for 20 minutes at a time, and want to ensure that\n in each route you have data that is no more than 20 minutes old you could\n write:\n ```javascript\n shouldReloadRecord(store, ticketSnapshot) {\n let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n if (timeDiff > 20) {\n return true;\n } else {\n return false;\n }\n }\n ```\n This method would ensure that whenever you do `store.findRecord('ticket',\n id)` you will always get a ticket that is no more than 20 minutes old. In\n case the cached version is more than 20 minutes old, `findRecord` will not\n resolve until you fetched the latest version.\n By default this hook returns `false`, as most UIs should not block user\n interactions while waiting on data update.\n Note that, with default settings, `shouldBackgroundReloadRecord` will always\n re-fetch the records in the background even if `shouldReloadRecord` returns\n `false`. You can override `shouldBackgroundReloadRecord` if this does not\n suit your use case.\n @since 1.13.0\n @method shouldReloadRecord\n @param {Store} store\n @param {Snapshot} snapshot\n @return {Boolean}\n @public\n */\n shouldReloadRecord(store, snapshot) {\n return false;\n }\n\n /**\n This method is used by the store to determine if the store should\n reload all records from the adapter when records are requested by\n `store.findAll`.\n If this method returns `true`, the store will re-fetch all records from\n the adapter. If this method returns `false`, the store will resolve\n immediately using the cached records.\n For example, if you are building an events ticketing system, in which users\n can only reserve tickets for 20 minutes at a time, and want to ensure that\n in each route you have data that is no more than 20 minutes old you could\n write:\n ```javascript\n shouldReloadAll(store, snapshotArray) {\n let snapshots = snapshotArray.snapshots();\n return snapshots.any((ticketSnapshot) => {\n let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n if (timeDiff > 20) {\n return true;\n } else {\n return false;\n }\n });\n }\n ```\n This method would ensure that whenever you do `store.findAll('ticket')` you\n will always get a list of tickets that are no more than 20 minutes old. In\n case a cached version is more than 20 minutes old, `findAll` will not\n resolve until you fetched the latest versions.\n By default, this method returns `true` if the passed `snapshotRecordArray`\n is empty (meaning that there are no records locally available yet),\n otherwise, it returns `false`.\n Note that, with default settings, `shouldBackgroundReloadAll` will always\n re-fetch all the records in the background even if `shouldReloadAll` returns\n `false`. You can override `shouldBackgroundReloadAll` if this does not suit\n your use case.\n @since 1.13.0\n @method shouldReloadAll\n @param {Store} store\n @param {SnapshotRecordArray} snapshotRecordArray\n @return {Boolean}\n @public\n */\n shouldReloadAll(store, snapshotRecordArray) {\n return !snapshotRecordArray.length;\n }\n\n /**\n This method is used by the store to determine if the store should\n reload a record after the `store.findRecord` method resolves a\n cached record.\n This method is *only* checked by the store when the store is\n returning a cached record.\n If this method returns `true` the store will re-fetch a record from\n the adapter.\n For example, if you do not want to fetch complex data over a mobile\n connection, or if the network is down, you can implement\n `shouldBackgroundReloadRecord` as follows:\n ```javascript\n shouldBackgroundReloadRecord(store, snapshot) {\n let { downlink, effectiveType } = navigator.connection;\n return downlink > 0 && effectiveType === '4g';\n }\n ```\n By default, this hook returns `true` so the data for the record is updated\n in the background.\n @since 1.13.0\n @method shouldBackgroundReloadRecord\n @param {Store} store\n @param {Snapshot} snapshot\n @return {Boolean}\n @public\n */\n shouldBackgroundReloadRecord(store, Snapshot) {\n return true;\n }\n\n /**\n This method is used by the store to determine if the store should\n reload a record array after the `store.findAll` method resolves\n with a cached record array.\n This method is *only* checked by the store when the store is\n returning a cached record array.\n If this method returns `true` the store will re-fetch all records\n from the adapter.\n For example, if you do not want to fetch complex data over a mobile\n connection, or if the network is down, you can implement\n `shouldBackgroundReloadAll` as follows:\n ```javascript\n shouldBackgroundReloadAll(store, snapshotArray) {\n let { downlink, effectiveType } = navigator.connection;\n return downlink > 0 && effectiveType === '4g';\n }\n ```\n By default this method returns `true`, indicating that a background reload\n should always be triggered.\n @since 1.13.0\n @method shouldBackgroundReloadAll\n @param {Store} store\n @param {SnapshotRecordArray} snapshotRecordArray\n @return {Boolean}\n @public\n */\n shouldBackgroundReloadAll(store, snapshotRecordArray) {\n return true;\n }\n}, _descriptor = _applyDecoratedDescriptor(_class.prototype, \"store\", [service], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _class);\nexport { Adapter as default };\nexport { BuildURLMixin } from './-private';","/**\n @module @ember-data/adapter/json-api\n */\nimport { assert } from '@ember/debug';\nimport { dasherize } from '@ember/string';\nimport { pluralize } from 'ember-inflector';\nimport { serializeIntoHash } from './-private';\nimport RESTAdapter from './rest';\n\n/**\n The `JSONAPIAdapter` is the default adapter used by Ember Data. It\n is responsible for transforming the store's requests into HTTP\n requests that follow the [JSON API](http://jsonapi.org/format/)\n format.\n\n ## JSON API Conventions\n\n The JSONAPIAdapter uses JSON API conventions for building the URL\n for a record and selecting the HTTP verb to use with a request. The\n actions you can take on a record map onto the following URLs in the\n JSON API adapter:\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Action\n \n HTTP Verb\n \n URL\n
\n `store.findRecord('post', 123)`\n \n GET\n \n /posts/123\n
\n `store.findAll('post')`\n \n GET\n \n /posts\n
\n Update `postRecord.save()`\n \n PATCH\n \n /posts/123\n
\n Create `store.createRecord('post').save()`\n \n POST\n \n /posts\n
\n Delete `postRecord.destroyRecord()`\n \n DELETE\n \n /posts/123\n
\n\n ## Success and failure\n\n The JSONAPIAdapter will consider a success any response with a\n status code of the 2xx family (\"Success\"), as well as 304 (\"Not\n Modified\"). Any other status code will be considered a failure.\n\n On success, the request promise will be resolved with the full\n response payload.\n\n Failed responses with status code 422 (\"Unprocessable Entity\") will\n be considered \"invalid\". The response will be discarded, except for\n the `errors` key. The request promise will be rejected with a\n `InvalidError`. This error object will encapsulate the saved\n `errors` value.\n\n Any other status codes will be treated as an adapter error. The\n request promise will be rejected, similarly to the invalid case,\n but with an instance of `AdapterError` instead.\n\n ### Endpoint path customization\n\n Endpoint paths can be prefixed with a `namespace` by setting the\n namespace property on the adapter:\n\n ```app/adapters/application.js\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n namespace = 'api/1';\n }\n ```\n Requests for the `person` model would now target `/api/1/people/1`.\n\n ### Host customization\n\n An adapter can target other hosts by setting the `host` property.\n\n ```app/adapters/application.js\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\n export default class ApplicationAdapter extends JSONAPIAdapter {\n host = 'https://api.example.com';\n }\n ```\n\n Requests for the `person` model would now target\n `https://api.example.com/people/1`.\n\n @since 1.13.0\n @class JSONAPIAdapter\n @main @ember-data/adapter/json-api\n @public\n @constructor\n @extends RESTAdapter\n*/\nclass JSONAPIAdapter extends RESTAdapter {\n constructor(...args) {\n super(...args);\n this._defaultContentType = 'application/vnd.api+json';\n }\n /**\n @method ajaxOptions\n @private\n @param {String} url\n @param {String} type The request type GET, POST, PUT, DELETE etc.\n @param {Object} options\n @return {Object}\n */\n ajaxOptions(url, type, options = {}) {\n let hash = super.ajaxOptions(url, type, options);\n hash.headers['Accept'] = hash.headers['Accept'] || 'application/vnd.api+json';\n return hash;\n }\n\n /**\n By default the JSONAPIAdapter will send each find request coming from a `store.find`\n or from accessing a relationship separately to the server. If your server supports passing\n ids as a query string, you can set coalesceFindRequests to true to coalesce all find requests\n within a single runloop.\n For example, if you have an initial payload of:\n ```javascript\n {\n data: {\n id: 1,\n type: 'post',\n relationship: {\n comments: {\n data: [\n { id: 1, type: 'comment' },\n { id: 2, type: 'comment' }\n ]\n }\n }\n }\n }\n ```\n By default calling `post.get('comments')` will trigger the following requests(assuming the\n comments haven't been loaded before):\n ```\n GET /comments/1\n GET /comments/2\n ```\n If you set coalesceFindRequests to `true` it will instead trigger the following request:\n ```\n GET /comments?filter[id]=1,2\n ```\n Setting coalesceFindRequests to `true` also works for `store.find` requests and `belongsTo`\n relationships accessed within the same runloop. If you set `coalesceFindRequests: true`\n ```javascript\n store.findRecord('comment', 1);\n store.findRecord('comment', 2);\n ```\n will also send a request to: `GET /comments?filter[id]=1,2`\n Note: Requests coalescing rely on URL building strategy. So if you override `buildURL` in your app\n `groupRecordsForFindMany` more likely should be overridden as well in order for coalescing to work.\n @property coalesceFindRequests\n @public\n @type {boolean}\n */\n get coalesceFindRequests() {\n let coalesceFindRequests = this._coalesceFindRequests;\n if (typeof coalesceFindRequests === 'boolean') {\n return coalesceFindRequests;\n }\n return this._coalesceFindRequests = false;\n }\n set coalesceFindRequests(value) {\n this._coalesceFindRequests = value;\n }\n findMany(store, type, ids, snapshots) {\n let url = this.buildURL(type.modelName, ids, snapshots, 'findMany');\n return this.ajax(url, 'GET', {\n data: {\n filter: {\n id: ids.join(',')\n }\n }\n });\n }\n pathForType(modelName) {\n let dasherized = dasherize(modelName);\n return pluralize(dasherized);\n }\n updateRecord(store, schema, snapshot) {\n const data = serializeIntoHash(store, schema, snapshot);\n const type = snapshot.modelName;\n const id = snapshot.id;\n assert(`Attempted to update the ${type} record, but the record has no id`, typeof id === 'string' && id.length > 0);\n let url = this.buildURL(type, id, snapshot, 'updateRecord');\n return this.ajax(url, 'PATCH', {\n data: data\n });\n }\n}\nexport default JSONAPIAdapter;","var _dec, _class;\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\n/**\n @module @ember-data/adapter/rest\n*/\nimport { getOwner } from '@ember/application';\nimport { assert, warn } from '@ember/debug';\nimport { computed } from '@ember/object';\nimport { join } from '@ember/runloop';\nimport { DEBUG } from '@glimmer/env';\nimport { Promise as RSVPPromise } from 'rsvp';\nimport { determineBodyPromise, fetch, parseResponseHeaders, serializeIntoHash, serializeQueryParams } from './-private';\nimport AdapterError, { AbortError, ConflictError, ForbiddenError, InvalidError, NotFoundError, ServerError, TimeoutError, UnauthorizedError } from './error';\nimport Adapter, { BuildURLMixin } from './index';\n/**\n The REST adapter allows your store to communicate with an HTTP server by\n transmitting JSON via XHR. Most Ember.js apps that consume a JSON API\n should use the REST adapter.\n\n This adapter is designed around the idea that the JSON exchanged with\n the server should be conventional.\n\n ## Success and failure\n\n The REST adapter will consider a success any response with a status code\n of the 2xx family (\"Success\"), as well as 304 (\"Not Modified\"). Any other\n status code will be considered a failure.\n\n On success, the request promise will be resolved with the full response\n payload.\n\n Failed responses with status code 422 (\"Unprocessable Entity\") will be\n considered \"invalid\". The response will be discarded, except for the\n `errors` key. The request promise will be rejected with a `InvalidError`.\n This error object will encapsulate the saved `errors` value.\n\n Any other status codes will be treated as an \"adapter error\". The request\n promise will be rejected, similarly to the \"invalid\" case, but with\n an instance of `AdapterError` instead.\n\n ## JSON Structure\n\n The REST adapter expects the JSON returned from your server to follow\n these conventions.\n\n ### Object Root\n\n The JSON payload should be an object that contains the record inside a\n root property. For example, in response to a `GET` request for\n `/posts/1`, the JSON should look like this:\n\n ```js\n {\n \"posts\": {\n \"id\": 1,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\"\n }\n }\n ```\n\n Similarly, in response to a `GET` request for `/posts`, the JSON should\n look like this:\n\n ```js\n {\n \"posts\": [\n {\n \"id\": 1,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\"\n },\n {\n \"id\": 2,\n \"title\": \"Rails is omakase\",\n \"author\": \"D2H\"\n }\n ]\n }\n ```\n\n Note that the object root can be pluralized for both a single-object response\n and an array response: the REST adapter is not strict on this. Further, if the\n HTTP server responds to a `GET` request to `/posts/1` (e.g. the response to a\n `findRecord` query) with more than one object in the array, Ember Data will\n only display the object with the matching ID.\n\n ### Conventional Names\n\n Attribute names in your JSON payload should be the camelCased versions of\n the attributes in your Ember.js models.\n\n For example, if you have a `Person` model:\n\n ```app/models/person.js\n import Model, { attr } from '@ember-data/model';\n\n export default Model.extend({\n firstName: attr('string'),\n lastName: attr('string'),\n occupation: attr('string')\n });\n ```\n\n The JSON returned should look like this:\n\n ```js\n {\n \"people\": {\n \"id\": 5,\n \"firstName\": \"Zaphod\",\n \"lastName\": \"Beeblebrox\",\n \"occupation\": \"President\"\n }\n }\n ```\n\n #### Relationships\n\n Relationships are usually represented by ids to the record in the\n relationship. The related records can then be sideloaded in the\n response under a key for the type.\n\n ```js\n {\n \"posts\": {\n \"id\": 5,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\",\n \"comments\": [1, 2]\n },\n \"comments\": [{\n \"id\": 1,\n \"author\": \"User 1\",\n \"message\": \"First!\",\n }, {\n \"id\": 2,\n \"author\": \"User 2\",\n \"message\": \"Good Luck!\",\n }]\n }\n ```\n\n If the records in the relationship are not known when the response\n is serialized it's also possible to represent the relationship as a\n URL using the `links` key in the response. Ember Data will fetch\n this URL to resolve the relationship when it is accessed for the\n first time.\n\n ```js\n {\n \"posts\": {\n \"id\": 5,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\",\n \"links\": {\n \"comments\": \"/posts/5/comments\"\n }\n }\n }\n ```\n\n ### Errors\n\n If a response is considered a failure, the JSON payload is expected to include\n a top-level key `errors`, detailing any specific issues. For example:\n\n ```js\n {\n \"errors\": {\n \"msg\": \"Something went wrong\"\n }\n }\n ```\n\n This adapter does not make any assumptions as to the format of the `errors`\n object. It will simply be passed along as is, wrapped in an instance\n of `InvalidError` or `AdapterError`. The serializer can interpret it\n afterwards.\n\n ## Customization\n\n ### Endpoint path customization\n\n Endpoint paths can be prefixed with a `namespace` by setting the namespace\n property on the adapter:\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n namespace = 'api/1';\n }\n ```\n Requests for the `Person` model would now target `/api/1/people/1`.\n\n ### Host customization\n\n An adapter can target other hosts by setting the `host` property.\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n host = 'https://api.example.com';\n }\n ```\n\n ### Headers customization\n\n Some APIs require HTTP headers, e.g. to provide an API key. Arbitrary\n headers can be set as key/value pairs on the `RESTAdapter`'s `headers`\n object and Ember Data will send them along with each ajax request.\n\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n headers: computed(function() {\n return {\n 'API_KEY': 'secret key',\n 'ANOTHER_HEADER': 'Some header value'\n };\n }\n }\n ```\n\n `headers` can also be used as a computed property to support dynamic\n headers. In the example below, the `session` object has been\n injected into an adapter by Ember's container.\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n headers: computed('session.authToken', function() {\n return {\n 'API_KEY': this.get('session.authToken'),\n 'ANOTHER_HEADER': 'Some header value'\n };\n })\n }\n ```\n\n In some cases, your dynamic headers may require data from some\n object outside of Ember's observer system (for example\n `document.cookie`). You can use the\n [volatile](/api/classes/Ember.ComputedProperty.html?anchor=volatile)\n function to set the property into a non-cached mode causing the headers to\n be recomputed with every request.\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n import { get } from '@ember/object';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n headers: computed(function() {\n return {\n 'API_KEY': get(document.cookie.match(/apiKey\\=([^;]*)/), '1'),\n 'ANOTHER_HEADER': 'Some header value'\n };\n }).volatile()\n }\n ```\n\n @class RESTAdapter\n @main @ember-data/adapter/rest\n @public\n @constructor\n @extends Adapter\n @uses BuildURLMixin\n*/\nlet RESTAdapter = (_dec = computed(), _class = class RESTAdapter extends Adapter.extend(BuildURLMixin) {\n constructor(...args) {\n super(...args);\n /**\n This property allows ajax to still be used instead when `false`.\n @property useFetch\n @type {Boolean}\n @default true\n @public\n */\n this.useFetch = true;\n this._defaultContentType = 'application/json; charset=utf-8';\n // http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers\n this.maxURLLength = 2048;\n }\n get fastboot() {\n // Avoid computed property override deprecation in fastboot as suggested by:\n // https://deprecations.emberjs.com/v3.x/#toc_computed-property-override\n let fastboot = this._fastboot;\n if (fastboot) {\n return fastboot;\n }\n return this._fastboot = getOwner(this).lookup('service:fastboot');\n }\n set fastboot(value) {\n this._fastboot = value;\n }\n\n /**\n By default, the RESTAdapter will send the query params sorted alphabetically to the\n server.\n For example:\n ```js\n store.query('posts', { sort: 'price', category: 'pets' });\n ```\n will generate a requests like this `/posts?category=pets&sort=price`, even if the\n parameters were specified in a different order.\n That way the generated URL will be deterministic and that simplifies caching mechanisms\n in the backend.\n Setting `sortQueryParams` to a falsey value will respect the original order.\n In case you want to sort the query parameters with a different criteria, set\n `sortQueryParams` to your custom sort function.\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n export default class ApplicationAdapter extends RESTAdapter {\n sortQueryParams(params) {\n let sortedKeys = Object.keys(params).sort().reverse();\n let len = sortedKeys.length, newParams = {};\n for (let i = 0; i < len; i++) {\n newParams[sortedKeys[i]] = params[sortedKeys[i]];\n }\n return newParams;\n }\n }\n ```\n @method sortQueryParams\n @param {Object} obj\n @return {Object}\n @public\n */\n sortQueryParams(obj) {\n let keys = Object.keys(obj);\n let len = keys.length;\n if (len < 2) {\n return obj;\n }\n let newQueryParams = {};\n let sortedKeys = keys.sort();\n for (let i = 0; i < len; i++) {\n newQueryParams[sortedKeys[i]] = obj[sortedKeys[i]];\n }\n return newQueryParams;\n }\n\n /**\n By default the RESTAdapter will send each find request coming from a `store.find`\n or from accessing a relationship separately to the server. If your server supports passing\n ids as a query string, you can set coalesceFindRequests to true to coalesce all find requests\n within a single runloop.\n For example, if you have an initial payload of:\n ```javascript\n {\n post: {\n id: 1,\n comments: [1, 2]\n }\n }\n ```\n By default calling `post.get('comments')` will trigger the following requests(assuming the\n comments haven't been loaded before):\n ```\n GET /comments/1\n GET /comments/2\n ```\n If you set coalesceFindRequests to `true` it will instead trigger the following request:\n ```\n GET /comments?ids[]=1&ids[]=2\n ```\n Setting coalesceFindRequests to `true` also works for `store.find` requests and `belongsTo`\n relationships accessed within the same runloop. If you set `coalesceFindRequests: true`\n ```javascript\n store.findRecord('comment', 1);\n store.findRecord('comment', 2);\n ```\n will also send a request to: `GET /comments?ids[]=1&ids[]=2`\n Note: Requests coalescing rely on URL building strategy. So if you override `buildURL` in your app\n `groupRecordsForFindMany` more likely should be overridden as well in order for coalescing to work.\n @property coalesceFindRequests\n @public\n @type {boolean}\n */\n get coalesceFindRequests() {\n let coalesceFindRequests = this._coalesceFindRequests;\n if (typeof coalesceFindRequests === 'boolean') {\n return coalesceFindRequests;\n }\n return this._coalesceFindRequests = false;\n }\n set coalesceFindRequests(value) {\n this._coalesceFindRequests = value;\n }\n\n /**\n Endpoint paths can be prefixed with a `namespace` by setting the namespace\n property on the adapter:\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n export default class ApplicationAdapter extends RESTAdapter {\n namespace = 'api/1';\n }\n ```\n Requests for the `Post` model would now target `/api/1/post/`.\n @property namespace\n @public\n @type {String}\n */\n\n /**\n An adapter can target other hosts by setting the `host` property.\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n export default class ApplicationAdapter extends RESTAdapter {\n host = 'https://api.example.com';\n }\n ```\n Requests for the `Post` model would now target `https://api.example.com/post/`.\n @property host\n @public\n @type {String}\n */\n\n /**\n Some APIs require HTTP headers, e.g. to provide an API\n key. Arbitrary headers can be set as key/value pairs on the\n `RESTAdapter`'s `headers` object and Ember Data will send them\n along with each ajax request. For dynamic headers see [headers\n customization](/ember-data/release/classes/RESTAdapter).\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n export default class ApplicationAdapter extends RESTAdapter {\n headers: computed(function() {\n return {\n 'API_KEY': 'secret key',\n 'ANOTHER_HEADER': 'Some header value'\n };\n })\n }\n ```\n @property headers\n @public\n @type {Object}\n */\n\n /**\n Called by the store in order to fetch the JSON for a given\n type and ID.\n The `findRecord` method makes an Ajax request to a URL computed by\n `buildURL`, and returns a promise for the resulting payload.\n This method performs an HTTP `GET` request with the id provided as part of the query string.\n @since 1.13.0\n @method findRecord\n @public\n @param {Store} store\n @param {Model} type\n @param {String} id\n @param {Snapshot} snapshot\n @return {Promise} promise\n */\n findRecord(store, type, id, snapshot) {\n let url = this.buildURL(type.modelName, id, snapshot, 'findRecord');\n let query = this.buildQuery(snapshot);\n return this.ajax(url, 'GET', {\n data: query\n });\n }\n\n /**\n Called by the store in order to fetch a JSON array for all\n of the records for a given type.\n The `findAll` method makes an Ajax (HTTP GET) request to a URL computed by `buildURL`, and returns a\n promise for the resulting payload.\n @method findAll\n @public\n @param {Store} store\n @param {Model} type\n @param {undefined} neverSet a value is never provided to this argument\n @param {SnapshotRecordArray} snapshotRecordArray\n @return {Promise} promise\n */\n findAll(store, type, sinceToken, snapshotRecordArray) {\n let query = this.buildQuery(snapshotRecordArray);\n let url = this.buildURL(type.modelName, null, snapshotRecordArray, 'findAll');\n if (sinceToken) {\n query.since = sinceToken;\n }\n return this.ajax(url, 'GET', {\n data: query\n });\n }\n\n /**\n Called by the store in order to fetch a JSON array for\n the records that match a particular query.\n The `query` method makes an Ajax (HTTP GET) request to a URL\n computed by `buildURL`, and returns a promise for the resulting\n payload.\n The `query` argument is a simple JavaScript object that will be passed directly\n to the server as parameters.\n @method query\n @public\n @param {Store} store\n @param {Model} type\n @param {Object} query\n @param {AdapterPopulatedRecordArray} recordArray\n @param {Object} adapterOptions\n @return {Promise} promise\n */\n query(store, type, query) {\n let url = this.buildURL(type.modelName, null, null, 'query', query);\n if (this.sortQueryParams) {\n query = this.sortQueryParams(query);\n }\n return this.ajax(url, 'GET', {\n data: query\n });\n }\n\n /**\n Called by the store in order to fetch a JSON object for\n the record that matches a particular query.\n The `queryRecord` method makes an Ajax (HTTP GET) request to a URL\n computed by `buildURL`, and returns a promise for the resulting\n payload.\n The `query` argument is a simple JavaScript object that will be passed directly\n to the server as parameters.\n @since 1.13.0\n @method queryRecord\n @public\n @param {Store} store\n @param {Model} type\n @param {Object} query\n @param {Object} adapterOptions\n @return {Promise} promise\n */\n queryRecord(store, type, query, adapterOptions) {\n let url = this.buildURL(type.modelName, null, null, 'queryRecord', query);\n if (this.sortQueryParams) {\n query = this.sortQueryParams(query);\n }\n return this.ajax(url, 'GET', {\n data: query\n });\n }\n\n /**\n Called by the store in order to fetch several records together if `coalesceFindRequests` is true\n For example, if the original payload looks like:\n ```js\n {\n \"id\": 1,\n \"title\": \"Rails is omakase\",\n \"comments\": [ 1, 2, 3 ]\n }\n ```\n The IDs will be passed as a URL-encoded Array of IDs, in this form:\n ```\n ids[]=1&ids[]=2&ids[]=3\n ```\n Many servers, such as Rails and PHP, will automatically convert this URL-encoded array\n into an Array for you on the server-side. If you want to encode the\n IDs, differently, just override this (one-line) method.\n The `findMany` method makes an Ajax (HTTP GET) request to a URL computed by `buildURL`, and returns a\n promise for the resulting payload.\n @method findMany\n @public\n @param {Store} store\n @param {Model} type\n @param {Array} ids\n @param {Array} snapshots\n @return {Promise} promise\n */\n findMany(store, type, ids, snapshots) {\n let url = this.buildURL(type.modelName, ids, snapshots, 'findMany');\n return this.ajax(url, 'GET', {\n data: {\n ids: ids\n }\n });\n }\n\n /**\n Called by the store in order to fetch a JSON array for\n the unloaded records in a has-many relationship that were originally\n specified as a URL (inside of `links`).\n For example, if your original payload looks like this:\n ```js\n {\n \"post\": {\n \"id\": 1,\n \"title\": \"Rails is omakase\",\n \"links\": { \"comments\": \"/posts/1/comments\" }\n }\n }\n ```\n This method will be called with the parent record and `/posts/1/comments`.\n The `findHasMany` method will make an Ajax (HTTP GET) request to the originally specified URL.\n The format of your `links` value will influence the final request URL via the `urlPrefix` method:\n * Links beginning with `//`, `http://`, `https://`, will be used as is, with no further manipulation.\n * Links beginning with a single `/` will have the current adapter's `host` value prepended to it.\n * Links with no beginning `/` will have a parentURL prepended to it, via the current adapter's `buildURL`.\n @method findHasMany\n @public\n @param {Store} store\n @param {Snapshot} snapshot\n @param {String} url\n @param {Object} relationship meta object describing the relationship\n @return {Promise} promise\n */\n findHasMany(store, snapshot, url, relationship) {\n let id = snapshot.id;\n let type = snapshot.modelName;\n assert(`Attempted to fetch the hasMany relationship for ${type}, but the record has no id`, typeof id === 'string' && id.length > 0);\n url = this.urlPrefix(url, this.buildURL(type, id, snapshot, 'findHasMany'));\n return this.ajax(url, 'GET');\n }\n\n /**\n Called by the store in order to fetch the JSON for the unloaded record in a\n belongs-to relationship that was originally specified as a URL (inside of\n `links`).\n For example, if your original payload looks like this:\n ```js\n {\n \"person\": {\n \"id\": 1,\n \"name\": \"Tom Dale\",\n \"links\": { \"group\": \"/people/1/group\" }\n }\n }\n ```\n This method will be called with the parent record and `/people/1/group`.\n The `findBelongsTo` method will make an Ajax (HTTP GET) request to the originally specified URL.\n The format of your `links` value will influence the final request URL via the `urlPrefix` method:\n * Links beginning with `//`, `http://`, `https://`, will be used as is, with no further manipulation.\n * Links beginning with a single `/` will have the current adapter's `host` value prepended to it.\n * Links with no beginning `/` will have a parentURL prepended to it, via the current adapter's `buildURL`.\n @method findBelongsTo\n @public\n @param {Store} store\n @param {Snapshot} snapshot\n @param {String} url\n @param {Object} relationship meta object describing the relationship\n @return {Promise} promise\n */\n findBelongsTo(store, snapshot, url, relationship) {\n let id = snapshot.id;\n let type = snapshot.modelName;\n assert(`Attempted to fetch the belongsTo relationship for ${type}, but the record has no id`, typeof id === 'string' && id.length > 0);\n url = this.urlPrefix(url, this.buildURL(type, id, snapshot, 'findBelongsTo'));\n return this.ajax(url, 'GET');\n }\n\n /**\n Called by the store when a newly created record is\n saved via the `save` method on a model record instance.\n The `createRecord` method serializes the record and makes an Ajax (HTTP POST) request\n to a URL computed by `buildURL`.\n See `serialize` for information on how to customize the serialized form\n of a record.\n @method createRecord\n @public\n @param {Store} store\n @param {Model} type\n @param {Snapshot} snapshot\n @return {Promise} promise\n */\n createRecord(store, type, snapshot) {\n let url = this.buildURL(type.modelName, null, snapshot, 'createRecord');\n const data = serializeIntoHash(store, type, snapshot);\n return this.ajax(url, 'POST', {\n data\n });\n }\n\n /**\n Called by the store when an existing record is saved\n via the `save` method on a model record instance.\n The `updateRecord` method serializes the record and makes an Ajax (HTTP PUT) request\n to a URL computed by `buildURL`.\n See `serialize` for information on how to customize the serialized form\n of a record.\n @method updateRecord\n @public\n @param {Store} store\n @param {Model} schema\n @param {Snapshot} snapshot\n @return {Promise} promise\n */\n updateRecord(store, schema, snapshot) {\n const data = serializeIntoHash(store, schema, snapshot, {});\n const type = snapshot.modelName;\n const id = snapshot.id;\n assert(`Attempted to update the ${type} record, but the record has no id`, typeof id === 'string' && id.length > 0);\n let url = this.buildURL(type, id, snapshot, 'updateRecord');\n return this.ajax(url, 'PUT', {\n data\n });\n }\n\n /**\n Called by the store when a record is deleted.\n The `deleteRecord` method makes an Ajax (HTTP DELETE) request to a URL computed by `buildURL`.\n @method deleteRecord\n @public\n @param {Store} store\n @param {Model} type\n @param {Snapshot} snapshot\n @return {Promise} promise\n */\n deleteRecord(store, schema, snapshot) {\n const type = snapshot.modelName;\n const id = snapshot.id;\n assert(`Attempted to delete the ${type} record, but the record has no id`, typeof id === 'string' && id.length > 0);\n return this.ajax(this.buildURL(type, id, snapshot, 'deleteRecord'), 'DELETE');\n }\n _stripIDFromURL(store, snapshot) {\n const type = snapshot.modelName;\n const id = snapshot.id;\n assert(`Attempted to strip the url from the ${type} record for coalescing, but the record has no id`, typeof id === 'string' && id.length > 0);\n let url = this.buildURL(type, id, snapshot);\n let expandedURL = url.split('/');\n // Case when the url is of the format ...something/:id\n // We are decodeURIComponent-ing the lastSegment because if it represents\n // the id, it has been encodeURIComponent-ified within `buildURL`. If we\n // don't do this, then records with id having special characters are not\n // coalesced correctly (see GH #4190 for the reported bug)\n let lastSegment = expandedURL[expandedURL.length - 1];\n if (decodeURIComponent(lastSegment) === id) {\n expandedURL[expandedURL.length - 1] = '';\n } else if (id && endsWith(lastSegment, '?id=' + id)) {\n //Case when the url is of the format ...something?id=:id\n expandedURL[expandedURL.length - 1] = lastSegment.substring(0, lastSegment.length - id.length - 1);\n }\n return expandedURL.join('/');\n }\n /**\n Organize records into groups, each of which is to be passed to separate\n calls to `findMany`.\n This implementation groups together records that have the same base URL but\n differing ids. For example `/comments/1` and `/comments/2` will be grouped together\n because we know findMany can coalesce them together as `/comments?ids[]=1&ids[]=2`\n It also supports urls where ids are passed as a query param, such as `/comments?id=1`\n but not those where there is more than 1 query param such as `/comments?id=2&name=David`\n Currently only the query param of `id` is supported. If you need to support others, please\n override this or the `_stripIDFromURL` method.\n It does not group records that have differing base urls, such as for example: `/posts/1/comments/2`\n and `/posts/2/comments/3`\n @method groupRecordsForFindMany\n @public\n @param {Store} store\n @param {Array} snapshots\n @return {Array} an array of arrays of records, each of which is to be\n loaded separately by `findMany`.\n */\n groupRecordsForFindMany(store, snapshots) {\n let groups = new Map();\n let adapter = this;\n let maxURLLength = this.maxURLLength;\n snapshots.forEach(snapshot => {\n let baseUrl = adapter._stripIDFromURL(store, snapshot);\n if (!groups.has(baseUrl)) {\n groups.set(baseUrl, []);\n }\n groups.get(baseUrl).push(snapshot);\n });\n function splitGroupToFitInUrl(group, maxURLLength, paramNameLength) {\n let idsSize = 0;\n let baseUrl = adapter._stripIDFromURL(store, group[0]);\n let splitGroups = [[]];\n group.forEach(snapshot => {\n let additionalLength = encodeURIComponent(snapshot.id).length + paramNameLength;\n if (baseUrl.length + idsSize + additionalLength >= maxURLLength) {\n idsSize = 0;\n splitGroups.push([]);\n }\n idsSize += additionalLength;\n let lastGroupIndex = splitGroups.length - 1;\n splitGroups[lastGroupIndex].push(snapshot);\n });\n return splitGroups;\n }\n let groupsArray = [];\n groups.forEach((group, key) => {\n let paramNameLength = '&ids%5B%5D='.length;\n let splitGroups = splitGroupToFitInUrl(group, maxURLLength, paramNameLength);\n splitGroups.forEach(splitGroup => groupsArray.push(splitGroup));\n });\n return groupsArray;\n }\n\n /**\n Takes an ajax response, and returns the json payload or an error.\n By default this hook just returns the json payload passed to it.\n You might want to override it in two cases:\n 1. Your API might return useful results in the response headers.\n Response headers are passed in as the second argument.\n 2. Your API might return errors as successful responses with status code\n 200 and an Errors text or object. You can return a `InvalidError` or a\n `AdapterError` (or a sub class) from this hook and it will automatically\n reject the promise and put your record into the invalid or error state.\n Returning a `InvalidError` from this method will cause the\n record to transition into the `invalid` state and make the\n `errors` object available on the record. When returning an\n `InvalidError` the store will attempt to normalize the error data\n returned from the server using the serializer's `extractErrors`\n method.\n @since 1.13.0\n @method handleResponse\n @public\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @param {Object} requestData - the original request information\n @return {Object | AdapterError} response\n */\n handleResponse(status, headers, payload, requestData) {\n if (this.isSuccess(status, headers, payload)) {\n return payload;\n } else if (this.isInvalid(status, headers, payload)) {\n return new InvalidError(typeof payload === 'object' && 'errors' in payload ? payload.errors : undefined);\n }\n let errors = this.normalizeErrorResponse(status, headers, payload);\n let detailedMessage = this.generatedDetailedMessage(status, headers, payload, requestData);\n switch (status) {\n case 401:\n return new UnauthorizedError(errors, detailedMessage);\n case 403:\n return new ForbiddenError(errors, detailedMessage);\n case 404:\n return new NotFoundError(errors, detailedMessage);\n case 409:\n return new ConflictError(errors, detailedMessage);\n default:\n if (status >= 500) {\n return new ServerError(errors, detailedMessage);\n }\n }\n return new AdapterError(errors, detailedMessage);\n }\n\n /**\n Default `handleResponse` implementation uses this hook to decide if the\n response is a success.\n @since 1.13.0\n @method isSuccess\n @public\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @return {Boolean}\n */\n isSuccess(status, _headers, _payload) {\n return status >= 200 && status < 300 || status === 304;\n }\n\n /**\n Default `handleResponse` implementation uses this hook to decide if the\n response is an invalid error.\n @since 1.13.0\n @method isInvalid\n @public\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @return {Boolean}\n */\n isInvalid(status, _headers, _payload) {\n return status === 422;\n }\n\n /**\n Takes a URL, an HTTP method and a hash of data, and makes an\n HTTP request.\n When the server responds with a payload, Ember Data will call into `extractSingle`\n or `extractArray` (depending on whether the original query was for one record or\n many records).\n By default, `ajax` method has the following behavior:\n * It sets the response `dataType` to `\"json\"`\n * If the HTTP method is not `\"GET\"`, it sets the `Content-Type` to be\n `application/json; charset=utf-8`\n * If the HTTP method is not `\"GET\"`, it stringifies the data passed in. The\n data is the serialized record in the case of a save.\n * Registers success and failure handlers.\n @method ajax\n @private\n @param {String} url\n @param {String} type The request type GET, POST, PUT, DELETE etc.\n @param {Object} options\n @return {Promise} promise\n */\n async ajax(url, type, options = {}) {\n let adapter = this;\n let requestData = {\n url: url,\n method: type\n };\n if (this.useFetch) {\n let hash = adapter.ajaxOptions(url, type, options);\n let response = await this._fetchRequest(hash);\n let payload = await determineBodyPromise(response, requestData);\n if (response.ok && !(payload instanceof Error)) {\n return fetchSuccessHandler(adapter, payload, response, requestData);\n } else {\n throw fetchErrorHandler(adapter, payload, response, null, requestData);\n }\n } else {\n let hash = adapter.ajaxOptions(url, type, options);\n return new RSVPPromise(function (resolve, reject) {\n hash.success = function (payload, textStatus, jqXHR) {\n let response = ajaxSuccessHandler(adapter, payload, jqXHR, requestData);\n join(null, resolve, response);\n };\n hash.error = function (jqXHR, textStatus, errorThrown) {\n let error = ajaxErrorHandler(adapter, jqXHR, errorThrown, requestData);\n join(null, reject, error);\n };\n adapter._ajax(hash);\n }, 'DS: RESTAdapter#ajax ' + type + ' to ' + url);\n }\n }\n\n /**\n @method _ajaxRequest\n @private\n @param {Object} options jQuery ajax options to be used for the ajax request\n */\n _ajaxRequest(options) {\n // TODO add assertion that jquery is there rather then equality check\n typeof jQuery !== 'undefined' && jQuery.ajax(options);\n }\n _fetchRequest(options) {\n let fetchFunction = fetch();\n if (fetchFunction) {\n return fetchFunction(options.url, options);\n } else {\n throw new Error('cannot find the `fetch` module or the `fetch` global. Did you mean to install the `ember-fetch` addon?');\n }\n }\n _ajax(options) {\n if (this.useFetch) {\n this._fetchRequest(options);\n } else {\n this._ajaxRequest(options);\n }\n }\n\n /**\n @method ajaxOptions\n @private\n @param {String} url\n @param {String} type The request type GET, POST, PUT, DELETE etc.\n @param {Object} options\n @return {Object}\n */\n ajaxOptions(url, method, options) {\n let reqOptions = Object.assign({\n url,\n method,\n type: method\n }, options);\n if (this.headers !== undefined) {\n reqOptions.headers = {\n ...this.headers,\n ...reqOptions.headers\n };\n } else if (!options.headers) {\n reqOptions.headers = {};\n }\n let contentType = reqOptions.contentType || this._defaultContentType;\n if (this.useFetch) {\n if (reqOptions.data && reqOptions.type !== 'GET' && reqOptions.headers) {\n if (!reqOptions.headers['Content-Type'] && !reqOptions.headers['content-type']) {\n reqOptions.headers['content-type'] = contentType;\n }\n }\n reqOptions = fetchOptions(reqOptions, this);\n } else {\n // GET requests without a body should not have a content-type header\n // and may be unexpected by a server\n if (reqOptions.data && reqOptions.type !== 'GET') {\n reqOptions = {\n ...reqOptions,\n contentType\n };\n }\n reqOptions = ajaxOptions(reqOptions, this);\n }\n reqOptions.url = this._ajaxURL(reqOptions.url);\n return reqOptions;\n }\n _ajaxURL(url) {\n if (this.fastboot?.isFastBoot) {\n let httpRegex = /^https?:\\/\\//;\n let protocolRelativeRegex = /^\\/\\//;\n let protocol = this.fastboot.request.protocol;\n let host = this.fastboot.request.host;\n if (protocolRelativeRegex.test(url)) {\n return `${protocol}${url}`;\n } else if (!httpRegex.test(url)) {\n try {\n return `${protocol}//${host}${url}`;\n } catch (fbError) {\n throw new Error('You are using Ember Data with no host defined in your adapter. This will attempt to use the host of the FastBoot request, which is not configured for the current host of this request. Please set the hostWhitelist property for in your environment.js. FastBoot Error: ' + fbError.message);\n }\n }\n }\n return url;\n }\n\n /**\n @method parseErrorResponse\n @private\n @param {String} responseText\n @return {Object}\n */\n parseErrorResponse(responseText) {\n let json = responseText;\n try {\n json = JSON.parse(responseText);\n } catch (e) {\n // ignored\n }\n return json;\n }\n\n /**\n @method normalizeErrorResponse\n @private\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @return {Array} errors payload\n */\n normalizeErrorResponse(status, _headers, payload) {\n if (payload && typeof payload === 'object' && 'errors' in payload && Array.isArray(payload.errors)) {\n return payload.errors;\n } else {\n return [{\n status: `${status}`,\n // Set to a string per the JSON API spec: https://jsonapi.org/format/#errors\n title: 'The backend responded with an error',\n detail: `${payload}`\n }];\n }\n }\n\n /**\n Generates a detailed (\"friendly\") error message, with plenty\n of information for debugging (good luck!)\n @method generatedDetailedMessage\n @private\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @param {Object} requestData\n @return {String} detailed error message\n */\n generatedDetailedMessage(status, headers, payload, requestData) {\n let shortenedPayload;\n let payloadContentType = headers['content-type'] || 'Empty Content-Type';\n if (payloadContentType === 'text/html' && typeof payload === 'string' && payload.length > 250) {\n shortenedPayload = '[Omitted Lengthy HTML]';\n } else {\n shortenedPayload = payload;\n }\n let requestDescription = requestData.method + ' ' + requestData.url;\n let payloadDescription = 'Payload (' + payloadContentType + ')';\n return ['Ember Data Request ' + requestDescription + ' returned a ' + status, payloadDescription, shortenedPayload].join('\\n');\n }\n\n /**\n Used by `findAll` and `findRecord` to build the query's `data` hash\n supplied to the ajax method.\n @method buildQuery\n @since 2.5.0\n @public\n @param {Snapshot} snapshot\n @return {Object}\n */\n buildQuery(snapshot) {\n let query = {};\n if (snapshot) {\n let {\n include\n } = snapshot;\n if (include) {\n query.include = include;\n }\n }\n return query;\n }\n}, _applyDecoratedDescriptor(_class.prototype, \"fastboot\", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, \"fastboot\"), _class.prototype), _class);\nfunction ajaxSuccess(adapter, payload, requestData, responseData) {\n let response;\n try {\n response = adapter.handleResponse(responseData.status, responseData.headers, payload, requestData);\n } catch (error) {\n return RSVPPromise.reject(error);\n }\n if (response && response.isAdapterError) {\n return RSVPPromise.reject(response);\n } else {\n return response;\n }\n}\nfunction ajaxError(adapter, payload, requestData, responseData) {\n let error;\n if (responseData.errorThrown instanceof Error && payload !== '') {\n error = responseData.errorThrown;\n } else if (responseData.textStatus === 'timeout') {\n error = new TimeoutError();\n } else if (responseData.textStatus === 'abort' || responseData.status === 0) {\n error = handleAbort(requestData, responseData);\n } else {\n try {\n error = adapter.handleResponse(responseData.status, responseData.headers, payload || responseData.errorThrown, requestData);\n } catch (e) {\n error = e;\n }\n }\n return error;\n}\n\n// Adapter abort error to include any relevent info, e.g. request/response:\nfunction handleAbort(requestData, responseData) {\n let {\n method,\n url,\n errorThrown\n } = requestData;\n let {\n status\n } = responseData;\n let msg = `Request failed: ${method} ${url} ${errorThrown || ''}`;\n let errors = [{\n title: 'Adapter Error',\n detail: msg.trim(),\n status\n }];\n return new AbortError(errors);\n}\n\n//From http://stackoverflow.com/questions/280634/endswith-in-javascript\nfunction endsWith(string, suffix) {\n if (typeof String.prototype.endsWith !== 'function') {\n return string.indexOf(suffix, string.length - suffix.length) !== -1;\n } else {\n return string.endsWith(suffix);\n }\n}\nfunction fetchSuccessHandler(adapter, payload, response, requestData) {\n let responseData = fetchResponseData(response);\n return ajaxSuccess(adapter, payload, requestData, responseData);\n}\nfunction fetchErrorHandler(adapter, payload, response, errorThrown, requestData) {\n let responseData = fetchResponseData(response);\n if (responseData.status === 200 && payload instanceof Error) {\n responseData.errorThrown = payload;\n payload = responseData.errorThrown.payload;\n } else {\n responseData.errorThrown = errorThrown;\n if (typeof payload === 'string') {\n payload = adapter.parseErrorResponse(payload);\n }\n }\n return ajaxError(adapter, payload, requestData, responseData);\n}\nfunction ajaxSuccessHandler(adapter, payload, jqXHR, requestData) {\n let responseData = ajaxResponseData(jqXHR);\n return ajaxSuccess(adapter, payload, requestData, responseData);\n}\nfunction ajaxErrorHandler(adapter, jqXHR, errorThrown, requestData) {\n let responseData = ajaxResponseData(jqXHR);\n responseData.errorThrown = errorThrown;\n let payload = adapter.parseErrorResponse(jqXHR.responseText);\n if (DEBUG) {\n let message = `The server returned an empty string for ${requestData.method} ${requestData.url}, which cannot be parsed into a valid JSON. Return either null or {}.`;\n let validJSONString = !(responseData.textStatus === 'parsererror' && payload === '');\n warn(message, validJSONString, {\n id: 'ds.adapter.returned-empty-string-as-JSON'\n });\n }\n return ajaxError(adapter, payload, requestData, responseData);\n}\nfunction fetchResponseData(response) {\n return {\n status: response.status,\n textStatus: response.statusText,\n headers: headersToObject(response.headers)\n };\n}\nfunction ajaxResponseData(jqXHR) {\n return {\n status: jqXHR.status,\n textStatus: jqXHR.statusText,\n headers: parseResponseHeaders(jqXHR.getAllResponseHeaders())\n };\n}\nfunction headersToObject(headers) {\n let headersObject = {};\n if (headers) {\n headers.forEach((value, key) => headersObject[key] = value);\n }\n return headersObject;\n}\n\n/**\n * Helper function that translates the options passed to `jQuery.ajax` into a format that `fetch` expects.\n *\n * @method fetchOptions\n * @for @ember-data/adapter/rest\n * @param {Object} _options\n * @param {Adapter} adapter\n * @private\n * @returns {Object}\n */\nexport function fetchOptions(options, adapter) {\n options.credentials = options.credentials || 'same-origin';\n if (options.data) {\n // GET and HEAD requests can't have a `body`\n if (options.method === 'GET' || options.method === 'HEAD') {\n // If no options are passed, Ember Data sets `data` to an empty object, which we test for.\n if (Object.keys(options.data).length && options.url) {\n // Test if there are already query params in the url (mimics jQuey.ajax).\n const queryParamDelimiter = options.url.indexOf('?') > -1 ? '&' : '?';\n options.url += `${queryParamDelimiter}${serializeQueryParams(options.data)}`;\n }\n } else {\n // NOTE: a request's body cannot be an object, so we stringify it if it is.\n // JSON.stringify removes keys with values of `undefined` (mimics jQuery.ajax).\n // If the data is not a POJO (it's a String, FormData, etc), we just set it.\n // If the data is a string, we assume it's a stringified object.\n\n /* We check for Objects this way because we want the logic inside the consequent to run\n * if `options.data` is a POJO, not if it is a data structure whose `typeof` returns \"object\"\n * when it's not (Array, FormData, etc). The reason we don't use `options.data.constructor`\n * to check is in case `data` is an object with no prototype (e.g. created with null).\n */\n if (Object.prototype.toString.call(options.data) === '[object Object]') {\n options.body = JSON.stringify(options.data);\n } else {\n options.body = options.data;\n }\n }\n }\n return options;\n}\nfunction ajaxOptions(options, adapter) {\n options.dataType = 'json';\n options.context = adapter;\n if (options.data && options.type !== 'GET') {\n options.data = JSON.stringify(options.data);\n }\n options.beforeSend = function (xhr) {\n if (options.headers) {\n Object.keys(options.headers).forEach(key => {\n let headerValue = options.headers && options.headers[key];\n const isString = value => typeof value === 'string';\n if (isString(headerValue)) {\n xhr.setRequestHeader(key, headerValue);\n }\n });\n }\n };\n return options;\n}\nexport default RESTAdapter;","/**\n # Overview\n\n This package provides the `DataAdapter` which the [Ember Inspector](https://github.com/emberjs/ember-inspector)\n uses to subscribe and retrieve information for the `data` tab in the inspector.\n\n This package adds roughly .6 KB when minified and compressed to your application in production; however,\n you can opt out of shipping this addon in production via options in `ember-cli-build.js`\n\n ```js\n let app = new EmberApp(defaults, {\n emberData: {\n includeDataAdapterInProduction: false\n }\n });\n ```\n\n When using `ember-data` as a dependency of your app, the default is to ship the inspector support to production.\n\n When not using `ember-data` as a dependency but instead using EmberData via declaring specific `@ember-data/`\n dependencies the default is to not ship to production.\n\n @module @ember-data/debug\n @main @ember-data/debug\n*/\nimport { A } from '@ember/array';\nimport { assert } from '@ember/debug';\nimport DataAdapter from '@ember/debug/data-adapter';\nimport { get } from '@ember/object';\nimport { addObserver, removeObserver } from '@ember/object/observers';\nimport { inject as service } from '@ember/service';\nimport { capitalize, underscore } from '@ember/string';\nimport { next } from '@ember/runloop';\nimport { typesMapFor } from './setup';\n\n/**\n Implements `@ember/debug/data-adapter` with for EmberData\n integration with the ember-inspector.\n\n @class InspectorDataAdapter\n @extends DataAdapter\n @private\n*/\nexport default DataAdapter.extend({\n store: service('store'),\n /**\n Specifies how records can be filtered based on the state of the record\n Records returned will need to have a `filterValues`\n property with a key for every name in the returned array\n @method getFilters\n @private\n @return {Array} List of objects defining filters\n The object should have a `name` and `desc` property\n */\n getFilters() {\n return [{\n name: 'isNew',\n desc: 'New'\n }, {\n name: 'isModified',\n desc: 'Modified'\n }, {\n name: 'isClean',\n desc: 'Clean'\n }];\n },\n _nameToClass(type) {\n return get(this, 'store').modelFor(type);\n },\n /**\n Fetch the model types and observe them for changes.\n Maintains the list of model types without needing the Model package for detection.\n @method watchModelTypes\n @private\n @param {Function} typesAdded Callback to call to add types.\n Takes an array of objects containing wrapped types (returned from `wrapModelType`).\n @param {Function} typesUpdated Callback to call when a type has changed.\n Takes an array of objects containing wrapped types.\n @return {Function} Method to call to remove all observers\n */\n watchModelTypes(typesAdded, typesUpdated) {\n const store = get(this, 'store');\n const __createRecordData = store._instanceCache._createRecordData;\n const _releaseMethods = [];\n const discoveredTypes = typesMapFor(store);\n\n // Add any models that were added during initialization of the app, before the inspector was opened\n discoveredTypes.forEach((_, type) => {\n this.watchTypeIfUnseen(store, discoveredTypes, type, typesAdded, typesUpdated, _releaseMethods);\n });\n\n // Overwrite _createRecordData so newly added models will get added to the list\n store._instanceCache._createRecordData = identifier => {\n // defer to ensure first-create does not result in an infinite loop, see https://github.com/emberjs/data/issues/8006\n next(() => this.watchTypeIfUnseen(store, discoveredTypes, identifier.type, typesAdded, typesUpdated, _releaseMethods));\n return __createRecordData.call(store._instanceCache, identifier);\n };\n let release = () => {\n _releaseMethods.forEach(fn => fn());\n store._instanceCache._createRecordData = __createRecordData;\n // reset the list so the models can be added if the inspector is re-opened\n // the entries are set to false instead of removed, since the models still exist in the app\n // we just need the inspector to become aware of them\n discoveredTypes.forEach((value, key) => {\n discoveredTypes.set(key, false);\n });\n this.releaseMethods.removeObject(release);\n };\n this.releaseMethods.pushObject(release);\n return release;\n },\n /**\n * Loop over the discovered types and use the callbacks from watchModelTypes to notify\n * the consumer of this adapter about the mdoels.\n *\n * @method watchTypeIfUnseen\n * @param {store} store\n * @param {Map} discoveredTypes\n * @param {String} type\n * @param {Function} typesAdded\n * @param {Function} typesUpdated\n * @param {Array} releaseMethods\n * @private\n */\n watchTypeIfUnseen(store, discoveredTypes, type, typesAdded, typesUpdated, releaseMethods) {\n if (discoveredTypes.get(type) !== true) {\n let klass = store.modelFor(type);\n let wrapped = this.wrapModelType(klass, type);\n releaseMethods.push(this.observeModelType(type, typesUpdated));\n typesAdded([wrapped]);\n discoveredTypes.set(type, true);\n }\n },\n /**\n Creates a human readable string used for column headers\n @method columnNameToDesc\n @private\n @param {String} name The attribute name\n @return {String} Human readable string based on the attribute name\n */\n columnNameToDesc(name) {\n return capitalize(underscore(name).replace(/_/g, ' ').trim());\n },\n /**\n Get the columns for a given model type\n @method columnsForType\n @private\n @param {Model} typeClass\n @return {Array} An array of columns of the following format:\n name: {String} The name of the column\n desc: {String} Humanized description (what would show in a table column name)\n */\n columnsForType(typeClass) {\n let columns = [{\n name: 'id',\n desc: 'Id'\n }];\n let count = 0;\n let self = this;\n get(typeClass, 'attributes').forEach((meta, name) => {\n if (count++ > self.attributeLimit) {\n return false;\n }\n let desc = this.columnNameToDesc(name);\n columns.push({\n name: name,\n desc: desc\n });\n });\n return columns;\n },\n /**\n Fetches all loaded records for a given type\n @method getRecords\n @private\n @param {Model} modelClass of the record\n @param {String} modelName of the record\n @return {Array} An array of Model records\n This array will be observed for changes,\n so it should update when new records are added/removed\n */\n getRecords(modelClass, modelName) {\n if (arguments.length < 2) {\n // Legacy Ember.js < 1.13 support\n let containerKey = modelClass._debugContainerKey;\n if (containerKey) {\n let match = containerKey.match(/model:(.*)/);\n if (match !== null) {\n modelName = match[1];\n }\n }\n }\n assert('Cannot find model name. Please upgrade to Ember.js >= 1.13 for Ember Inspector support', !!modelName);\n return this.get('store').peekAll(modelName);\n },\n /**\n Gets the values for each column\n This is the attribute values for a given record\n @method getRecordColumnValues\n @private\n @param {Model} record to get values from\n @return {Object} Keys should match column names defined by the model type\n */\n getRecordColumnValues(record) {\n let count = 0;\n let columnValues = {\n id: get(record, 'id')\n };\n record.eachAttribute(key => {\n if (count++ > this.attributeLimit) {\n return false;\n }\n columnValues[key] = get(record, key);\n });\n return columnValues;\n },\n /**\n Returns keywords to match when searching records\n @method getRecordKeywords\n @private\n @param {Model} record\n @return {Array} Relevant keywords for search based on the record's attribute values\n */\n getRecordKeywords(record) {\n let keywords = [];\n let keys = A(['id']);\n record.eachAttribute(key => keys.push(key));\n keys.forEach(key => keywords.push(get(record, key)));\n return keywords;\n },\n /**\n Returns the values of filters defined by `getFilters`\n These reflect the state of the record\n @method getRecordFilterValues\n @private\n @param {Model} record\n @return {Object} The record state filter values\n */\n getRecordFilterValues(record) {\n return {\n isNew: record.get('isNew'),\n isModified: record.get('hasDirtyAttributes') && !record.get('isNew'),\n isClean: !record.get('hasDirtyAttributes')\n };\n },\n /**\n Returns a color that represents the record's state\n Possible colors: black, blue, green\n @method getRecordColor\n @private\n @param {Model} record\n @return {String} The record color\n */\n getRecordColor(record) {\n let color = 'black';\n if (record.get('isNew')) {\n color = 'green';\n } else if (record.get('hasDirtyAttributes')) {\n color = 'blue';\n }\n return color;\n },\n /**\n Observes all relevant properties and re-sends the wrapped record\n when a change occurs\n @method observeRecord\n @private\n @param {Model} record\n @param {Function} recordUpdated Callback used to notify changes\n @return {Function} The function to call to remove all observers\n */\n observeRecord(record, recordUpdated) {\n let releaseMethods = A();\n let keysToObserve = A(['id', 'isNew', 'hasDirtyAttributes']);\n record.eachAttribute(key => keysToObserve.push(key));\n let adapter = this;\n keysToObserve.forEach(function (key) {\n let handler = function () {\n recordUpdated(adapter.wrapRecord(record));\n };\n addObserver(record, key, handler);\n releaseMethods.push(function () {\n removeObserver(record, key, handler);\n });\n });\n let release = function () {\n releaseMethods.forEach(fn => fn());\n };\n return release;\n }\n});","import Store from '@ember-data/store';\nconst StoreTypesMap = new WeakMap();\nexport function typesMapFor(store) {\n let typesMap = StoreTypesMap.get(store);\n if (typesMap === undefined) {\n typesMap = new Map();\n StoreTypesMap.set(store, typesMap);\n }\n return typesMap;\n}\n\n// override _createRecordData to add the known models to the typesMap\nconst __createRecordData = Store.prototype._createRecordData;\nStore.prototype._createRecordData = function (identifier) {\n const typesMap = typesMapFor(this);\n if (!typesMap.has(identifier.type)) {\n typesMap.set(identifier.type, false);\n }\n return __createRecordData.call(this, identifier);\n};\nexport default {\n name: '@ember-data/data-adapter',\n initialize() {}\n};","export function isElementDescriptor(args) {\n let [maybeTarget, maybeKey, maybeDesc] = args;\n return (\n // Ensure we have the right number of args\n args.length === 3 && (\n // Make sure the target is a class or object (prototype)\n typeof maybeTarget === 'function' || typeof maybeTarget === 'object' && maybeTarget !== null) &&\n // Make sure the key is a string\n typeof maybeKey === 'string' && (\n // Make sure the descriptor is the right shape\n typeof maybeDesc === 'object' && maybeDesc !== null && 'enumerable' in maybeDesc && 'configurable' in maybeDesc ||\n // TS compatibility\n maybeDesc === undefined)\n );\n}\nexport function computedMacroWithOptionalParams(fn) {\n if (true) {\n return (...maybeDesc) => isElementDescriptor(maybeDesc) ? fn()(...maybeDesc) : fn(...maybeDesc);\n } else {\n return fn;\n }\n}","import { assert } from '@ember/debug';\nimport { computed } from '@ember/object';\nimport { DEBUG } from '@glimmer/env';\nimport { recordIdentifierFor, storeFor } from '@ember-data/store';\nimport { recordDataFor } from '@ember-data/store/-private';\nimport { computedMacroWithOptionalParams } from './util';\n\n/**\n @module @ember-data/model\n*/\n\nfunction getDefaultValue(record, options, key) {\n if (typeof options.defaultValue === 'function') {\n return options.defaultValue.apply(null, arguments);\n } else {\n let defaultValue = options.defaultValue;\n assert(`Non primitive defaultValues are not supported because they are shared between all instances. If you would like to use a complex object as a default value please provide a function that returns the complex object.`, typeof defaultValue !== 'object' || defaultValue === null);\n return defaultValue;\n }\n}\n\n/**\n `attr` defines an attribute on a [Model](/ember-data/release/classes/Model).\n By default, attributes are passed through as-is, however you can specify an\n optional type to have the value automatically transformed.\n Ember Data ships with four basic transform types: `string`, `number`,\n `boolean` and `date`. You can define your own transforms by subclassing\n [Transform](/ember-data/release/classes/Transform).\n\n Note that you cannot use `attr` to define an attribute of `id`.\n\n `attr` takes an optional hash as a second parameter, currently\n supported options are:\n\n - `defaultValue`: Pass a string or a function to be called to set the attribute\n to a default value if and only if the key is absent from the payload response.\n\n Example\n\n ```app/models/user.js\n import Model, { attr } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @attr('string') username;\n @attr('string') email;\n @attr('boolean', { defaultValue: false }) verified;\n }\n ```\n\n Default value can also be a function. This is useful it you want to return\n a new object for each attribute.\n\n ```app/models/user.js\n import Model, { attr } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @attr('string') username;\n @attr('string') email;\n\n @attr({\n defaultValue() {\n return {};\n }\n })\n settings;\n }\n ```\n\n The `options` hash is passed as second argument to a transforms'\n `serialize` and `deserialize` method. This allows to configure a\n transformation and adapt the corresponding value, based on the config:\n\n ```app/models/post.js\n import Model, { attr } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @attr('text', {\n uppercase: true\n })\n text;\n }\n ```\n\n ```app/transforms/text.js\n import Transform from '@ember-data/serializer/transform';\n\n export default class TextTransform extends Transform {\n serialize(value, options) {\n if (options.uppercase) {\n return value.toUpperCase();\n }\n\n return value;\n }\n\n deserialize(value) {\n return value;\n }\n }\n ```\n\n @method attr\n @public\n @static\n @for @ember-data/model\n @param {String|Object} type the attribute type\n @param {Object} options a hash of options\n @return {Attribute}\n*/\nfunction attr(type, options) {\n if (typeof type === 'object') {\n options = type;\n type = undefined;\n } else {\n options = options || {};\n }\n let meta = {\n type: type,\n isAttribute: true,\n kind: 'attribute',\n options: options\n };\n return computed({\n get(key) {\n if (DEBUG) {\n if (['_internalModel', 'currentState'].indexOf(key) !== -1) {\n throw new Error(`'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your attr on ${this.constructor.toString()}`);\n }\n }\n let recordData = recordDataFor(this);\n if (recordData.hasAttr(key)) {\n return recordData.getAttr(key);\n } else {\n return getDefaultValue(this, options, key);\n }\n },\n set(key, value) {\n if (DEBUG) {\n if (['_internalModel', 'currentState'].indexOf(key) !== -1) {\n throw new Error(`'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your attr on ${this.constructor.toString()}`);\n }\n }\n assert(`Attempted to set '${key}' on the deleted record ${recordIdentifierFor(this)}`, !this.currentState.isDeleted);\n const recordData = storeFor(this)._instanceCache.getRecordData(recordIdentifierFor(this));\n let currentValue = recordData.getAttr(key);\n if (currentValue !== value) {\n recordData.setDirtyAttribute(key, value);\n if (!this.isValid) {\n const {\n errors\n } = this;\n if (errors.get(key)) {\n errors.remove(key);\n this.currentState.cleanErrorRequests();\n }\n }\n }\n return value;\n }\n }).meta(meta);\n}\nexport default computedMacroWithOptionalParams(attr);","var _dec, _dec2, _dec3, _dec4, _class, _descriptor, _descriptor2;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nimport { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\nimport { computed, get } from '@ember/object';\nimport { mapBy, not } from '@ember/object/computed';\n\n/**\n @module @ember-data/model\n*/\n\n// we force the type here to our own construct because mixin and extend patterns\n// lose generic signatures. We also do this because we need to Omit `clear` from\n// the type of ArrayProxy as we override it's signature.\nconst ArrayProxyWithCustomOverrides = ArrayProxy;\n\n/**\n Holds validation errors for a given record, organized by attribute names.\n\n This class is not directly instantiable.\n\n Every `Model` has an `errors` property that is an instance of\n `Errors`. This can be used to display validation error\n messages returned from the server when a `record.save()` rejects.\n\n For Example, if you had a `User` model that looked like this:\n\n ```app/models/user.js\n import Model, { attr } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @attr('string') username;\n @attr('string') email;\n }\n ```\n And you attempted to save a record that did not validate on the backend:\n\n ```javascript\n let user = store.createRecord('user', {\n username: 'tomster',\n email: 'invalidEmail'\n });\n user.save();\n ```\n\n Your backend would be expected to return an error response that described\n the problem, so that error messages can be generated on the app.\n\n API responses will be translated into instances of `Errors` differently,\n depending on the specific combination of adapter and serializer used. You\n may want to check the documentation or the source code of the libraries\n that you are using, to know how they expect errors to be communicated.\n\n Errors can be displayed to the user by accessing their property name\n to get an array of all the error objects for that property. Each\n error object is a JavaScript object with two keys:\n\n - `message` A string containing the error message from the backend\n - `attribute` The name of the property associated with this error message\n\n ```handlebars\n \n {{#each @model.errors.username as |error|}}\n
\n {{error.message}}\n
\n {{/each}}\n\n \n {{#each @model.errors.email as |error|}}\n
\n {{error.message}}\n
\n {{/each}}\n ```\n\n You can also access the special `messages` property on the error\n object to get an array of all the error strings.\n\n ```handlebars\n {{#each @model.errors.messages as |message|}}\n
\n {{message}}\n
\n {{/each}}\n ```\n\n @class Errors\n @public\n @extends Ember.ArrayProxy\n */\nlet Errors = (_dec = computed(), _dec2 = mapBy('content', 'message'), _dec3 = computed(), _dec4 = not('length'), _class = class Errors extends ArrayProxyWithCustomOverrides {\n constructor(...args) {\n super(...args);\n /**\n An array containing all of the error messages for this\n record. This is useful for displaying all errors to the user.\n ```handlebars\n {{#each @model.errors.messages as |message|}}\n
\n {{message}}\n
\n {{/each}}\n ```\n @property messages\n @public\n @type {Array}\n */\n _initializerDefineProperty(this, \"messages\", _descriptor, this);\n /**\n Total number of errors.\n @property length\n @type {Number}\n @public\n @readOnly\n */\n /**\n `true` if we have no errors.\n @property isEmpty\n @type {Boolean}\n @public\n @readOnly\n */\n _initializerDefineProperty(this, \"isEmpty\", _descriptor2, this);\n }\n /**\n @property errorsByAttributeName\n @type {MapWithDefault}\n @private\n */\n get errorsByAttributeName() {\n return new Map();\n }\n\n /**\n Returns errors for a given attribute\n ```javascript\n let user = store.createRecord('user', {\n username: 'tomster',\n email: 'invalidEmail'\n });\n user.save().catch(function(){\n user.get('errors').errorsFor('email'); // returns:\n // [{attribute: \"email\", message: \"Doesn't look like a valid email.\"}]\n });\n ```\n @method errorsFor\n @public\n @param {String} attribute\n @return {Array}\n */\n errorsFor(attribute) {\n let map = this.errorsByAttributeName;\n let errors = map.get(attribute);\n if (errors === undefined) {\n errors = A();\n map.set(attribute, errors);\n }\n\n // Errors may be a native array with extensions turned on. Since we access\n // the array via a method, and not a computed or using `Ember.get`, it does\n // not entangle properly with autotracking, so we entangle manually by\n // getting the `[]` property.\n get(errors, '[]');\n return errors;\n }\n /**\n @property content\n @type {Array}\n @private\n */\n get content() {\n return A();\n }\n\n /**\n @method unknownProperty\n @private\n */\n unknownProperty(attribute) {\n let errors = this.errorsFor(attribute);\n if (errors.length === 0) {\n return undefined;\n }\n return errors;\n }\n /**\n Manually adds errors to the record. This will trigger the `becameInvalid` event/ lifecycle method on\n the record and transition the record into an `invalid` state.\n Example\n ```javascript\n let errors = get(user, 'errors');\n // add multiple errors\n errors.add('password', [\n 'Must be at least 12 characters',\n 'Must contain at least one symbol',\n 'Cannot contain your name'\n ]);\n errors.errorsFor('password');\n // =>\n // [\n // { attribute: 'password', message: 'Must be at least 12 characters' },\n // { attribute: 'password', message: 'Must contain at least one symbol' },\n // { attribute: 'password', message: 'Cannot contain your name' },\n // ]\n // add a single error\n errors.add('username', 'This field is required');\n errors.errorsFor('username');\n // =>\n // [\n // { attribute: 'username', message: 'This field is required' },\n // ]\n ```\n @method add\n @public\n @param {string} attribute - the property name of an attribute or relationship\n @param {string[]|string} messages - an error message or array of error messages for the attribute\n */\n add(attribute, messages) {\n const errors = this._findOrCreateMessages(attribute, messages);\n this.addObjects(errors);\n this.errorsFor(attribute).addObjects(errors);\n this.__record.currentState.notify('isValid');\n this.notifyPropertyChange(attribute);\n }\n\n /**\n @method _findOrCreateMessages\n @private\n */\n _findOrCreateMessages(attribute, messages) {\n let errors = this.errorsFor(attribute);\n let messagesArray = Array.isArray(messages) ? messages : [messages];\n let _messages = new Array(messagesArray.length);\n for (let i = 0; i < messagesArray.length; i++) {\n let message = messagesArray[i];\n let err = errors.findBy('message', message);\n if (err) {\n _messages[i] = err;\n } else {\n _messages[i] = {\n attribute: attribute,\n message\n };\n }\n }\n return _messages;\n }\n\n /**\n Manually removes all errors for a given member from the record.\n This will transition the record into a `valid` state, and\n triggers the `becameValid` event and lifecycle method.\n Example:\n ```javascript\n let errors = get('user', errors);\n errors.add('phone', ['error-1', 'error-2']);\n errors.errorsFor('phone');\n // =>\n // [\n // { attribute: 'phone', message: 'error-1' },\n // { attribute: 'phone', message: 'error-2' },\n // ]\n errors.remove('phone');\n errors.errorsFor('phone');\n // => undefined\n ```\n @method remove\n @public\n @param {string} member - the property name of an attribute or relationship\n */\n remove(attribute) {\n if (this.isEmpty) {\n return;\n }\n let content = this.rejectBy('attribute', attribute);\n this.content.setObjects(content);\n\n // Although errorsByAttributeName.delete is technically enough to sync errors state, we also\n // must mutate the array as well for autotracking\n let errors = this.errorsFor(attribute);\n for (let i = 0; i < errors.length; i++) {\n if (errors[i].attribute === attribute) {\n // .replace from Ember.NativeArray is necessary. JS splice will not work.\n errors.replace(i, 1);\n }\n }\n this.errorsByAttributeName.delete(attribute);\n this.__record.currentState.notify('isValid');\n this.notifyPropertyChange(attribute);\n this.notifyPropertyChange('length');\n }\n\n /**\n Manually clears all errors for the record.\n This will transition the record into a `valid` state, and\n will trigger the `becameValid` event and lifecycle method.\n Example:\n ```javascript\n let errors = get('user', errors);\n errors.add('username', ['error-a']);\n errors.add('phone', ['error-1', 'error-2']);\n errors.errorsFor('username');\n // =>\n // [\n // { attribute: 'username', message: 'error-a' },\n // ]\n errors.errorsFor('phone');\n // =>\n // [\n // { attribute: 'phone', message: 'error-1' },\n // { attribute: 'phone', message: 'error-2' },\n // ]\n errors.clear();\n errors.errorsFor('username');\n // => undefined\n errors.errorsFor('phone');\n // => undefined\n errors.get('messages')\n // => []\n ```\n @method clear\n @public\n */\n clear() {\n if (this.isEmpty) {\n return;\n }\n let errorsByAttributeName = this.errorsByAttributeName;\n let attributes = [];\n errorsByAttributeName.forEach(function (_, attribute) {\n attributes.push(attribute);\n });\n errorsByAttributeName.clear();\n attributes.forEach(attribute => {\n this.notifyPropertyChange(attribute);\n });\n this.__record.currentState.notify('isValid');\n super.clear();\n }\n\n /**\n Checks if there are error messages for the given attribute.\n ```app/controllers/user/edit.js\n import Controller from '@ember/controller';\n import { action } from '@ember/object';\n export default class UserEditController extends Controller {\n @action\n save(user) {\n if (user.get('errors').has('email')) {\n return alert('Please update your email before attempting to save.');\n }\n user.save();\n }\n }\n ```\n @method has\n @public\n @param {String} attribute\n @return {Boolean} true if there some errors on given attribute\n */\n has(attribute) {\n return this.errorsFor(attribute).length > 0;\n }\n}, _applyDecoratedDescriptor(_class.prototype, \"errorsByAttributeName\", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, \"errorsByAttributeName\"), _class.prototype), _descriptor = _applyDecoratedDescriptor(_class.prototype, \"messages\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"content\", [_dec3], Object.getOwnPropertyDescriptor(_class.prototype, \"content\"), _class.prototype), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"isEmpty\", [_dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _class);\nexport { Errors as default };","import { assert } from '@ember/debug';\nimport { DEBUG } from '@glimmer/env';\nexport function iterateData(data, fn) {\n if (Array.isArray(data)) {\n return data.map(fn);\n } else {\n return fn(data);\n }\n}\nexport function assertIdentifierHasId(identifier) {\n assert(`Attempted to schedule a fetch for a record without an id.`, identifier.id !== null);\n}\nexport function normalizeResponseHelper(serializer, store, modelClass, payload, id, requestType) {\n let normalizedResponse = serializer ? serializer.normalizeResponse(store, modelClass, payload, id, requestType) : payload;\n validateDocumentStructure(normalizedResponse);\n return normalizedResponse;\n}\nexport function validateDocumentStructure(doc) {\n if (DEBUG) {\n let errors = [];\n if (!doc || typeof doc !== 'object') {\n errors.push('Top level of a JSON API document must be an object');\n } else {\n if (!('data' in doc) && !('errors' in doc) && !('meta' in doc)) {\n errors.push('One or more of the following keys must be present: \"data\", \"errors\", \"meta\".');\n } else {\n if ('data' in doc && 'errors' in doc) {\n errors.push('Top level keys \"errors\" and \"data\" cannot both be present in a JSON API document');\n }\n }\n if ('data' in doc) {\n if (!(doc.data === null || Array.isArray(doc.data) || typeof doc.data === 'object')) {\n errors.push('data must be null, an object, or an array');\n }\n }\n if ('meta' in doc) {\n if (typeof doc.meta !== 'object') {\n errors.push('meta must be an object');\n }\n }\n if ('errors' in doc) {\n if (!Array.isArray(doc.errors)) {\n errors.push('errors must be an array');\n }\n }\n if ('links' in doc) {\n if (typeof doc.links !== 'object') {\n errors.push('links must be an object');\n }\n }\n if ('jsonapi' in doc) {\n if (typeof doc.jsonapi !== 'object') {\n errors.push('jsonapi must be an object');\n }\n }\n if ('included' in doc) {\n if (typeof doc.included !== 'object') {\n errors.push('included must be an array');\n }\n }\n }\n assert(`Response must be normalized to a valid JSON API document:\\n\\t* ${errors.join('\\n\\t* ')}`, errors.length === 0);\n }\n}","import { assert, deprecate } from '@ember/debug';\nimport { DEBUG } from '@glimmer/env';\nimport { resolve } from 'rsvp';\nimport { iterateData, normalizeResponseHelper } from './legacy-data-utils';\nexport function _findHasMany(adapter, store, identifier, link, relationship, options) {\n const snapshot = store._instanceCache.createSnapshot(identifier, options);\n let modelClass = store.modelFor(relationship.type);\n let useLink = !link || typeof link === 'string';\n let relatedLink = useLink ? link : link.href;\n let promise = adapter.findHasMany(store, snapshot, relatedLink, relationship);\n let label = `DS: Handle Adapter#findHasMany of '${identifier.type}' : '${relationship.type}'`;\n promise = guardDestroyedStore(promise, store, label);\n promise = promise.then(adapterPayload => {\n if (!_objectIsAlive(store._instanceCache.getInternalModel(identifier))) {\n if (true /* DEPRECATE_RSVP_PROMISE */) {\n deprecate(`A Promise for fetching ${relationship.type} did not resolve by the time your model was destroyed. This will error in a future release.`, false, {\n id: 'ember-data:rsvp-unresolved-async',\n until: '5.0',\n for: '@ember-data/store',\n since: {\n available: '4.5',\n enabled: '4.5'\n }\n });\n }\n }\n assert(`You made a 'findHasMany' request for a ${identifier.type}'s '${relationship.key}' relationship, using link '${link}' , but the adapter's response did not have any data`, payloadIsNotBlank(adapterPayload));\n let serializer = store.serializerFor(relationship.type);\n let payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, null, 'findHasMany');\n assert(`fetched the hasMany relationship '${relationship.name}' for ${identifier.type}:${identifier.id} with link '${link}', but no data member is present in the response. If no data exists, the response should set { data: [] }`, 'data' in payload && Array.isArray(payload.data));\n payload = syncRelationshipDataFromLink(store, payload, identifier, relationship);\n return store._push(payload);\n }, null, `DS: Extract payload of '${identifier.type}' : hasMany '${relationship.type}'`);\n if (true /* DEPRECATE_RSVP_PROMISE */) {\n promise = _guard(promise, _bind(_objectIsAlive, store._instanceCache.getInternalModel(identifier)));\n }\n return promise;\n}\nexport function _findBelongsTo(store, identifier, link, relationship, options) {\n let adapter = store.adapterFor(identifier.type);\n assert(`You tried to load a belongsTo relationship but you have no adapter (for ${identifier.type})`, adapter);\n assert(`You tried to load a belongsTo relationship from a specified 'link' in the original payload but your adapter does not implement 'findBelongsTo'`, typeof adapter.findBelongsTo === 'function');\n let snapshot = store._instanceCache.createSnapshot(identifier, options);\n let modelClass = store.modelFor(relationship.type);\n let useLink = !link || typeof link === 'string';\n let relatedLink = useLink ? link : link.href;\n let promise = adapter.findBelongsTo(store, snapshot, relatedLink, relationship);\n let label = `DS: Handle Adapter#findBelongsTo of ${identifier.type} : ${relationship.type}`;\n promise = guardDestroyedStore(promise, store, label);\n promise = _guard(promise, _bind(_objectIsAlive, store._instanceCache.getInternalModel(identifier)));\n promise = promise.then(adapterPayload => {\n if (!_objectIsAlive(store._instanceCache.getInternalModel(identifier))) {\n if (true /* DEPRECATE_RSVP_PROMISE */) {\n deprecate(`A Promise for fetching ${relationship.type} did not resolve by the time your model was destroyed. This will error in a future release.`, false, {\n id: 'ember-data:rsvp-unresolved-async',\n until: '5.0',\n for: '@ember-data/store',\n since: {\n available: '4.5',\n enabled: '4.5'\n }\n });\n }\n }\n let serializer = store.serializerFor(relationship.type);\n let payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, null, 'findBelongsTo');\n assert(`fetched the belongsTo relationship '${relationship.name}' for ${identifier.type}:${identifier.id} with link '${link}', but no data member is present in the response. If no data exists, the response should set { data: null }`, 'data' in payload && (payload.data === null || typeof payload.data === 'object' && !Array.isArray(payload.data)));\n if (!payload.data && !payload.links && !payload.meta) {\n return null;\n }\n payload = syncRelationshipDataFromLink(store, payload, identifier, relationship);\n return store._push(payload);\n }, null, `DS: Extract payload of ${identifier.type} : ${relationship.type}`);\n if (true /* DEPRECATE_RSVP_PROMISE */) {\n promise = _guard(promise, _bind(_objectIsAlive, store._instanceCache.getInternalModel(identifier)));\n }\n return promise;\n}\n\n// sync\n// iterate over records in payload.data\n// for each record\n// assert that record.relationships[inverse] is either undefined (so we can fix it)\n// or provide a data: {id, type} that matches the record that requested it\n// return the relationship data for the parent\nfunction syncRelationshipDataFromLink(store, payload, parentIdentifier, relationship) {\n // ensure the right hand side (incoming payload) points to the parent record that\n // requested this relationship\n let relationshipData = payload.data ? iterateData(payload.data, (data, index) => {\n const {\n id,\n type\n } = data;\n ensureRelationshipIsSetToParent(data, parentIdentifier, store, relationship, index);\n return {\n id,\n type\n };\n }) : null;\n const relatedDataHash = {};\n if ('meta' in payload) {\n relatedDataHash.meta = payload.meta;\n }\n if ('links' in payload) {\n relatedDataHash.links = payload.links;\n }\n if ('data' in payload) {\n relatedDataHash.data = relationshipData;\n }\n\n // now, push the left hand side (the parent record) to ensure things are in sync, since\n // the payload will be pushed with store._push\n const parentPayload = {\n id: parentIdentifier.id,\n type: parentIdentifier.type,\n relationships: {\n [relationship.key]: relatedDataHash\n }\n };\n if (!Array.isArray(payload.included)) {\n payload.included = [];\n }\n payload.included.push(parentPayload);\n return payload;\n}\nfunction ensureRelationshipIsSetToParent(payload, parentIdentifier, store, parentRelationship, index) {\n let {\n id,\n type\n } = payload;\n if (!payload.relationships) {\n payload.relationships = {};\n }\n let {\n relationships\n } = payload;\n let inverse = getInverse(store, parentIdentifier, parentRelationship, type);\n if (inverse) {\n let {\n inverseKey,\n kind\n } = inverse;\n let relationshipData = relationships[inverseKey] && relationships[inverseKey].data;\n if (DEBUG && typeof relationshipData !== 'undefined' && !relationshipDataPointsToParent(relationshipData, parentIdentifier)) {\n let inspect = function inspect(thing) {\n return `'${JSON.stringify(thing)}'`;\n };\n let quotedType = inspect(type);\n let quotedInverse = inspect(inverseKey);\n let expected = inspect({\n id: parentIdentifier.id,\n type: parentIdentifier.type\n });\n let expectedModel = `${parentIdentifier.type}:${parentIdentifier.id}`;\n let got = inspect(relationshipData);\n let prefix = typeof index === 'number' ? `data[${index}]` : `data`;\n let path = `${prefix}.relationships.${inverseKey}.data`;\n let other = relationshipData ? `<${relationshipData.type}:${relationshipData.id}>` : null;\n let relationshipFetched = `${expectedModel}.${parentRelationship.kind}(\"${parentRelationship.name}\")`;\n let includedRecord = `<${type}:${id}>`;\n let message = [`Encountered mismatched relationship: Ember Data expected ${path} in the payload from ${relationshipFetched} to include ${expected} but got ${got} instead.\\n`, `The ${includedRecord} record loaded at ${prefix} in the payload specified ${other} as its ${quotedInverse}, but should have specified ${expectedModel} (the record the relationship is being loaded from) as its ${quotedInverse} instead.`, `This could mean that the response for ${relationshipFetched} may have accidentally returned ${quotedType} records that aren't related to ${expectedModel} and could be related to a different ${parentIdentifier.type} record instead.`, `Ember Data has corrected the ${includedRecord} record's ${quotedInverse} relationship to ${expectedModel} so that ${relationshipFetched} will include ${includedRecord}.`, `Please update the response from the server or change your serializer to either ensure that the response for only includes ${quotedType} records that specify ${expectedModel} as their ${quotedInverse}, or omit the ${quotedInverse} relationship from the response.`].join('\\n');\n assert(message);\n }\n if (kind !== 'hasMany' || typeof relationshipData !== 'undefined') {\n relationships[inverseKey] = relationships[inverseKey] || {};\n relationships[inverseKey].data = fixRelationshipData(relationshipData, kind, parentIdentifier);\n }\n }\n}\nfunction getInverse(store, parentInternalModel, parentRelationship, type) {\n return recordDataFindInverseRelationshipInfo(store, parentInternalModel, parentRelationship, type);\n}\nfunction recordDataFindInverseRelationshipInfo(store, parentIdentifier, parentRelationship, type) {\n let {\n name: lhs_relationshipName\n } = parentRelationship;\n let {\n type: parentType\n } = parentIdentifier;\n let inverseKey = store._instanceCache._storeWrapper.inverseForRelationship(parentType, lhs_relationshipName);\n if (inverseKey) {\n let {\n meta: {\n kind\n }\n } = store._instanceCache._storeWrapper.relationshipsDefinitionFor(type)[inverseKey];\n return {\n inverseKey,\n kind\n };\n }\n}\nfunction relationshipDataPointsToParent(relationshipData, identifier) {\n if (relationshipData === null) {\n return false;\n }\n if (Array.isArray(relationshipData)) {\n if (relationshipData.length === 0) {\n return false;\n }\n for (let i = 0; i < relationshipData.length; i++) {\n let entry = relationshipData[i];\n if (validateRelationshipEntry(entry, identifier)) {\n return true;\n }\n }\n } else {\n return validateRelationshipEntry(relationshipData, identifier);\n }\n return false;\n}\nfunction fixRelationshipData(relationshipData, relationshipKind, {\n id,\n type\n}) {\n let parentRelationshipData = {\n id,\n type\n };\n let payload;\n if (relationshipKind === 'hasMany') {\n payload = relationshipData || [];\n if (relationshipData) {\n // these arrays could be massive so this is better than filter\n // Note: this is potentially problematic if type/id are not in the\n // same state of normalization.\n let found = relationshipData.find(v => {\n return v.type === parentRelationshipData.type && v.id === parentRelationshipData.id;\n });\n if (!found) {\n payload.push(parentRelationshipData);\n }\n } else {\n payload.push(parentRelationshipData);\n }\n } else {\n payload = relationshipData || {};\n Object.assign(payload, parentRelationshipData);\n }\n return payload;\n}\nfunction validateRelationshipEntry({\n id\n}, {\n id: parentModelID\n}) {\n return id && id.toString() === parentModelID;\n}\nfunction _bind(fn, ...args) {\n return function () {\n return fn.apply(undefined, args);\n };\n}\nfunction _guard(promise, test) {\n let guarded = promise.finally(() => {\n if (!test()) {\n guarded._subscribers.length = 0;\n }\n });\n return guarded;\n}\nfunction _objectIsAlive(object) {\n return !(object.isDestroyed || object.isDestroying);\n}\nfunction payloadIsNotBlank(adapterPayload) {\n if (Array.isArray(adapterPayload)) {\n return true;\n } else {\n return Object.keys(adapterPayload || {}).length;\n }\n}\nfunction guardDestroyedStore(promise, store, label) {\n let token;\n if (DEBUG) {\n token = store._trackAsyncRequestStart(label);\n }\n let wrapperPromise = resolve(promise, label).then(_v => {\n if (!_objectIsAlive(store)) {\n if (true /* DEPRECATE_RSVP_PROMISE */) {\n deprecate(`A Promise did not resolve by the time the store was destroyed. This will error in a future release.`, false, {\n id: 'ember-data:rsvp-unresolved-async',\n until: '5.0',\n for: '@ember-data/store',\n since: {\n available: '4.5',\n enabled: '4.5'\n }\n });\n }\n }\n return promise;\n });\n return _guard(wrapperPromise, () => {\n if (DEBUG) {\n store._trackAsyncRequestEnd(token);\n }\n return _objectIsAlive(store);\n });\n}","/**\n @module @ember-data/model\n*/\n\n/**\n @method diffArray\n @internal\n @param {Array} oldArray the old array\n @param {Array} newArray the new array\n @return {hash} {\n firstChangeIndex: , // null if no change\n addedCount: , // 0 if no change\n removedCount: // 0 if no change\n }\n*/\nexport default function diffArray(oldArray, newArray) {\n const oldLength = oldArray.length;\n const newLength = newArray.length;\n const shortestLength = Math.min(oldLength, newLength);\n let firstChangeIndex = null; // null signifies no changes\n\n // find the first change\n for (let i = 0; i < shortestLength; i++) {\n // compare each item in the array\n if (oldArray[i] !== newArray[i]) {\n firstChangeIndex = i;\n break;\n }\n }\n if (firstChangeIndex === null && newLength !== oldLength) {\n // no change found in the overlapping block\n // and array lengths differ,\n // so change starts at end of overlap\n firstChangeIndex = shortestLength;\n }\n let addedCount = 0;\n let removedCount = 0;\n if (firstChangeIndex !== null) {\n // we found a change, find the end of the change\n let unchangedEndBlockLength = shortestLength - firstChangeIndex;\n // walk back from the end of both arrays until we find a change\n for (let i = 1; i <= shortestLength; i++) {\n // compare each item in the array\n if (oldArray[oldLength - i] !== newArray[newLength - i]) {\n unchangedEndBlockLength = i - 1;\n break;\n }\n }\n addedCount = newLength - unchangedEndBlockLength - firstChangeIndex;\n removedCount = oldLength - unchangedEndBlockLength - firstChangeIndex;\n }\n return {\n firstChangeIndex,\n addedCount,\n removedCount\n };\n}","/**\n @module @ember-data/store\n*/\nimport EmberArray from '@ember/array';\nimport MutableArray from '@ember/array/mutable';\nimport { assert } from '@ember/debug';\nimport EmberObject, { get } from '@ember/object';\nimport { all } from 'rsvp';\nimport { PromiseArray, recordDataFor } from '@ember-data/store/-private';\nimport diffArray from './diff-array';\nconst MutableArrayWithObject = EmberObject.extend(MutableArray);\n/**\n A `ManyArray` is a `MutableArray` that represents the contents of a has-many\n relationship.\n\n The `ManyArray` is instantiated lazily the first time the relationship is\n requested.\n\n This class is not intended to be directly instantiated by consuming applications.\n\n ### Inverses\n\n Often, the relationships in Ember Data applications will have\n an inverse. For example, imagine the following models are\n defined:\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment') comments;\n }\n ```\n\n ```app/models/comment.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class CommentModel extends Model {\n @belongsTo('post') post;\n }\n ```\n\n If you created a new instance of `Post` and added\n a `Comment` record to its `comments` has-many\n relationship, you would expect the comment's `post`\n property to be set to the post that contained\n the has-many.\n\n We call the record to which a relationship belongs-to the\n relationship's _owner_.\n\n @class ManyArray\n @public\n @extends Ember.EmberObject\n @uses Ember.MutableArray\n*/\nexport default class ManyArray extends MutableArrayWithObject {\n // override the base declaration\n\n init() {\n super.init();\n\n /**\n The loading state of this array\n @property {Boolean} isLoaded\n @public\n */\n this.isLoaded = this.isLoaded || false;\n this.isAsync = this.isAsync || false;\n this._length = 0;\n\n /**\n Metadata associated with the request for async hasMany relationships.\n Example\n Given that the server returns the following JSON payload when fetching a\n hasMany relationship:\n ```js\n {\n \"comments\": [{\n \"id\": 1,\n \"comment\": \"This is the first comment\",\n }, {\n // ...\n }],\n \"meta\": {\n \"page\": 1,\n \"total\": 5\n }\n }\n ```\n You can then access the meta data via the `meta` property:\n ```js\n let comments = await post.comments;\n let meta = comments.meta;\n // meta.page => 1\n // meta.total => 5\n ```\n @property {Object | null} meta\n @public\n */\n this._meta = this._meta || null;\n\n /**\n * Retrieve the links for this relationship\n *\n @property {Object | null} links\n @public\n */\n this._links = this._links || null;\n\n /**\n `true` if the relationship is polymorphic, `false` otherwise.\n @property {Boolean} isPolymorphic\n @private\n */\n this.isPolymorphic = this.isPolymorphic || false;\n\n /**\n The relationship which manages this array.\n @property {ManyRelationship} relationship\n @private\n */\n this.currentState = [];\n this._isUpdating = false;\n this._isDirty = false;\n /*\n * Unfortunately ArrayProxy adds it's observers lazily,\n * so in a first-render situation we may sometimes notify\n * prior to the ArrayProxy having installed it's observers\n * (which occurs during _revalidate()).\n *\n * This leads to the flush occuring on access, the flush takes\n * the hasObservers codepath which in code out of our control\n * notifies again leading to a glimmer rendering invalidation error.\n *\n * We use this flag to detect the case where we notified without\n * array observers but observers were installed prior to flush.\n *\n * We do not need to fire array observers at all in this case\n * since it will be the first-access for those observers.\n */\n this._hasNotified = false;\n // make sure we initialize to the correct state\n // since the user has already accessed\n this.retrieveLatest();\n }\n\n // TODO refactor away _hasArrayObservers for tests\n get _hasArrayObservers() {\n // cast necessary because hasArrayObservers is typed as a ComputedProperty vs a boolean;\n return this.hasArrayObservers || this.__hasArrayObservers;\n }\n notify() {\n this._isDirty = true;\n if (this._hasArrayObservers && !this._hasNotified) {\n this.retrieveLatest();\n } else {\n this._hasNotified = true;\n this.notifyPropertyChange('[]');\n this.notifyPropertyChange('length');\n this.notifyPropertyChange('firstObject');\n this.notifyPropertyChange('lastObject');\n }\n }\n get length() {\n if (this._isDirty) {\n this.retrieveLatest();\n }\n // By using `get()`, the tracking system knows to pay attention to changes that occur.\n get(this, '[]');\n return this._length;\n }\n set length(value) {\n this._length = value;\n }\n get links() {\n get(this, '[]');\n if (this._isDirty) {\n this.retrieveLatest();\n }\n return this._links;\n }\n set links(v) {\n this._links = v;\n }\n get meta() {\n get(this, '[]');\n if (this._isDirty) {\n this.retrieveLatest();\n }\n return this._meta;\n }\n set meta(v) {\n this._meta = v;\n }\n objectAt(index) {\n if (this._isDirty) {\n this.retrieveLatest();\n }\n let identifier = this.currentState[index];\n if (identifier === undefined) {\n return;\n }\n return this.store._instanceCache.getRecord(identifier);\n }\n replace(idx, amt, objects) {\n assert(`Cannot push mutations to the cache while updating the relationship from cache`, !this._isUpdating);\n const {\n store\n } = this;\n store._backburner.join(() => {\n let identifiers;\n if (amt > 0) {\n identifiers = this.currentState.slice(idx, idx + amt);\n this.recordData.removeFromHasMany(this.key,\n // TODO RecordData V2: recordData should take identifiers not RecordDatas\n identifiers.map(identifier => store._instanceCache.getRecordData(identifier)));\n }\n if (objects) {\n assert('The third argument to replace needs to be an array.', Array.isArray(objects) || EmberArray.detect(objects));\n this.recordData.addToHasMany(this.key, objects.map(obj => recordDataFor(obj)), idx);\n }\n this.notify();\n });\n }\n retrieveLatest() {\n // It’s possible the parent side of the relationship may have been destroyed by this point\n if (this.isDestroyed || this.isDestroying || this._isUpdating) {\n return;\n }\n this._isDirty = false;\n this._isUpdating = true;\n let jsonApi = this.recordData.getHasMany(this.key);\n let identifiers = [];\n if (jsonApi.data) {\n for (let i = 0; i < jsonApi.data.length; i++) {\n // TODO figure out where this state comes from\n let im = this.store._instanceCache._internalModelForResource(jsonApi.data[i]);\n let shouldRemove = im._isDematerializing || im.isEmpty || !im.isLoaded;\n if (!shouldRemove) {\n identifiers.push(im.identifier);\n }\n }\n }\n if (jsonApi.meta) {\n this._meta = jsonApi.meta;\n }\n if (jsonApi.links) {\n this._links = jsonApi.links;\n }\n if (this._hasArrayObservers && !this._hasNotified) {\n // diff to find changes\n let diff = diffArray(this.currentState, identifiers);\n // it's null if no change found\n if (diff.firstChangeIndex !== null) {\n // we found a change\n this.arrayContentWillChange(diff.firstChangeIndex, diff.removedCount, diff.addedCount);\n this._length = identifiers.length;\n this.currentState = identifiers;\n this.arrayContentDidChange(diff.firstChangeIndex, diff.removedCount, diff.addedCount);\n }\n } else {\n this._hasNotified = false;\n this._length = identifiers.length;\n this.currentState = identifiers;\n }\n this._isUpdating = false;\n }\n\n /**\n Reloads all of the records in the manyArray. If the manyArray\n holds a relationship that was originally fetched using a links url\n Ember Data will revisit the original links url to repopulate the\n relationship.\n If the manyArray holds the result of a `store.query()` reload will\n re-run the original query.\n Example\n ```javascript\n let user = store.peekRecord('user', '1')\n await login(user);\n let permissions = await user.permissions;\n await permissions.reload();\n ```\n @method reload\n @public\n */\n reload(options) {\n // TODO this is odd, we don't ask the store for anything else like this?\n return this.legacySupport.reloadHasMany(this.key, options);\n }\n\n /**\n Saves all of the records in the `ManyArray`.\n Example\n ```javascript\n let inbox = await store.findRecord('inbox', '1');\n let messages = await inbox.messages;\n messages.forEach((message) => {\n message.isRead = true;\n });\n messages.save();\n ```\n @method save\n @public\n @return {PromiseArray} promise\n */\n save() {\n let manyArray = this;\n let promiseLabel = 'DS: ManyArray#save ' + this.type.modelName;\n let promise = all(this.invoke('save'), promiseLabel).then(() => manyArray, null, 'DS: ManyArray#save return ManyArray');\n\n // TODO deprecate returning a promiseArray here\n return PromiseArray.create({\n promise\n });\n }\n\n /**\n Create a child record within the owner\n @method createRecord\n @public\n @param {Object} hash\n @return {Model} record\n */\n createRecord(hash) {\n const {\n store,\n type\n } = this;\n const record = store.createRecord(type.modelName, hash);\n this.pushObject(record);\n return record;\n }\n}","var _dec, _class;\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nimport { assert } from '@ember/debug';\nimport { computed } from '@ember/object';\nimport { PromiseObject } from '@ember-data/store/-private';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\nconst Extended = PromiseObject;\n\n/**\n @module @ember-data/model\n */\n\n/**\n A PromiseBelongsTo is a PromiseObject that also proxies certain method calls\n to the underlying belongsTo model.\n Right now we proxy:\n * `reload()`\n @class PromiseBelongsTo\n @extends PromiseObject\n @private\n*/\nlet PromiseBelongsTo = (_dec = computed(), _class = class PromiseBelongsTo extends Extended {\n // we don't proxy meta because we would need to proxy it to the relationship state container\n // however, meta on relationships does not trigger change notifications.\n // if you need relationship meta, you should do `record.belongsTo(relationshipName).meta()`\n get meta() {\n // eslint-disable-next-line no-constant-condition\n if (1) {\n assert('You attempted to access meta on the promise for the async belongsTo relationship ' + `${this.get('_belongsToState').modelName}:${this.get('_belongsToState').key}'.` + '\\nUse `record.belongsTo(relationshipName).meta()` instead.', false);\n }\n return;\n }\n async reload(options) {\n assert('You are trying to reload an async belongsTo before it has been created', this.content !== undefined);\n let {\n key,\n legacySupport\n } = this._belongsToState;\n await legacySupport.reloadBelongsTo(key, options);\n return this;\n }\n}, _applyDecoratedDescriptor(_class.prototype, \"meta\", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, \"meta\"), _class.prototype), _class);\nexport default PromiseBelongsTo;","var _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport ArrayMixin, { NativeArray } from '@ember/array';\nimport { assert } from '@ember/debug';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { tracked } from '@glimmer/tracking';\nimport Ember from 'ember';\nimport { resolve } from 'rsvp';\n\n/**\n @module @ember-data/model\n */\n/**\n This class is returned as the result of accessing an async hasMany relationship\n on an instance of a Model extending from `@ember-data/model`.\n\n A PromiseManyArray is an array-like proxy that also proxies certain method calls\n to the underlying ManyArray in addition to being \"promisified\".\n\n Right now we proxy:\n\n * `reload()`\n * `createRecord()`\n\n This promise-proxy behavior is primarily to ensure that async relationship interact\n nicely with templates. In your JS code you should resolve the promise first.\n\n ```js\n const comments = await post.comments;\n ```\n\n @class PromiseManyArray\n @public\n*/\nlet PromiseManyArray = (_class = class PromiseManyArray {\n constructor(promise, content) {\n //---- Methods/Properties on ArrayProxy that we will keep as our API\n _initializerDefineProperty(this, \"content\", _descriptor, this);\n //---- Properties/Methods from the PromiseProxyMixin that we will keep as our API\n /**\n * Whether the loading promise is still pending\n *\n * @property {boolean} isPending\n * @public\n */\n _initializerDefineProperty(this, \"isPending\", _descriptor2, this);\n /**\n * Whether the loading promise rejected\n *\n * @property {boolean} isRejected\n * @public\n */\n _initializerDefineProperty(this, \"isRejected\", _descriptor3, this);\n /**\n * Whether the loading promise succeeded\n *\n * @property {boolean} isFulfilled\n * @public\n */\n _initializerDefineProperty(this, \"isFulfilled\", _descriptor4, this);\n /**\n * Whether the loading promise completed (resolved or rejected)\n *\n * @property {boolean} isSettled\n * @public\n */\n _initializerDefineProperty(this, \"isSettled\", _descriptor5, this);\n this._update(promise, content);\n this.isDestroyed = false;\n this.isDestroying = false;\n const meta = Ember.meta(this);\n meta.hasMixin = mixin => {\n if (mixin === NativeArray || mixin === ArrayMixin) {\n return true;\n }\n return false;\n };\n }\n /**\n * Retrieve the length of the content\n * @property length\n * @public\n */\n get length() {\n // shouldn't be needed, but ends up being needed\n // for computed chains even in 4.x\n this['[]'];\n return this.content ? this.content.length : 0;\n }\n\n // ember-source < 3.23 (e.g. 3.20 lts)\n // requires that the tag `'[]'` be notified\n // on the ArrayProxy in order for `{{#each}}`\n // to recompute. We entangle the '[]' tag from\n get '[]'() {\n return this.content ? this.content['[]'] : this.content;\n }\n\n /**\n * Iterate the proxied content. Called by the glimmer iterator in #each\n *\n * @method forEach\n * @param cb\n * @returns\n * @private\n */\n forEach(cb) {\n this['[]']; // needed for < 3.23 support e.g. 3.20 lts\n if (this.content && this.length) {\n this.content.forEach(cb);\n }\n }\n /**\n * chain this promise\n *\n * @method then\n * @public\n * @param success\n * @param fail\n * @returns Promise\n */\n then(s, f) {\n return this.promise.then(s, f);\n }\n\n /**\n * catch errors thrown by this promise\n * @method catch\n * @public\n * @param callback\n * @returns Promise\n */\n catch(cb) {\n return this.promise.catch(cb);\n }\n\n /**\n * run cleanup after this promise completes\n *\n * @method finally\n * @public\n * @param callback\n * @returns Promise\n */\n finally(cb) {\n return this.promise.finally(cb);\n }\n\n //---- Methods on EmberObject that we should keep\n\n destroy() {\n this.isDestroying = true;\n this.isDestroyed = true;\n this.content = null;\n this.promise = null;\n }\n\n //---- Methods/Properties on ManyArray that we own and proxy to\n\n /**\n * Retrieve the links for this relationship\n * @property links\n * @public\n */\n get links() {\n return this.content ? this.content.links : undefined;\n }\n\n /**\n * Retrieve the meta for this relationship\n * @property meta\n * @public\n */\n get meta() {\n return this.content ? this.content.meta : undefined;\n }\n\n /**\n * Reload the relationship\n * @method reload\n * @public\n * @param options\n * @returns\n */\n reload(options) {\n assert('You are trying to reload an async manyArray before it has been created', this.content);\n this.content.reload(options);\n return this;\n }\n\n //---- Our own stuff\n\n _update(promise, content) {\n if (content !== undefined) {\n this.content = content;\n }\n this.promise = tapPromise(this, promise);\n }\n static create({\n promise,\n content\n }) {\n return new this(promise, content);\n }\n\n // Methods on ManyArray which people should resolve the relationship first before calling\n createRecord(...args) {\n assert('You are trying to createRecord on an async manyArray before it has been created', this.content);\n return this.content.createRecord(...args);\n }\n\n // Properties/Methods on ArrayProxy we should deprecate\n\n get firstObject() {\n return this.content ? this.content.firstObject : undefined;\n }\n get lastObject() {\n return this.content ? this.content.lastObject : undefined;\n }\n}, _descriptor = _applyDecoratedDescriptor(_class.prototype, \"content\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return null;\n }\n}), _applyDecoratedDescriptor(_class.prototype, \"length\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"length\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '[]', [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, '[]'), _class.prototype), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"isPending\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return false;\n }\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"isRejected\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return false;\n }\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"isFulfilled\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return false;\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"isSettled\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return false;\n }\n}), _applyDecoratedDescriptor(_class.prototype, \"links\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"links\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"meta\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"meta\"), _class.prototype), _class);\nexport { PromiseManyArray as default };\nfunction tapPromise(proxy, promise) {\n proxy.isPending = true;\n proxy.isSettled = false;\n proxy.isFulfilled = false;\n proxy.isRejected = false;\n return resolve(promise).then(content => {\n proxy.isPending = false;\n proxy.isFulfilled = true;\n proxy.isSettled = true;\n proxy.content = content;\n return content;\n }, error => {\n proxy.isPending = false;\n proxy.isFulfilled = false;\n proxy.isRejected = true;\n proxy.isSettled = true;\n throw error;\n });\n}\nconst EmberObjectMethods = ['addObserver', 'cacheFor', 'decrementProperty', 'get', 'getProperties', 'incrementProperty', 'notifyPropertyChange', 'removeObserver', 'set', 'setProperties', 'toggleProperty'];\nEmberObjectMethods.forEach(method => {\n PromiseManyArray.prototype[method] = function delegatedMethod(...args) {\n return Ember[method](this, ...args);\n };\n});\nconst InheritedProxyMethods = ['addArrayObserver', 'addObject', 'addObjects', 'any', 'arrayContentDidChange', 'arrayContentWillChange', 'clear', 'compact', 'every', 'filter', 'filterBy', 'find', 'findBy', 'getEach', 'includes', 'indexOf', 'insertAt', 'invoke', 'isAny', 'isEvery', 'lastIndexOf', 'map', 'mapBy', 'objectAt', 'objectsAt', 'popObject', 'pushObject', 'pushObjects', 'reduce', 'reject', 'rejectBy', 'removeArrayObserver', 'removeAt', 'removeObject', 'removeObjects', 'replace', 'reverseObjects', 'setEach', 'setObjects', 'shiftObject', 'slice', 'sortBy', 'toArray', 'uniq', 'uniqBy', 'unshiftObject', 'unshiftObjects', 'without'];\nInheritedProxyMethods.forEach(method => {\n PromiseManyArray.prototype[method] = function proxiedMethod(...args) {\n assert(`Cannot call ${method} before content is assigned.`, this.content);\n return this.content[method](...args);\n };\n});","var _class, _descriptor, _identifier, _token, _relatedToken;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classPrivateFieldLooseBase(e, t) { if (!{}.hasOwnProperty.call(e, t)) throw new TypeError(\"attempted to use private field on non-instance\"); return e; }\nvar id = 0;\nfunction _classPrivateFieldLooseKey(e) { return \"__private_\" + id++ + \"_\" + e; }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { tracked } from '@glimmer/tracking';\nimport { cached } from \"ember-cached-decorator-polyfill\";\nimport { resolve } from 'rsvp';\nimport { recordIdentifierFor } from '@ember-data/store/-private';\nimport { LEGACY_SUPPORT } from '../model';\n\n/**\n @module @ember-data/model\n*/\n\nfunction isResourceIdentiferWithRelatedLinks(value) {\n return Boolean(value && value.links && value.links.related);\n}\n\n/**\n A `BelongsToReference` is a low-level API that allows users and\n addon authors to perform meta-operations on a belongs-to\n relationship.\n\n @class BelongsToReference\n @public\n */\nlet BelongsToReference = (_class = (_identifier = /*#__PURE__*/_classPrivateFieldLooseKey(\"identifier\"), _token = /*#__PURE__*/_classPrivateFieldLooseKey(\"token\"), _relatedToken = /*#__PURE__*/_classPrivateFieldLooseKey(\"relatedToken\"), class BelongsToReference {\n constructor(store, parentIdentifier, belongsToRelationship, key) {\n Object.defineProperty(this, _identifier, {\n writable: true,\n value: void 0\n });\n // unsubscribe tokens given to us by the notification manager\n Object.defineProperty(this, _token, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _relatedToken, {\n writable: true,\n value: null\n });\n _initializerDefineProperty(this, \"_ref\", _descriptor, this);\n this.key = key;\n this.belongsToRelationship = belongsToRelationship;\n this.type = belongsToRelationship.definition.type;\n this.store = store;\n _classPrivateFieldLooseBase(this, _identifier)[_identifier] = parentIdentifier;\n _classPrivateFieldLooseBase(this, _token)[_token] = store._notificationManager.subscribe(parentIdentifier, (_, bucket, notifiedKey) => {\n if ((bucket === 'relationships' || bucket === 'property') && notifiedKey === key) {\n this._ref++;\n }\n });\n\n // TODO inverse\n }\n destroy() {\n // TODO @feature we need the notification manager often enough\n // we should potentially just expose it fully public\n this.store._notificationManager.unsubscribe(_classPrivateFieldLooseBase(this, _token)[_token]);\n _classPrivateFieldLooseBase(this, _token)[_token] = null;\n if (_classPrivateFieldLooseBase(this, _relatedToken)[_relatedToken]) {\n this.store._notificationManager.unsubscribe(_classPrivateFieldLooseBase(this, _relatedToken)[_relatedToken]);\n _classPrivateFieldLooseBase(this, _relatedToken)[_relatedToken] = null;\n }\n }\n get _relatedIdentifier() {\n this._ref; // consume the tracked prop\n if (_classPrivateFieldLooseBase(this, _relatedToken)[_relatedToken]) {\n this.store._notificationManager.unsubscribe(_classPrivateFieldLooseBase(this, _relatedToken)[_relatedToken]);\n _classPrivateFieldLooseBase(this, _relatedToken)[_relatedToken] = null;\n }\n let resource = this._resource();\n if (resource && resource.data) {\n const identifier = this.store.identifierCache.getOrCreateRecordIdentifier(resource.data);\n _classPrivateFieldLooseBase(this, _relatedToken)[_relatedToken] = this.store._notificationManager.subscribe(identifier, (_, bucket, notifiedKey) => {\n if (bucket === 'identity' || (bucket === 'attributes' || bucket === 'property') && notifiedKey === 'id') {\n this._ref++;\n }\n });\n return identifier;\n }\n return null;\n }\n\n /**\n The `id` of the record that this reference refers to. Together, the\n `type()` and `id()` methods form a composite key for the identity\n map. This can be used to access the id of an async relationship\n without triggering a fetch that would normally happen if you\n attempted to use `record.get('relationship.id')`.\n Example\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default class BlogModel extends Model {\n @belongsTo({ async: true }) user;\n }\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n // get the identifier of the reference\n if (userRef.remoteType() === \"id\") {\n let id = userRef.id();\n }\n ```\n @method id\n @public\n @return {String} The id of the record in this belongsTo relationship.\n */\n id() {\n return this._relatedIdentifier?.id || null;\n }\n\n /**\n The link Ember Data will use to fetch or reload this belongs-to\n relationship. By default it uses only the \"related\" resource linkage.\n Example\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default Model.extend({\n user: belongsTo({ async: true })\n });\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n links: {\n related: '/articles/1/author'\n }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n // get the identifier of the reference\n if (userRef.remoteType() === \"link\") {\n let link = userRef.link();\n }\n ```\n @method link\n @public\n @return {String} The link Ember Data will use to fetch or reload this belongs-to relationship.\n */\n link() {\n let resource = this._resource();\n if (isResourceIdentiferWithRelatedLinks(resource)) {\n if (resource.links) {\n let related = resource.links.related;\n return !related || typeof related === 'string' ? related : related.href;\n }\n }\n return null;\n }\n\n /**\n * any links that have been received for this relationship\n *\n * @method links\n * @public\n * @returns\n */\n links() {\n let resource = this._resource();\n return resource && resource.links ? resource.links : null;\n }\n\n /**\n The meta data for the belongs-to relationship.\n Example\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default Model.extend({\n user: belongsTo({ async: true })\n });\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n links: {\n related: {\n href: '/articles/1/author'\n },\n },\n meta: {\n lastUpdated: 1458014400000\n }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n userRef.meta() // { lastUpdated: 1458014400000 }\n ```\n @method meta\n @public\n @return {Object} The meta information for the belongs-to relationship.\n */\n meta() {\n let meta = null;\n let resource = this._resource();\n if (resource && resource.meta && typeof resource.meta === 'object') {\n meta = resource.meta;\n }\n return meta;\n }\n _resource() {\n return this.store._instanceCache.recordDataFor(_classPrivateFieldLooseBase(this, _identifier)[_identifier], false).getBelongsTo(this.key);\n }\n\n /**\n This returns a string that represents how the reference will be\n looked up when it is loaded. If the relationship has a link it will\n use the \"link\" otherwise it defaults to \"id\".\n Example\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n export default class PostModel extends Model {\n @hasMany({ async: true }) comments;\n }\n ```\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n let commentsRef = post.hasMany('comments');\n // get the identifier of the reference\n if (commentsRef.remoteType() === \"ids\") {\n let ids = commentsRef.ids();\n } else if (commentsRef.remoteType() === \"link\") {\n let link = commentsRef.link();\n }\n ```\n @method remoteType\n @public\n @return {String} The name of the remote type. This should either be `link` or `id`\n */\n remoteType() {\n let value = this._resource();\n if (isResourceIdentiferWithRelatedLinks(value)) {\n return 'link';\n }\n return 'id';\n }\n\n /**\n `push` can be used to update the data in the relationship and Ember\n Data will treat the new data as the canonical value of this\n relationship on the backend.\n Example\n ```app/models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default class BlogModel extends Model {\n @belongsTo({ async: true }) user;\n }\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n // provide data for reference\n userRef.push({\n data: {\n type: 'user',\n id: 1,\n attributes: {\n username: \"@user\"\n }\n }\n }).then(function(user) {\n userRef.value() === user;\n });\n ```\n @method push\n @public\n @param {Object|Promise} objectOrPromise a promise that resolves to a JSONAPI document object describing the new value of this relationship.\n @return {Promise} A promise that resolves with the new value in this belongs-to relationship.\n */\n async push(data) {\n // TODO @deprecate pushing unresolved payloads\n const jsonApiDoc = await resolve(data);\n let record = this.store.push(jsonApiDoc);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n\n const {\n graph,\n identifier\n } = this.belongsToRelationship;\n this.store._backburner.join(() => {\n graph.push({\n op: 'replaceRelatedRecord',\n record: identifier,\n field: this.key,\n value: recordIdentifierFor(record)\n });\n });\n return record;\n }\n\n /**\n `value()` synchronously returns the current value of the belongs-to\n relationship. Unlike `record.get('relationshipName')`, calling\n `value()` on a reference does not trigger a fetch if the async\n relationship is not yet loaded. If the relationship is not loaded\n it will always return `null`.\n Example\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default class BlogModel extends Model {\n @belongsTo({ async: true }) user;\n }\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n userRef.value(); // null\n // provide data for reference\n userRef.push({\n data: {\n type: 'user',\n id: 1,\n attributes: {\n username: \"@user\"\n }\n }\n }).then(function(user) {\n userRef.value(); // user\n });\n ```\n @method value\n @public\n @return {Model} the record in this relationship\n */\n value() {\n let resource = this._resource();\n return resource && resource.data ? this.store.peekRecord(resource.data) : null;\n }\n\n /**\n Loads a record in a belongs-to relationship if it is not already\n loaded. If the relationship is already loaded this method does not\n trigger a new load.\n Example\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default class BlogModel extends Model {\n @belongsTo({ async: true }) user;\n }\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n userRef.value(); // null\n userRef.load().then(function(user) {\n userRef.value() === user\n });\n ```\n You may also pass in an options object whose properties will be\n fed forward. This enables you to pass `adapterOptions` into the\n request given to the adapter via the reference.\n Example\n ```javascript\n userRef.load({ adapterOptions: { isPrivate: true } }).then(function(user) {\n userRef.value() === user;\n });\n ```\n ```app/adapters/user.js\n import Adapter from '@ember-data/adapter';\n export default class UserAdapter extends Adapter {\n findRecord(store, type, id, snapshot) {\n // In the adapter you will have access to adapterOptions.\n let adapterOptions = snapshot.adapterOptions;\n }\n });\n ```\n @method load\n @public\n @param {Object} options the options to pass in.\n @return {Promise} a promise that resolves with the record in this belongs-to relationship.\n */\n load(options) {\n const support = LEGACY_SUPPORT.getWithError(_classPrivateFieldLooseBase(this, _identifier)[_identifier]);\n return support.getBelongsTo(this.key, options);\n }\n\n /**\n Triggers a reload of the value in this relationship. If the\n remoteType is `\"link\"` Ember Data will use the relationship link to\n reload the relationship. Otherwise it will reload the record by its\n id.\n Example\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default class BlogModel extends Model {\n @belongsTo({ async: true }) user;\n }\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n userRef.reload().then(function(user) {\n userRef.value() === user\n });\n ```\n You may also pass in an options object whose properties will be\n fed forward. This enables you to pass `adapterOptions` into the\n request given to the adapter via the reference. A full example\n can be found in the `load` method.\n Example\n ```javascript\n userRef.reload({ adapterOptions: { isPrivate: true } })\n ```\n @method reload\n @public\n @param {Object} options the options to pass in.\n @return {Promise} a promise that resolves with the record in this belongs-to relationship after the reload has completed.\n */\n reload(options) {\n const support = LEGACY_SUPPORT.getWithError(_classPrivateFieldLooseBase(this, _identifier)[_identifier]);\n return support.reloadBelongsTo(this.key, options).then(() => this.value());\n }\n}), _descriptor = _applyDecoratedDescriptor(_class.prototype, \"_ref\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return 0;\n }\n}), _applyDecoratedDescriptor(_class.prototype, \"_relatedIdentifier\", [cached, dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"_relatedIdentifier\"), _class.prototype), _class);\nexport { BelongsToReference as default };","import { createCache, getValue } from '@glimmer/tracking/primitives/cache';\nimport { assert } from '@ember/debug';\n\nexport function cached(...args) {\n const [target, key, descriptor] = args;\n\n // Error on `@cached()`, `@cached(...args)`, and `@cached propName = value;`\n assert(\n 'You attempted to use @cached(), which is not necessary nor supported. Remove the parentheses and you will be good to go!',\n target !== undefined\n );\n assert(\n `You attempted to use @cached on with ${\n args.length > 1 ? 'arguments' : 'an argument'\n } ( @cached(${args\n .map(d => `'${d}'`)\n .join(\n ', '\n )}), which is not supported. Dependencies are automatically tracked, so you can just use ${'`@cached`'}`,\n typeof target === 'object' &&\n typeof key === 'string' &&\n typeof descriptor === 'object' &&\n args.length === 3\n );\n assert(\n `The @cached decorator must be applied to getters. '${key}' is not a getter.`,\n typeof descriptor.get == 'function'\n );\n\n const caches = new WeakMap();\n const getter = descriptor.get;\n descriptor.get = function () {\n if (!caches.has(this)) caches.set(this, createCache(getter.bind(this)));\n return getValue(caches.get(this));\n };\n}\n","var _class, _descriptor, _token, _identifier, _relatedTokenMap;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classPrivateFieldLooseBase(e, t) { if (!{}.hasOwnProperty.call(e, t)) throw new TypeError(\"attempted to use private field on non-instance\"); return e; }\nvar id = 0;\nfunction _classPrivateFieldLooseKey(e) { return \"__private_\" + id++ + \"_\" + e; }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { DEBUG } from '@glimmer/env';\nimport { tracked } from '@glimmer/tracking';\nimport { cached } from \"ember-cached-decorator-polyfill\";\nimport { resolve } from 'rsvp';\nimport { recordIdentifierFor } from '@ember-data/store';\nimport { LEGACY_SUPPORT } from '../model';\n\n/**\n @module @ember-data/model\n*/\n\nfunction isResourceIdentiferWithRelatedLinks(value) {\n return Boolean(value && value.links && value.links.related);\n}\n/**\n A `HasManyReference` is a low-level API that allows users and addon\n authors to perform meta-operations on a has-many relationship.\n\n @class HasManyReference\n @public\n @extends Reference\n */\nlet HasManyReference = (_class = (_token = /*#__PURE__*/_classPrivateFieldLooseKey(\"token\"), _identifier = /*#__PURE__*/_classPrivateFieldLooseKey(\"identifier\"), _relatedTokenMap = /*#__PURE__*/_classPrivateFieldLooseKey(\"relatedTokenMap\"), class HasManyReference {\n constructor(store, parentIdentifier, hasManyRelationship, key) {\n // unsubscribe tokens given to us by the notification manager\n Object.defineProperty(this, _token, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _identifier, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _relatedTokenMap, {\n writable: true,\n value: void 0\n });\n _initializerDefineProperty(this, \"_ref\", _descriptor, this);\n this.key = key;\n this.hasManyRelationship = hasManyRelationship;\n this.type = hasManyRelationship.definition.type;\n this.store = store;\n _classPrivateFieldLooseBase(this, _identifier)[_identifier] = parentIdentifier;\n _classPrivateFieldLooseBase(this, _token)[_token] = store._notificationManager.subscribe(parentIdentifier, (_, bucket, notifiedKey) => {\n if ((bucket === 'relationships' || bucket === 'property') && notifiedKey === key) {\n this._ref++;\n }\n });\n _classPrivateFieldLooseBase(this, _relatedTokenMap)[_relatedTokenMap] = new Map();\n // TODO inverse\n }\n destroy() {\n this.store._notificationManager.unsubscribe(_classPrivateFieldLooseBase(this, _token)[_token]);\n _classPrivateFieldLooseBase(this, _relatedTokenMap)[_relatedTokenMap].forEach(token => {\n this.store._notificationManager.unsubscribe(token);\n });\n _classPrivateFieldLooseBase(this, _relatedTokenMap)[_relatedTokenMap].clear();\n }\n get _relatedIdentifiers() {\n this._ref; // consume the tracked prop\n\n let resource = this._resource();\n let map = _classPrivateFieldLooseBase(this, _relatedTokenMap)[_relatedTokenMap];\n _classPrivateFieldLooseBase(this, _relatedTokenMap)[_relatedTokenMap] = new Map();\n if (resource && resource.data) {\n return resource.data.map(resourceIdentifier => {\n const identifier = this.store.identifierCache.getOrCreateRecordIdentifier(resourceIdentifier);\n let token = map.get(identifier);\n if (token) {\n map.delete(identifier);\n } else {\n token = this.store._notificationManager.subscribe(identifier, (_, bucket, notifiedKey) => {\n if (bucket === 'identity' || bucket === 'attributes' && notifiedKey === 'id') {\n this._ref++;\n }\n });\n }\n _classPrivateFieldLooseBase(this, _relatedTokenMap)[_relatedTokenMap].set(identifier, token);\n return identifier;\n });\n }\n map.forEach(token => {\n this.store._notificationManager.unsubscribe(token);\n });\n map.clear();\n return [];\n }\n _resource() {\n return this.store._instanceCache.recordDataFor(_classPrivateFieldLooseBase(this, _identifier)[_identifier], false).getHasMany(this.key);\n }\n\n /**\n This returns a string that represents how the reference will be\n looked up when it is loaded. If the relationship has a link it will\n use the \"link\" otherwise it defaults to \"id\".\n Example\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n export default class PostModel extends Model {\n @hasMany({ async: true }) comments;\n }\n ```\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n let commentsRef = post.hasMany('comments');\n // get the identifier of the reference\n if (commentsRef.remoteType() === \"ids\") {\n let ids = commentsRef.ids();\n } else if (commentsRef.remoteType() === \"link\") {\n let link = commentsRef.link();\n }\n ```\n @method remoteType\n @public\n @return {String} The name of the remote type. This should either be `link` or `ids`\n */\n remoteType() {\n let value = this._resource();\n if (value && value.links && value.links.related) {\n return 'link';\n }\n return 'ids';\n }\n\n /**\n `ids()` returns an array of the record IDs in this relationship.\n Example\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n export default class PostModel extends Model {\n @hasMany({ async: true }) comments;\n }\n ```\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n let commentsRef = post.hasMany('comments');\n commentsRef.ids(); // ['1']\n ```\n @method ids\n @public\n @return {Array} The ids in this has-many relationship\n */\n ids() {\n return this._relatedIdentifiers.map(identifier => identifier.id);\n }\n\n /**\n The link Ember Data will use to fetch or reload this belongs-to\n relationship. By default it uses only the \"related\" resource linkage.\n Example\n ```javascript\n // models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default Model.extend({\n user: belongsTo({ async: true })\n });\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n links: {\n related: '/articles/1/author'\n }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n // get the identifier of the reference\n if (userRef.remoteType() === \"link\") {\n let link = userRef.link();\n }\n ```\n @method link\n @public\n @return {String} The link Ember Data will use to fetch or reload this belongs-to relationship.\n */\n link() {\n let resource = this._resource();\n if (isResourceIdentiferWithRelatedLinks(resource)) {\n if (resource.links) {\n let related = resource.links.related;\n return !related || typeof related === 'string' ? related : related.href;\n }\n }\n return null;\n }\n\n /**\n * any links that have been received for this relationship\n *\n * @method links\n * @public\n * @returns\n */\n links() {\n let resource = this._resource();\n return resource && resource.links ? resource.links : null;\n }\n\n /**\n The meta data for the has-many relationship.\n Example\n ```javascript\n // models/blog.js\n import Model, { hasMany } from '@ember-data/model';\n export default Model.extend({\n users: hasMany({ async: true })\n });\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n users: {\n links: {\n related: {\n href: '/articles/1/authors'\n },\n },\n meta: {\n lastUpdated: 1458014400000\n }\n }\n }\n }\n });\n let usersRef = blog.hasMany('user');\n usersRef.meta() // { lastUpdated: 1458014400000 }\n ```\n @method meta\n @public\n @return {Object} The meta information for the belongs-to relationship.\n */\n meta() {\n let meta = null;\n let resource = this._resource();\n if (resource && resource.meta && typeof resource.meta === 'object') {\n meta = resource.meta;\n }\n return meta;\n }\n\n /**\n `push` can be used to update the data in the relationship and Ember\n Data will treat the new data as the canonical value of this\n relationship on the backend.\n Example\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n export default class PostModel extends Model {\n @hasMany({ async: true }) comments;\n }\n ```\n ```\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n let commentsRef = post.hasMany('comments');\n commentsRef.ids(); // ['1']\n commentsRef.push([\n [{ type: 'comment', id: 2 }],\n [{ type: 'comment', id: 3 }],\n ])\n commentsRef.ids(); // ['2', '3']\n ```\n @method push\n @public\n @param {Array|Promise} objectOrPromise a promise that resolves to a JSONAPI document object describing the new value of this relationship.\n @return {ManyArray}\n */\n async push(objectOrPromise) {\n const payload = await resolve(objectOrPromise);\n let array;\n if (!Array.isArray(payload) && typeof payload === 'object' && Array.isArray(payload.data)) {\n array = payload.data;\n } else {\n array = payload;\n }\n const {\n store\n } = this;\n let identifiers = array.map(obj => {\n let record;\n if ('data' in obj) {\n // TODO deprecate pushing non-valid JSON:API here\n record = store.push(obj);\n } else {\n record = store.push({\n data: obj\n });\n }\n if (DEBUG) {\n let relationshipMeta = this.hasManyRelationship.definition;\n let identifier = this.hasManyRelationship.identifier;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n }\n return recordIdentifierFor(record);\n });\n const {\n graph,\n identifier\n } = this.hasManyRelationship;\n store._backburner.join(() => {\n graph.push({\n op: 'replaceRelatedRecords',\n record: identifier,\n field: this.key,\n value: identifiers\n });\n });\n return this.load();\n }\n _isLoaded() {\n let hasRelationshipDataProperty = this.hasManyRelationship.state.hasReceivedData;\n if (!hasRelationshipDataProperty) {\n return false;\n }\n let members = this.hasManyRelationship.currentState;\n\n //TODO @runspired determine isLoaded via a better means\n return members.every(identifier => {\n let internalModel = this.store._instanceCache._internalModelForResource(identifier);\n return internalModel.isLoaded === true;\n });\n }\n\n /**\n `value()` synchronously returns the current value of the has-many\n relationship. Unlike `record.get('relationshipName')`, calling\n `value()` on a reference does not trigger a fetch if the async\n relationship is not yet loaded. If the relationship is not loaded\n it will always return `null`.\n Example\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n export default class PostModel extends Model {\n @hasMany({ async: true }) comments;\n }\n ```\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n let commentsRef = post.hasMany('comments');\n post.get('comments').then(function(comments) {\n commentsRef.value() === comments\n })\n ```\n @method value\n @public\n @return {ManyArray}\n */\n value() {\n const support = LEGACY_SUPPORT.getWithError(_classPrivateFieldLooseBase(this, _identifier)[_identifier]);\n return this._isLoaded() ? support.getManyArray(this.key) : null;\n }\n\n /**\n Loads the relationship if it is not already loaded. If the\n relationship is already loaded this method does not trigger a new\n load. This causes a request to the specified\n relationship link or reloads all items currently in the relationship.\n Example\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n export default class PostModel extends Model {\n @hasMany({ async: true }) comments;\n }\n ```\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n let commentsRef = post.hasMany('comments');\n commentsRef.load().then(function(comments) {\n //...\n });\n ```\n You may also pass in an options object whose properties will be\n fed forward. This enables you to pass `adapterOptions` into the\n request given to the adapter via the reference.\n Example\n ```javascript\n commentsRef.load({ adapterOptions: { isPrivate: true } })\n .then(function(comments) {\n //...\n });\n ```\n ```app/adapters/comment.js\n export default ApplicationAdapter.extend({\n findMany(store, type, id, snapshots) {\n // In the adapter you will have access to adapterOptions.\n let adapterOptions = snapshots[0].adapterOptions;\n }\n });\n ```\n @method load\n @public\n @param {Object} options the options to pass in.\n @return {Promise} a promise that resolves with the ManyArray in\n this has-many relationship.\n */\n async load(options) {\n const support = LEGACY_SUPPORT.getWithError(_classPrivateFieldLooseBase(this, _identifier)[_identifier]);\n return support.getHasMany(this.key, options); // this cast is necessary because typescript does not work properly with custom thenables;\n }\n\n /**\n Reloads this has-many relationship. This causes a request to the specified\n relationship link or reloads all items currently in the relationship.\n Example\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n export default class PostModel extends Model {\n @hasMany({ async: true }) comments;\n }\n ```\n ```javascript\n let post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n });\n let commentsRef = post.hasMany('comments');\n commentsRef.reload().then(function(comments) {\n //...\n });\n ```\n You may also pass in an options object whose properties will be\n fed forward. This enables you to pass `adapterOptions` into the\n request given to the adapter via the reference. A full example\n can be found in the `load` method.\n Example\n ```javascript\n commentsRef.reload({ adapterOptions: { isPrivate: true } })\n ```\n @method reload\n @public\n @param {Object} options the options to pass in.\n @return {Promise} a promise that resolves with the ManyArray in this has-many relationship.\n */\n reload(options) {\n const support = LEGACY_SUPPORT.getWithError(_classPrivateFieldLooseBase(this, _identifier)[_identifier]);\n return support.reloadHasMany(this.key, options);\n }\n}), _descriptor = _applyDecoratedDescriptor(_class.prototype, \"_ref\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return 0;\n }\n}), _applyDecoratedDescriptor(_class.prototype, \"_relatedIdentifiers\", [cached, dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"_relatedIdentifiers\"), _class.prototype), _class);\nexport { HasManyReference as default };","import { A, default as EmberArray } from '@ember/array';\nimport { assert } from '@ember/debug';\nimport { DEBUG } from '@glimmer/env';\nimport { importSync } from '@embroider/macros';\nimport { all, resolve } from 'rsvp';\nimport { recordDataFor, recordIdentifierFor, storeFor } from '@ember-data/store/-private';\nimport { _findBelongsTo, _findHasMany } from './legacy-data-fetch';\nimport { assertIdentifierHasId } from './legacy-data-utils';\nimport ManyArray from './many-array';\nimport PromiseBelongsTo from './promise-belongs-to';\nimport PromiseManyArray from './promise-many-array';\nimport BelongsToReference from './references/belongs-to';\nimport HasManyReference from './references/has-many';\nexport class LegacySupport {\n constructor(record) {\n this.record = record;\n this.store = storeFor(record);\n this.identifier = recordIdentifierFor(record);\n this.recordData = this.store._instanceCache.getRecordData(this.identifier);\n this._manyArrayCache = Object.create(null);\n this._relationshipPromisesCache = Object.create(null);\n this._relationshipProxyCache = Object.create(null);\n this.references = Object.create(null);\n }\n _findBelongsTo(key, resource, relationshipMeta, options) {\n // TODO @runspired follow up if parent isNew then we should not be attempting load here\n // TODO @runspired follow up on whether this should be in the relationship requests cache\n return this._findBelongsToByJsonApiResource(resource, this.identifier, relationshipMeta, options).then(identifier => handleCompletedRelationshipRequest(this, key, resource._relationship, identifier), e => handleCompletedRelationshipRequest(this, key, resource._relationship, null, e));\n }\n reloadBelongsTo(key, options) {\n let loadingPromise = this._relationshipPromisesCache[key];\n if (loadingPromise) {\n return loadingPromise;\n }\n let resource = this.recordData.getBelongsTo(key);\n // TODO move this to a public api\n if (resource._relationship) {\n resource._relationship.state.hasFailedLoadAttempt = false;\n resource._relationship.state.shouldForceReload = true;\n }\n let relationshipMeta = this.store.getSchemaDefinitionService().relationshipsDefinitionFor(this.identifier)[key];\n assert(`Attempted to reload a belongsTo relationship but no definition exists for it`, relationshipMeta);\n let promise = this._findBelongsTo(key, resource, relationshipMeta, options);\n if (this._relationshipProxyCache[key]) {\n return this._updatePromiseProxyFor('belongsTo', key, {\n promise\n });\n }\n return promise;\n }\n getBelongsTo(key, options) {\n const {\n identifier,\n recordData\n } = this;\n let resource = recordData.getBelongsTo(key);\n let relatedIdentifier = resource && resource.data ? this.store.identifierCache.getOrCreateRecordIdentifier(resource.data) : null;\n let relationshipMeta = this.store.getSchemaDefinitionService().relationshipsDefinitionFor(identifier)[key];\n assert(`Attempted to access a belongsTo relationship but no definition exists for it`, relationshipMeta);\n let store = this.store;\n let async = relationshipMeta.options.async;\n let isAsync = typeof async === 'undefined' ? true : async;\n let _belongsToState = {\n key,\n store,\n legacySupport: this,\n modelName: relationshipMeta.type\n };\n if (isAsync) {\n if (resource._relationship.state.hasFailedLoadAttempt) {\n return this._relationshipProxyCache[key];\n }\n let promise = this._findBelongsTo(key, resource, relationshipMeta, options);\n return this._updatePromiseProxyFor('belongsTo', key, {\n promise,\n content: relatedIdentifier ? store._instanceCache.getRecord(relatedIdentifier) : null,\n _belongsToState\n });\n } else {\n if (relatedIdentifier === null) {\n return null;\n } else {\n let toReturn = store._instanceCache.getRecord(relatedIdentifier);\n assert(`You looked up the '${key}' relationship on a '${identifier.type}' with id ${identifier.id || 'null'} but some of the associated records were not loaded. Either make sure they are all loaded together with the parent record, or specify that the relationship is async (\\`belongsTo({ async: true })\\`)`, toReturn === null || !store._instanceCache.getInternalModel(relatedIdentifier).isEmpty);\n return toReturn;\n }\n }\n }\n setDirtyBelongsTo(key, value) {\n return this.recordData.setDirtyBelongsTo(key, extractRecordDataFromRecord(value));\n }\n getManyArray(key, definition) {\n assert('hasMany only works with the @ember-data/record-data package', true /* HAS_RECORD_DATA_PACKAGE */);\n let manyArray = this._manyArrayCache[key];\n if (!definition) {\n const graphFor = importSync('@ember-data/record-data/-private').graphFor;\n definition = graphFor(this.store).get(this.identifier, key).definition;\n }\n if (!manyArray) {\n manyArray = ManyArray.create({\n store: this.store,\n type: this.store.modelFor(definition.type),\n recordData: this.recordData,\n key,\n isPolymorphic: definition.isPolymorphic,\n isAsync: definition.isAsync,\n _inverseIsAsync: definition.inverseIsAsync,\n legacySupport: this,\n isLoaded: !definition.isAsync\n });\n this._manyArrayCache[key] = manyArray;\n }\n return manyArray;\n }\n fetchAsyncHasMany(key, relationship, manyArray, options) {\n if (true /* HAS_RECORD_DATA_PACKAGE */) {\n let loadingPromise = this._relationshipPromisesCache[key];\n if (loadingPromise) {\n return loadingPromise;\n }\n const jsonApi = this.recordData.getHasMany(key);\n loadingPromise = this._findHasManyByJsonApiResource(jsonApi, this.identifier, relationship, options).then(() => handleCompletedRelationshipRequest(this, key, relationship, manyArray), e => handleCompletedRelationshipRequest(this, key, relationship, manyArray, e));\n this._relationshipPromisesCache[key] = loadingPromise;\n return loadingPromise;\n }\n assert('hasMany only works with the @ember-data/record-data package');\n }\n reloadHasMany(key, options) {\n if (true /* HAS_RECORD_DATA_PACKAGE */) {\n let loadingPromise = this._relationshipPromisesCache[key];\n if (loadingPromise) {\n return loadingPromise;\n }\n const graphFor = importSync('@ember-data/record-data/-private').graphFor;\n const relationship = graphFor(this.store).get(this.identifier, key);\n const {\n definition,\n state\n } = relationship;\n state.hasFailedLoadAttempt = false;\n state.shouldForceReload = true;\n let manyArray = this.getManyArray(key, definition);\n let promise = this.fetchAsyncHasMany(key, relationship, manyArray, options);\n if (this._relationshipProxyCache[key]) {\n return this._updatePromiseProxyFor('hasMany', key, {\n promise\n });\n }\n return promise;\n }\n assert(`hasMany only works with the @ember-data/record-data package`);\n }\n getHasMany(key, options) {\n if (true /* HAS_RECORD_DATA_PACKAGE */) {\n const graphFor = importSync('@ember-data/record-data/-private').graphFor;\n const relationship = graphFor(this.store).get(this.identifier, key);\n const {\n definition,\n state\n } = relationship;\n let manyArray = this.getManyArray(key, definition);\n if (definition.isAsync) {\n if (state.hasFailedLoadAttempt) {\n return this._relationshipProxyCache[key];\n }\n let promise = this.fetchAsyncHasMany(key, relationship, manyArray, options);\n return this._updatePromiseProxyFor('hasMany', key, {\n promise,\n content: manyArray\n });\n } else {\n assert(`You looked up the '${key}' relationship on a '${this.identifier.type}' with id ${this.identifier.id || 'null'} but some of the associated records were not loaded. Either make sure they are all loaded together with the parent record, or specify that the relationship is async ('hasMany({ async: true })')`, !anyUnloaded(this.store, relationship));\n return manyArray;\n }\n }\n assert(`hasMany only works with the @ember-data/record-data package`);\n }\n setDirtyHasMany(key, records) {\n assertRecordsPassedToHasMany(records);\n return this.recordData.setDirtyHasMany(key, extractRecordDatasFromRecords(records));\n }\n _updatePromiseProxyFor(kind, key, args) {\n let promiseProxy = this._relationshipProxyCache[key];\n if (kind === 'hasMany') {\n const {\n promise,\n content\n } = args;\n if (promiseProxy) {\n assert(`Expected a PromiseManyArray`, '_update' in promiseProxy);\n promiseProxy._update(promise, content);\n } else {\n promiseProxy = this._relationshipProxyCache[key] = new PromiseManyArray(promise, content);\n }\n return promiseProxy;\n }\n if (promiseProxy) {\n const {\n promise,\n content\n } = args;\n assert(`Expected a PromiseBelongsTo`, '_belongsToState' in promiseProxy);\n if (content !== undefined) {\n promiseProxy.set('content', content);\n }\n void promiseProxy.set('promise', promise);\n } else {\n promiseProxy = PromiseBelongsTo.create(args);\n this._relationshipProxyCache[key] = promiseProxy;\n }\n return promiseProxy;\n }\n referenceFor(kind, name) {\n let reference = this.references[name];\n if (!reference) {\n if (!true /* HAS_RECORD_DATA_PACKAGE */) {\n // TODO @runspired while this feels odd, it is not a regression in capability because we do\n // not today support references pulling from RecordDatas other than our own\n // because of the intimate API access involved. This is something we will need to redesign.\n assert(`snapshot.belongsTo only supported for @ember-data/record-data`);\n }\n const graphFor = importSync('@ember-data/record-data/-private').graphFor;\n const relationship = graphFor(this.store).get(this.identifier, name);\n if (DEBUG && kind) {\n let modelName = this.identifier.type;\n let actualRelationshipKind = relationship.definition.kind;\n assert(`You tried to get the '${name}' relationship on a '${modelName}' via record.${kind}('${name}'), but the relationship is of kind '${actualRelationshipKind}'. Use record.${actualRelationshipKind}('${name}') instead.`, actualRelationshipKind === kind);\n }\n let relationshipKind = relationship.definition.kind;\n if (relationshipKind === 'belongsTo') {\n reference = new BelongsToReference(this.store, this.identifier, relationship, name);\n } else if (relationshipKind === 'hasMany') {\n reference = new HasManyReference(this.store, this.identifier, relationship, name);\n }\n this.references[name] = reference;\n }\n return reference;\n }\n _findHasManyByJsonApiResource(resource, parentIdentifier, relationship, options = {}) {\n if (true /* HAS_RECORD_DATA_PACKAGE */) {\n if (!resource) {\n return resolve();\n }\n const {\n definition,\n state\n } = relationship;\n let adapter = this.store.adapterFor(definition.type);\n let {\n isStale,\n hasDematerializedInverse,\n hasReceivedData,\n isEmpty,\n shouldForceReload\n } = state;\n const allInverseRecordsAreLoaded = areAllInverseRecordsLoaded(this.store, resource);\n let shouldFindViaLink = resource.links && resource.links.related && (typeof adapter.findHasMany === 'function' || typeof resource.data === 'undefined') && (shouldForceReload || hasDematerializedInverse || isStale || !allInverseRecordsAreLoaded && !isEmpty);\n\n // fetch via link\n if (shouldFindViaLink) {\n // findHasMany, although not public, does not need to care about our upgrade relationship definitions\n // and can stick with the public definition API for now.\n const relationshipMeta = this.store._instanceCache._storeWrapper.relationshipsDefinitionFor(definition.inverseType)[definition.key];\n let adapter = this.store.adapterFor(parentIdentifier.type);\n\n /*\n If a relationship was originally populated by the adapter as a link\n (as opposed to a list of IDs), this method is called when the\n relationship is fetched.\n The link (which is usually a URL) is passed through unchanged, so the\n adapter can make whatever request it wants.\n The usual use-case is for the server to register a URL as a link, and\n then use that URL in the future to make a request for the relationship.\n */\n assert(`You tried to load a hasMany relationship but you have no adapter (for ${parentIdentifier.type})`, adapter);\n assert(`You tried to load a hasMany relationship from a specified 'link' in the original payload but your adapter does not implement 'findHasMany'`, typeof adapter.findHasMany === 'function');\n return _findHasMany(adapter, this.store, parentIdentifier, resource.links.related, relationshipMeta, options);\n }\n let preferLocalCache = hasReceivedData && !isEmpty;\n let hasLocalPartialData = hasDematerializedInverse || isEmpty && Array.isArray(resource.data) && resource.data.length > 0;\n\n // fetch using data, pulling from local cache if possible\n if (!shouldForceReload && !isStale && (preferLocalCache || hasLocalPartialData)) {\n let finds = new Array(resource.data.length);\n for (let i = 0; i < resource.data.length; i++) {\n let identifier = this.store.identifierCache.getOrCreateRecordIdentifier(resource.data[i]);\n finds[i] = this.store._instanceCache._fetchDataIfNeededForIdentifier(identifier, options);\n }\n return all(finds);\n }\n let hasData = hasReceivedData && !isEmpty;\n\n // fetch by data\n if (hasData || hasLocalPartialData) {\n let identifiers = resource.data.map(json => this.store.identifierCache.getOrCreateRecordIdentifier(json));\n let fetches = new Array(identifiers.length);\n const manager = this.store._fetchManager;\n for (let i = 0; i < identifiers.length; i++) {\n let identifier = identifiers[i];\n assertIdentifierHasId(identifier);\n fetches[i] = manager.scheduleFetch(identifier, options);\n }\n return all(fetches);\n }\n\n // we were explicitly told we have no data and no links.\n // TODO if the relationshipIsStale, should we hit the adapter anyway?\n return resolve();\n }\n assert(`hasMany only works with the @ember-data/record-data package`);\n }\n _findBelongsToByJsonApiResource(resource, parentIdentifier, relationshipMeta, options = {}) {\n if (!resource) {\n return resolve(null);\n }\n const internalModel = resource.data ? this.store._instanceCache._internalModelForResource(resource.data) : null;\n let {\n isStale,\n hasDematerializedInverse,\n hasReceivedData,\n isEmpty,\n shouldForceReload\n } = resource._relationship.state;\n const allInverseRecordsAreLoaded = areAllInverseRecordsLoaded(this.store, resource);\n let shouldFindViaLink = resource.links && resource.links.related && (shouldForceReload || hasDematerializedInverse || isStale || !allInverseRecordsAreLoaded && !isEmpty);\n if (internalModel) {\n // short circuit if we are already loading\n let pendingRequest = this.store._fetchManager.getPendingFetch(internalModel.identifier, options);\n if (pendingRequest) {\n return pendingRequest;\n }\n }\n\n // fetch via link\n if (shouldFindViaLink) {\n return _findBelongsTo(this.store, parentIdentifier, resource.links.related, relationshipMeta, options);\n }\n let preferLocalCache = hasReceivedData && allInverseRecordsAreLoaded && !isEmpty;\n let hasLocalPartialData = hasDematerializedInverse || isEmpty && resource.data;\n // null is explicit empty, undefined is \"we don't know anything\"\n let localDataIsEmpty = resource.data === undefined || resource.data === null;\n\n // fetch using data, pulling from local cache if possible\n if (!shouldForceReload && !isStale && (preferLocalCache || hasLocalPartialData)) {\n /*\n We have canonical data, but our local state is empty\n */\n if (localDataIsEmpty) {\n return resolve(null);\n }\n if (!internalModel) {\n assert(`No InternalModel found for ${resource.lid}`, internalModel);\n }\n return this.store._instanceCache._fetchDataIfNeededForIdentifier(internalModel.identifier, options);\n }\n let resourceIsLocal = !localDataIsEmpty && resource.data.id === null;\n if (internalModel && resourceIsLocal) {\n return resolve(internalModel.identifier);\n }\n\n // fetch by data\n if (internalModel && !localDataIsEmpty) {\n let identifier = internalModel.identifier;\n assertIdentifierHasId(identifier);\n return this.store._fetchManager.scheduleFetch(identifier, options);\n }\n\n // we were explicitly told we have no data and no links.\n // TODO if the relationshipIsStale, should we hit the adapter anyway?\n return resolve(null);\n }\n destroy() {\n assert('Cannot destroy an internalModel while its record is materialized', !this.record || this.record.isDestroyed || this.record.isDestroying);\n this.isDestroying = true;\n const cache = this._manyArrayCache;\n Object.keys(cache).forEach(key => {\n cache[key].destroy();\n delete cache[key];\n });\n const keys = Object.keys(this._relationshipProxyCache);\n keys.forEach(key => {\n const proxy = this._relationshipProxyCache[key];\n if (proxy.destroy) {\n proxy.destroy();\n }\n delete this._relationshipProxyCache[key];\n });\n if (this.references) {\n const refs = this.references;\n Object.keys(refs).forEach(key => {\n refs[key].destroy();\n delete refs[key];\n });\n }\n this.isDestroyed = true;\n }\n}\nfunction handleCompletedRelationshipRequest(recordExt, key, relationship, value, error) {\n delete recordExt._relationshipPromisesCache[key];\n relationship.state.shouldForceReload = false;\n const isHasMany = relationship.definition.kind === 'hasMany';\n if (isHasMany) {\n // we don't notify the record property here to avoid refetch\n // only the many array\n value.notify();\n }\n if (error) {\n relationship.state.hasFailedLoadAttempt = true;\n let proxy = recordExt._relationshipProxyCache[key];\n // belongsTo relationships are sometimes unloaded\n // when a load fails, in this case we need\n // to make sure that we aren't proxying\n // to destroyed content\n // for the sync belongsTo reload case there will be no proxy\n // for the async reload case there will be no proxy if the ui\n // has never been accessed\n if (proxy && !isHasMany) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (proxy.content && proxy.content.isDestroying) {\n proxy.set('content', null);\n }\n }\n throw error;\n }\n if (isHasMany) {\n value.set('isLoaded', true);\n }\n relationship.state.hasFailedLoadAttempt = false;\n // only set to not stale if no error is thrown\n relationship.state.isStale = false;\n return isHasMany || !value ? value : recordExt.store.peekRecord(value);\n}\nfunction assertRecordsPassedToHasMany(records) {\n assert(`You must pass an array of records to set a hasMany relationship`, Array.isArray(records) || EmberArray.detect(records));\n assert(`All elements of a hasMany relationship must be instances of Model, you passed ${records.map(r => `${typeof r}`).join(', ')}`, function () {\n return A(records).every(record => Object.prototype.hasOwnProperty.call(record, '_internalModel') === true);\n }());\n}\nfunction extractRecordDatasFromRecords(records) {\n return records.map(extractRecordDataFromRecord);\n}\nfunction extractRecordDataFromRecord(recordOrPromiseRecord) {\n if (!recordOrPromiseRecord) {\n return null;\n }\n if (isPromiseRecord(recordOrPromiseRecord)) {\n let content = recordOrPromiseRecord.get && recordOrPromiseRecord.get('content');\n assert('You passed in a promise that did not originate from an EmberData relationship. You can only pass promises that come from a belongsTo or hasMany relationship to the get call.', content !== undefined);\n return content ? recordDataFor(content) : null;\n }\n return recordDataFor(recordOrPromiseRecord);\n}\nfunction isPromiseRecord(record) {\n return !!record.then;\n}\nfunction anyUnloaded(store, relationship) {\n let state = relationship.currentState;\n const unloaded = state.find(s => {\n let im = store._instanceCache.getInternalModel(s);\n return im._isDematerializing || !im.isLoaded;\n });\n return unloaded || false;\n}\n\n/**\n * Flag indicating whether all inverse records are available\n *\n * true if the inverse exists and is loaded (not empty)\n * true if there is no inverse\n * false if the inverse exists and is not loaded (empty)\n *\n * @internal\n * @return {boolean}\n */\nfunction areAllInverseRecordsLoaded(store, resource) {\n const cache = store.identifierCache;\n if (Array.isArray(resource.data)) {\n // treat as collection\n // check for unloaded records\n let hasEmptyRecords = resource.data.reduce((hasEmptyModel, resourceIdentifier) => {\n return hasEmptyModel || internalModelForRelatedResource(store, cache, resourceIdentifier).isEmpty;\n }, false);\n return !hasEmptyRecords;\n } else {\n // treat as single resource\n if (!resource.data) {\n return true;\n } else {\n const internalModel = internalModelForRelatedResource(store, cache, resource.data);\n return !internalModel.isEmpty;\n }\n }\n}\nfunction internalModelForRelatedResource(store, cache, resource) {\n const identifier = cache.getOrCreateRecordIdentifier(resource);\n return store._instanceCache._internalModelForResource(identifier);\n}","var _class, _descriptor, _class2, _descriptor2;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport { assert } from '@ember/debug';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { DEBUG } from '@glimmer/env';\nimport { tracked } from '@glimmer/tracking';\nimport { cached } from \"ember-cached-decorator-polyfill\";\nimport { storeFor } from '@ember-data/store';\nimport { errorsArrayToHash, recordIdentifierFor } from '@ember-data/store/-private';\nfunction isInvalidError(error) {\n return error && error.isAdapterError === true && error.code === 'InvalidError';\n}\n\n/**\n * Tag provides a cache for a getter\n * that recomputes only when a specific\n * tracked property that it manages is dirtied.\n *\n * This allows us to bust the cache for a value\n * that otherwise doesn't access anything tracked\n * as well as control the timing of that notification.\n *\n * @internal\n */\nlet Tag = (_class = class Tag {\n constructor() {\n _initializerDefineProperty(this, \"_tracking\", _descriptor, this);\n this.rev = 1;\n this.isDirty = true;\n this.value = undefined;\n }\n subscribe() {\n this._tracking;\n }\n notify() {\n this.isDirty = true;\n this._tracking = this.rev;\n this.rev++;\n }\n consume(v) {\n this.isDirty = false;\n this.value = v; // set cached value\n }\n}, _descriptor = _applyDecoratedDescriptor(_class.prototype, \"_tracking\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return 0;\n }\n}), _class);\nconst Tags = new WeakMap();\nfunction getTag(record, key) {\n let tags = Tags.get(record);\n if (!tags) {\n tags = Object.create(null);\n Tags.set(record, tags);\n }\n return tags[key] = tags[key] || new Tag();\n}\nexport function peekTag(record, key) {\n let tags = Tags.get(record);\n return tags && tags[key];\n}\n\n/**\n * A decorattor that caches a getter while\n * providing the ability to bust that cache\n * when we so choose in a way that notifies\n * glimmer's tracking system.\n *\n * @internal\n */\nexport function tagged(_target, key, desc) {\n const getter = desc.get;\n const setter = desc.set;\n desc.get = function () {\n let tag = getTag(this, key);\n tag.subscribe();\n if (tag.isDirty) {\n tag.consume(getter.call(this));\n }\n return tag.value;\n };\n desc.set = function (v) {\n getTag(this, key); // ensure tag is setup in case we want to use it.\n // probably notify here but not yet.\n setter.call(this, v);\n };\n dependentKeyCompat(desc);\n return desc;\n}\n\n/**\nHistorically InternalModel managed a state machine\nthe currentState for which was reflected onto Model.\n\nThis implements the flags and stateName for backwards compat\nwith the state tree that used to be possible (listed below).\n\nstateName and dirtyType are candidates for deprecation.\n\nroot\n empty\n deleted // hidden from stateName\n preloaded // hidden from stateName\n\n loading\n empty // hidden from stateName\n preloaded // hidden from stateName\n\n loaded\n saved\n updated\n uncommitted\n invalid\n inFlight\n created\n uncommitted\n invalid\n inFlight\n\n deleted\n saved\n new // hidden from stateName\n uncommitted\n invalid\n inFlight\n\n @internal\n*/\nlet RecordState = (_class2 = class RecordState {\n constructor(record) {\n _initializerDefineProperty(this, \"isSaving\", _descriptor2, this);\n const store = storeFor(record);\n const identity = recordIdentifierFor(record);\n this.identifier = identity;\n this.record = record;\n this.recordData = store._instanceCache.getRecordData(identity);\n this.pendingCount = 0;\n this.fulfilledCount = 0;\n this.rejectedCount = 0;\n this._errorRequests = [];\n this._lastError = null;\n let requests = store.getRequestStateService();\n let notifications = store._notificationManager;\n const handleRequest = req => {\n if (req.type === 'mutation') {\n switch (req.state) {\n case 'pending':\n this.isSaving = true;\n break;\n case 'rejected':\n this.isSaving = false;\n this._lastError = req;\n if (!(req.response && isInvalidError(req.response.data))) {\n this._errorRequests.push(req);\n }\n notifyErrorsStateChanged(this);\n break;\n case 'fulfilled':\n this._errorRequests = [];\n this._lastError = null;\n this.isSaving = false;\n notifyErrorsStateChanged(this);\n break;\n }\n } else {\n switch (req.state) {\n case 'pending':\n this.pendingCount++;\n this.notify('isLoading');\n break;\n case 'rejected':\n this.pendingCount--;\n this._lastError = req;\n if (!(req.response && isInvalidError(req.response.data))) {\n this._errorRequests.push(req);\n }\n this.notify('isLoading');\n notifyErrorsStateChanged(this);\n break;\n case 'fulfilled':\n this.pendingCount--;\n this.fulfilledCount++;\n this.notify('isLoading');\n this.notify('isDirty');\n notifyErrorsStateChanged(this);\n this._errorRequests = [];\n this._lastError = null;\n break;\n }\n }\n };\n requests.subscribeForRecord(identity, handleRequest);\n\n // we instantiate lazily\n // so we grab anything we don't have yet\n if (!DEBUG) {\n const lastRequest = requests.getLastRequestForRecord(identity);\n if (lastRequest) {\n handleRequest(lastRequest);\n }\n }\n notifications.subscribe(identity, (identifier, type, key) => {\n switch (type) {\n case 'state':\n this.notify('isNew');\n this.notify('isDeleted');\n this.notify('isDirty');\n break;\n case 'attributes':\n this.notify('isEmpty');\n this.notify('isDirty');\n break;\n case 'unload':\n this.notify('isNew');\n this.notify('isDeleted');\n break;\n case 'errors':\n // we only hit this if a foreign RecordData notifies\n // errors changed. Our own implementation does not\n // take this path currently, but we should probably\n // fix that.\n this.updateInvalidErrors();\n this.notify('isValid');\n break;\n }\n });\n }\n notify(key) {\n getTag(this, key).notify();\n }\n updateInvalidErrors() {\n let jsonApiErrors = this.recordData.getErrors(this.identifier);\n const {\n errors\n } = this.record;\n errors.clear();\n let newErrors = errorsArrayToHash(jsonApiErrors);\n let errorKeys = Object.keys(newErrors);\n for (let i = 0; i < errorKeys.length; i++) {\n errors.add(errorKeys[i], newErrors[errorKeys[i]]);\n }\n }\n cleanErrorRequests() {\n this.notify('isValid');\n this.notify('isError');\n this.notify('adapterError');\n this._errorRequests = [];\n this._lastError = null;\n }\n get isLoading() {\n return !this.isLoaded && this.pendingCount > 0 && this.fulfilledCount === 0;\n }\n\n // TODO @runspired handle \"unloadRecord\" see note in InternalModel\n get isLoaded() {\n if (this.isNew) {\n return true;\n }\n return this.fulfilledCount > 0 || !this.isEmpty;\n }\n get isSaved() {\n let rd = this.recordData;\n if (this.isDeleted) {\n assert(`Expected RecordData to implement isDeletionCommitted()`, rd.isDeletionCommitted);\n return rd.isDeletionCommitted();\n }\n if (this.isNew || this.isEmpty || !this.isValid || this.isDirty || this.isLoading) {\n return false;\n }\n return true;\n }\n get isEmpty() {\n let rd = this.recordData;\n // TODO this is not actually an RFC'd concept. Determine the\n // correct heuristic to replace this with.\n assert(`Expected RecordData to implement isEmpty()`, rd.isEmpty);\n return !this.isNew && rd.isEmpty();\n }\n get isNew() {\n let rd = this.recordData;\n assert(`Expected RecordData to implement isNew()`, rd.isNew);\n return rd.isNew();\n }\n get isDeleted() {\n let rd = this.recordData;\n assert(`Expected RecordData to implement isDeleted()`, rd.isDeleted);\n return rd.isDeleted();\n }\n get isValid() {\n return this.record.errors.length === 0;\n }\n get isDirty() {\n let rd = this.recordData;\n assert(`Expected RecordData to implement hasChangedAttributes()`, rd.hasChangedAttributes);\n assert(`Expected RecordData to implement isDeletionCommitted()`, rd.isDeletionCommitted);\n if (rd.isDeletionCommitted() || this.isDeleted && this.isNew) {\n return false;\n }\n return this.isNew || rd.hasChangedAttributes();\n }\n get isError() {\n let errorReq = this._errorRequests[this._errorRequests.length - 1];\n if (!errorReq) {\n return false;\n } else {\n return true;\n }\n }\n get adapterError() {\n let request = this._lastError;\n if (!request) {\n return null;\n }\n return request.state === 'rejected' && request.response.data;\n }\n get isPreloaded() {\n return !this.isEmpty && this.isLoading;\n }\n get stateName() {\n // we might be empty while loading so check this first\n if (this.isLoading) {\n return 'root.loading';\n\n // got nothing yet or were unloaded\n } else if (this.isEmpty) {\n return 'root.empty';\n\n // deleted substates\n } else if (this.isDeleted) {\n if (this.isSaving) {\n return 'root.deleted.inFlight';\n } else if (this.isSaved) {\n // TODO ensure isSaved isn't true from previous requests\n return 'root.deleted.saved';\n } else if (!this.isValid) {\n return 'root.deleted.invalid';\n } else {\n return 'root.deleted.uncommitted';\n }\n\n // loaded.created substates\n } else if (this.isNew) {\n if (this.isSaving) {\n return 'root.loaded.created.inFlight';\n } else if (!this.isValid) {\n return 'root.loaded.created.invalid';\n }\n return 'root.loaded.created.uncommitted';\n\n // loaded.updated substates\n } else if (this.isSaving) {\n return 'root.loaded.updated.inFlight';\n } else if (!this.isValid) {\n return 'root.loaded.updated.invalid';\n } else if (this.isDirty) {\n return 'root.loaded.updated.uncommitted';\n\n // if nothing remains, we are loaded saved!\n } else {\n return 'root.loaded.saved';\n }\n }\n get dirtyType() {\n // we might be empty while loading so check this first\n if (this.isLoading || this.isEmpty) {\n return '';\n\n // deleted substates\n } else if (this.isDeleted) {\n return 'deleted';\n\n // loaded.created substates\n } else if (this.isNew) {\n return 'created';\n\n // loaded.updated substates\n } else if (this.isSaving || !this.isValid || this.isDirty) {\n return 'updated';\n\n // if nothing remains, we are loaded saved!\n } else {\n return '';\n }\n }\n}, _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"isSaving\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return false;\n }\n}), _applyDecoratedDescriptor(_class2.prototype, \"isLoading\", [tagged], Object.getOwnPropertyDescriptor(_class2.prototype, \"isLoading\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"isLoaded\", [tagged], Object.getOwnPropertyDescriptor(_class2.prototype, \"isLoaded\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"isSaved\", [tagged], Object.getOwnPropertyDescriptor(_class2.prototype, \"isSaved\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"isEmpty\", [tagged], Object.getOwnPropertyDescriptor(_class2.prototype, \"isEmpty\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"isNew\", [tagged], Object.getOwnPropertyDescriptor(_class2.prototype, \"isNew\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"isDeleted\", [tagged], Object.getOwnPropertyDescriptor(_class2.prototype, \"isDeleted\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"isValid\", [tagged], Object.getOwnPropertyDescriptor(_class2.prototype, \"isValid\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"isDirty\", [tagged], Object.getOwnPropertyDescriptor(_class2.prototype, \"isDirty\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"isError\", [tagged], Object.getOwnPropertyDescriptor(_class2.prototype, \"isError\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"adapterError\", [tagged], Object.getOwnPropertyDescriptor(_class2.prototype, \"adapterError\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"isPreloaded\", [cached], Object.getOwnPropertyDescriptor(_class2.prototype, \"isPreloaded\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"stateName\", [cached], Object.getOwnPropertyDescriptor(_class2.prototype, \"stateName\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"dirtyType\", [cached], Object.getOwnPropertyDescriptor(_class2.prototype, \"dirtyType\"), _class2.prototype), _class2);\nexport { RecordState as default };\nfunction notifyErrorsStateChanged(state) {\n state.notify('isValid');\n state.notify('isError');\n state.notify('adapterError');\n}","import { cacheFor } from '@ember/object/internals';\nimport { LEGACY_SUPPORT } from './model';\nexport default function notifyChanges(identifier, value, key, record, store) {\n if (value === 'attributes') {\n if (key) {\n notifyAttribute(store, identifier, key, record);\n } else {\n record.eachAttribute(key => {\n notifyAttribute(store, identifier, key, record);\n });\n }\n } else if (value === 'relationships') {\n if (key) {\n let meta = record.constructor.relationshipsByName.get(key);\n notifyRelationship(identifier, key, record, meta);\n } else {\n record.eachRelationship((key, meta) => {\n notifyRelationship(identifier, key, record, meta);\n });\n }\n } else if (value === 'identity') {\n record.notifyPropertyChange('id');\n }\n}\nfunction notifyRelationship(identifier, key, record, meta) {\n if (meta.kind === 'belongsTo') {\n record.notifyPropertyChange(key);\n } else if (meta.kind === 'hasMany') {\n let support = LEGACY_SUPPORT.get(identifier);\n let manyArray = support && support._manyArrayCache[key];\n let hasPromise = support && support._relationshipPromisesCache[key];\n if (manyArray && hasPromise) {\n // do nothing, we will notify the ManyArray directly\n // once the fetch has completed.\n return;\n }\n if (manyArray) {\n manyArray.notify();\n\n //We need to notifyPropertyChange in the adding case because we need to make sure\n //we fetch the newly added record in case it is unloaded\n //TODO(Igor): Consider whether we could do this only if the record state is unloaded\n if (!meta.options || meta.options.async || meta.options.async === undefined) {\n record.notifyPropertyChange(key);\n }\n }\n }\n}\nfunction notifyAttribute(store, identifier, key, record) {\n let currentValue = cacheFor(record, key);\n if (currentValue !== store._instanceCache.getRecordData(identifier).getAttr(key)) {\n record.notifyPropertyChange(key);\n }\n}","var _class, _descriptor, _descriptor2, _Model;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n/**\n @module @ember-data/model\n */\n\nimport { assert, warn } from '@ember/debug';\nimport EmberError from '@ember/error';\nimport EmberObject, { get } from '@ember/object';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { run } from '@ember/runloop';\nimport { inject as service } from '@ember/service';\nimport { isNone } from '@ember/utils';\nimport { DEBUG } from '@glimmer/env';\nimport { tracked } from '@glimmer/tracking';\nimport Ember from 'ember';\nimport { resolve } from 'rsvp';\nimport { recordIdentifierFor, storeFor } from '@ember-data/store';\nimport { coerceId, deprecatedPromiseObject, errorsArrayToHash, InternalModel, recordDataFor, WeakCache } from '@ember-data/store/-private';\nimport Errors from './errors';\nimport { LegacySupport } from './legacy-relationships-support';\nimport notifyChanges from './notify-changes';\nimport RecordState, { peekTag, tagged } from './record-state';\nimport { relationshipFromMeta } from './relationship-meta';\nconst {\n changeProperties\n} = Ember;\nexport const LEGACY_SUPPORT = new WeakCache(DEBUG ? 'legacy-relationships' : '');\nLEGACY_SUPPORT._generator = record => {\n const identifier = recordIdentifierFor(record);\n let support = LEGACY_SUPPORT.get(identifier);\n if (!support) {\n support = new LegacySupport(record);\n LEGACY_SUPPORT.set(identifier, support);\n }\n return support;\n};\nfunction findPossibleInverses(type, inverseType, name, relationshipsSoFar) {\n let possibleRelationships = relationshipsSoFar || [];\n let relationshipMap = inverseType.relationships;\n if (!relationshipMap) {\n return possibleRelationships;\n }\n let relationshipsForType = relationshipMap.get(type.modelName);\n let relationships = Array.isArray(relationshipsForType) ? relationshipsForType.filter(relationship => {\n let optionsForRelationship = inverseType.metaForProperty(relationship.name).options;\n if (!optionsForRelationship.inverse && optionsForRelationship.inverse !== null) {\n return true;\n }\n return name === optionsForRelationship.inverse;\n }) : null;\n if (relationships) {\n possibleRelationships.push.apply(possibleRelationships, relationships);\n }\n\n //Recurse to support polymorphism\n if (type.superclass) {\n findPossibleInverses(type.superclass, inverseType, name, possibleRelationships);\n }\n return possibleRelationships;\n}\n\n/*\n * This decorator allows us to lazily compute\n * an expensive getter on first-access and thereafter\n * never recompute it.\n */\nfunction computeOnce(target, key, desc) {\n const cache = new WeakMap();\n let getter = desc.get;\n desc.get = function () {\n let meta = cache.get(this);\n if (!meta) {\n meta = {\n hasComputed: false,\n value: undefined\n };\n cache.set(this, meta);\n }\n if (!meta.hasComputed) {\n meta.value = getter.call(this);\n meta.hasComputed = true;\n }\n return meta.value;\n };\n return desc;\n}\n\n/**\n Base class from which Models can be define.\n\n ```js\n import Model, { attr } from '@ember-data/model';\n\n export default class User extends Model {\n @attr name;\n }\n ```\n\n @class Model\n @public\n @extends Ember.EmberObject\n*/\nlet Model = (_class = (_Model = class Model extends EmberObject {\n constructor(...args) {\n super(...args);\n _initializerDefineProperty(this, \"store\", _descriptor, this);\n /**\n If `true` the store is attempting to reload the record from the adapter.\n Example\n ```javascript\n record.isReloading; // false\n record.reload();\n record.isReloading; // true\n ```\n @property isReloading\n @public\n @type {Boolean}\n @readOnly\n */\n _initializerDefineProperty(this, \"isReloading\", _descriptor2, this);\n }\n init(options = {}) {\n if (DEBUG && !options._secretInit && !options._internalModel && !options._createProps) {\n throw new EmberError('You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set.');\n }\n const createProps = options._createProps;\n const _secretInit = options._secretInit;\n delete options._createProps;\n delete options._secretInit;\n super.init(options);\n _secretInit(this);\n this.___recordState = DEBUG ? new RecordState(this) : null;\n this.setProperties(createProps);\n\n // TODO pass something in such that we don't need internalModel\n // to get this info\n let store = storeFor(this);\n let notifications = store._notificationManager;\n let identity = recordIdentifierFor(this);\n notifications.subscribe(identity, (identifier, type, key) => {\n notifyChanges(identifier, type, key, this, store);\n });\n }\n willDestroy() {\n LEGACY_SUPPORT.get(this)?.destroy();\n }\n\n /**\n If this property is `true` the record is in the `empty`\n state. Empty is the first state all records enter after they have\n been created. Most records created by the store will quickly\n transition to the `loading` state if data needs to be fetched from\n the server or the `created` state if the record is created on the\n client. A record can also enter the empty state if the adapter is\n unable to locate the record.\n @property isEmpty\n @public\n @type {Boolean}\n @readOnly\n */\n get isEmpty() {\n return this.currentState.isEmpty;\n }\n\n /**\n If this property is `true` the record is in the `loading` state. A\n record enters this state when the store asks the adapter for its\n data. It remains in this state until the adapter provides the\n requested data.\n @property isLoading\n @public\n @type {Boolean}\n @readOnly\n */\n get isLoading() {\n return this.currentState.isLoading;\n }\n\n /**\n If this property is `true` the record is in the `loaded` state. A\n record enters this state when its data is populated. Most of a\n record's lifecycle is spent inside substates of the `loaded`\n state.\n Example\n ```javascript\n let record = store.createRecord('model');\n record.get('isLoaded'); // true\n store.findRecord('model', 1).then(function(model) {\n model.get('isLoaded'); // true\n });\n ```\n @property isLoaded\n @public\n @type {Boolean}\n @readOnly\n */\n get isLoaded() {\n return this.currentState.isLoaded;\n }\n\n /**\n If this property is `true` the record is in the `dirty` state. The\n record has local changes that have not yet been saved by the\n adapter. This includes records that have been created (but not yet\n saved) or deleted.\n Example\n ```javascript\n let record = store.createRecord('model');\n record.get('hasDirtyAttributes'); // true\n store.findRecord('model', 1).then(function(model) {\n model.get('hasDirtyAttributes'); // false\n model.set('foo', 'some value');\n model.get('hasDirtyAttributes'); // true\n });\n ```\n @since 1.13.0\n @property hasDirtyAttributes\n @public\n @type {Boolean}\n @readOnly\n */\n get hasDirtyAttributes() {\n return this.currentState.isDirty;\n }\n\n /**\n If this property is `true` the record is in the `saving` state. A\n record enters the saving state when `save` is called, but the\n adapter has not yet acknowledged that the changes have been\n persisted to the backend.\n Example\n ```javascript\n let record = store.createRecord('model');\n record.get('isSaving'); // false\n let promise = record.save();\n record.get('isSaving'); // true\n promise.then(function() {\n record.get('isSaving'); // false\n });\n ```\n @property isSaving\n @public\n @type {Boolean}\n @readOnly\n */\n get isSaving() {\n return this.currentState.isSaving;\n }\n\n /**\n If this property is `true` the record is in the `deleted` state\n and has been marked for deletion. When `isDeleted` is true and\n `hasDirtyAttributes` is true, the record is deleted locally but the deletion\n was not yet persisted. When `isSaving` is true, the change is\n in-flight. When both `hasDirtyAttributes` and `isSaving` are false, the\n change has persisted.\n Example\n ```javascript\n let record = store.createRecord('model');\n record.get('isDeleted'); // false\n record.deleteRecord();\n // Locally deleted\n record.get('isDeleted'); // true\n record.get('hasDirtyAttributes'); // true\n record.get('isSaving'); // false\n // Persisting the deletion\n let promise = record.save();\n record.get('isDeleted'); // true\n record.get('isSaving'); // true\n // Deletion Persisted\n promise.then(function() {\n record.get('isDeleted'); // true\n record.get('isSaving'); // false\n record.get('hasDirtyAttributes'); // false\n });\n ```\n @property isDeleted\n @public\n @type {Boolean}\n @readOnly\n */\n get isDeleted() {\n return this.currentState.isDeleted;\n }\n\n /**\n If this property is `true` the record is in the `new` state. A\n record will be in the `new` state when it has been created on the\n client and the adapter has not yet report that it was successfully\n saved.\n Example\n ```javascript\n let record = store.createRecord('model');\n record.get('isNew'); // true\n record.save().then(function(model) {\n model.get('isNew'); // false\n });\n ```\n @property isNew\n @public\n @type {Boolean}\n @readOnly\n */\n get isNew() {\n return this.currentState.isNew;\n }\n\n /**\n If this property is `true` the record is in the `valid` state.\n A record will be in the `valid` state when the adapter did not report any\n server-side validation failures.\n @property isValid\n @public\n @type {Boolean}\n @readOnly\n */\n get isValid() {\n return this.currentState.isValid;\n }\n\n /**\n If the record is in the dirty state this property will report what\n kind of change has caused it to move into the dirty\n state. Possible values are:\n - `created` The record has been created by the client and not yet saved to the adapter.\n - `updated` The record has been updated by the client and not yet saved to the adapter.\n - `deleted` The record has been deleted by the client and not yet saved to the adapter.\n Example\n ```javascript\n let record = store.createRecord('model');\n record.get('dirtyType'); // 'created'\n ```\n @property dirtyType\n @public\n @type {String}\n @readOnly\n */\n get dirtyType() {\n return this.currentState.dirtyType;\n }\n\n /**\n If `true` the adapter reported that it was unable to save local\n changes to the backend for any reason other than a server-side\n validation error.\n Example\n ```javascript\n record.get('isError'); // false\n record.set('foo', 'valid value');\n record.save().then(null, function() {\n record.get('isError'); // true\n });\n ```\n @property isError\n @public\n @type {Boolean}\n @readOnly\n */\n get isError() {\n return this.currentState.isError;\n }\n set isError(v) {\n if (DEBUG) {\n throw new Error(`isError is not directly settable`);\n }\n }\n /**\n All ember models have an id property. This is an identifier\n managed by an external source. These are always coerced to be\n strings before being used internally. Note when declaring the\n attributes for a model it is an error to declare an id\n attribute.\n ```javascript\n let record = store.createRecord('model');\n record.get('id'); // null\n store.findRecord('model', 1).then(function(model) {\n model.get('id'); // '1'\n });\n ```\n @property id\n @public\n @type {String}\n */\n get id() {\n // the _internalModel guard exists, because some dev-only deprecation code\n // (addListener via validatePropertyInjections) invokes toString before the\n // object is real.\n if (DEBUG) {\n if (!this._internalModel) {\n return void 0;\n }\n }\n return this._internalModel.id;\n }\n set id(id) {\n const normalizedId = coerceId(id);\n if (normalizedId !== null) {\n this._internalModel.setId(normalizedId);\n }\n }\n\n /**\n @property currentState\n @private\n @type {Object}\n */\n // TODO we can probably make this a computeOnce\n // we likely do not need to notify the currentState root anymore\n get currentState() {\n // descriptors are called with the wrong `this` context during mergeMixins\n // when using legacy/classic ember classes. Basically: lazy in prod and eager in dev.\n // so we do this to try to steer folks to the nicer \"dont user currentState\"\n // error.\n if (!DEBUG && !this.___recordState) {\n this.___recordState = new RecordState(this);\n }\n return this.___recordState;\n }\n set currentState(_v) {\n throw new Error('cannot set currentState');\n }\n\n /**\n @property _internalModel\n @private\n @type {Object}\n */\n\n /**\n The store service instance which created this record instance\n @property store\n @public\n */\n\n /**\n When the record is in the `invalid` state this object will contain\n any errors returned by the adapter. When present the errors hash\n contains keys corresponding to the invalid property names\n and values which are arrays of Javascript objects with two keys:\n - `message` A string containing the error message from the backend\n - `attribute` The name of the property associated with this error message\n ```javascript\n record.get('errors.length'); // 0\n record.set('foo', 'invalid value');\n record.save().catch(function() {\n record.get('errors').get('foo');\n // [{message: 'foo should be a number.', attribute: 'foo'}]\n });\n ```\n The `errors` property is useful for displaying error messages to\n the user.\n ```handlebars\n \n {{#each @model.errors.username as |error|}}\n
\n {{error.message}}\n
\n {{/each}}\n \n {{#each @model.errors.email as |error|}}\n
\n {{error.message}}\n
\n {{/each}}\n ```\n You can also access the special `messages` property on the error\n object to get an array of all the error strings.\n ```handlebars\n {{#each @model.errors.messages as |message|}}\n
\n {{message}}\n
\n {{/each}}\n ```\n @property errors\n @public\n @type {Errors}\n */\n get errors() {\n let errors = Errors.create({\n __record: this\n });\n // TODO we should unify how errors gets populated\n // with the code managing the update. Probably a\n // lazy flush similar to retrieveLatest in ManyArray\n let recordData = recordDataFor(this);\n let jsonApiErrors;\n if (recordData.getErrors) {\n jsonApiErrors = recordData.getErrors();\n if (jsonApiErrors) {\n let errorsHash = errorsArrayToHash(jsonApiErrors);\n let errorKeys = Object.keys(errorsHash);\n for (let i = 0; i < errorKeys.length; i++) {\n errors.add(errorKeys[i], errorsHash[errorKeys[i]]);\n }\n }\n }\n return errors;\n }\n\n /**\n This property holds the `AdapterError` object with which\n last adapter operation was rejected.\n @property adapterError\n @public\n @type {AdapterError}\n */\n get adapterError() {\n return this.currentState.adapterError;\n }\n set adapterError(v) {\n throw new Error(`adapterError is not directly settable`);\n }\n\n /**\n Create a JSON representation of the record, using the serialization\n strategy of the store's adapter.\n `serialize` takes an optional hash as a parameter, currently\n supported options are:\n - `includeId`: `true` if the record's ID should be included in the\n JSON representation.\n @method serialize\n @public\n @param {Object} options\n @return {Object} an object whose values are primitive JSON values only\n */\n serialize(options) {\n return storeFor(this)._instanceCache.createSnapshot(recordIdentifierFor(this)).serialize(options);\n }\n\n /*\n We hook the default implementation to ensure\n our tagged properties are properly notified\n as well. We still super for everything because\n sync observers require a direct call occuring\n to trigger their flush. We wouldn't need to\n super in 4.0+ where sync observers are removed.\n */\n notifyPropertyChange(key) {\n let tag = peekTag(this, key);\n if (tag) {\n tag.notify();\n }\n super.notifyPropertyChange(key);\n }\n\n /**\n Marks the record as deleted but does not save it. You must call\n `save` afterwards if you want to persist it. You might use this\n method if you want to allow the user to still `rollbackAttributes()`\n after a delete was made.\n Example\n ```app/controllers/model/delete.js\n import Controller from '@ember/controller';\n import { action } from '@ember/object';\n export default class ModelDeleteController extends Controller {\n @action\n softDelete() {\n this.model.deleteRecord();\n }\n @action\n confirm() {\n this.model.save();\n }\n @action\n undo() {\n this.model.rollbackAttributes();\n }\n }\n ```\n @method deleteRecord\n @public\n */\n deleteRecord() {\n // ensure we've populated currentState prior to deleting a new record\n if (this.currentState) {\n storeFor(this).deleteRecord(this);\n }\n }\n\n /**\n Same as `deleteRecord`, but saves the record immediately.\n Example\n ```app/controllers/model/delete.js\n import Controller from '@ember/controller';\n import { action } from '@ember/object';\n export default class ModelDeleteController extends Controller {\n @action\n delete() {\n this.model.destroyRecord().then(function() {\n this.transitionToRoute('model.index');\n });\n }\n }\n ```\n If you pass an object on the `adapterOptions` property of the options\n argument it will be passed to your adapter via the snapshot\n ```js\n record.destroyRecord({ adapterOptions: { subscribe: false } });\n ```\n ```app/adapters/post.js\n import MyCustomAdapter from './custom-adapter';\n export default class PostAdapter extends MyCustomAdapter {\n deleteRecord(store, type, snapshot) {\n if (snapshot.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n }\n ```\n @method destroyRecord\n @public\n @param {Object} options\n @return {Promise} a promise that will be resolved when the adapter returns\n successfully or rejected if the adapter returns with an error.\n */\n destroyRecord(options) {\n const {\n isNew\n } = this.currentState;\n this.deleteRecord();\n if (isNew) {\n return resolve(this);\n }\n return this.save(options).then(_ => {\n run(() => {\n this.unloadRecord();\n });\n return this;\n });\n }\n\n /**\n Unloads the record from the store. This will not send a delete request\n to your server, it just unloads the record from memory.\n @method unloadRecord\n @public\n */\n unloadRecord() {\n if (this.currentState.isNew && (this.isDestroyed || this.isDestroying)) {\n return;\n }\n storeFor(this).unloadRecord(this);\n }\n\n /**\n @method _notifyProperties\n @private\n */\n _notifyProperties(keys) {\n // changeProperties defers notifications until after the delegate\n // and protects with a try...finally block\n // previously used begin...endPropertyChanges but this is private API\n changeProperties(() => {\n let key;\n for (let i = 0, length = keys.length; i < length; i++) {\n key = keys[i];\n this.notifyPropertyChange(key);\n }\n });\n }\n\n /**\n Returns an object, whose keys are changed properties, and value is\n an [oldProp, newProp] array.\n The array represents the diff of the canonical state with the local state\n of the model. Note: if the model is created locally, the canonical state is\n empty since the adapter hasn't acknowledged the attributes yet:\n Example\n ```app/models/mascot.js\n import Model, { attr } from '@ember-data/model';\n export default class MascotModel extends Model {\n @attr('string') name;\n @attr('boolean', {\n defaultValue: false\n })\n isAdmin;\n }\n ```\n ```javascript\n let mascot = store.createRecord('mascot');\n mascot.changedAttributes(); // {}\n mascot.set('name', 'Tomster');\n mascot.changedAttributes(); // { name: [undefined, 'Tomster'] }\n mascot.set('isAdmin', true);\n mascot.changedAttributes(); // { isAdmin: [undefined, true], name: [undefined, 'Tomster'] }\n mascot.save().then(function() {\n mascot.changedAttributes(); // {}\n mascot.set('isAdmin', false);\n mascot.changedAttributes(); // { isAdmin: [true, false] }\n });\n ```\n @method changedAttributes\n @public\n @return {Object} an object, whose keys are changed properties,\n and value is an [oldProp, newProp] array.\n */\n changedAttributes() {\n return this._internalModel.changedAttributes();\n }\n\n /**\n If the model `hasDirtyAttributes` this function will discard any unsaved\n changes. If the model `isNew` it will be removed from the store.\n Example\n ```javascript\n record.get('name'); // 'Untitled Document'\n record.set('name', 'Doc 1');\n record.get('name'); // 'Doc 1'\n record.rollbackAttributes();\n record.get('name'); // 'Untitled Document'\n ```\n @since 1.13.0\n @method rollbackAttributes\n @public\n */\n rollbackAttributes() {\n const {\n currentState\n } = this;\n this._internalModel.rollbackAttributes();\n currentState.cleanErrorRequests();\n }\n\n /**\n @method _createSnapshot\n @private\n */\n // TODO @deprecate in favor of a public API or examples of how to test successfully\n _createSnapshot() {\n return storeFor(this)._instanceCache.createSnapshot(recordIdentifierFor(this));\n }\n toStringExtension() {\n // the _internalModel guard exists, because some dev-only deprecation code\n // (addListener via validatePropertyInjections) invokes toString before the\n // object is real.\n return this._internalModel && this._internalModel.id;\n }\n\n /**\n Save the record and persist any changes to the record to an\n external source via the adapter.\n Example\n ```javascript\n record.set('name', 'Tomster');\n record.save().then(function() {\n // Success callback\n }, function() {\n // Error callback\n });\n ```\n If you pass an object using the `adapterOptions` property of the options\n argument it will be passed to your adapter via the snapshot.\n ```js\n record.save({ adapterOptions: { subscribe: false } });\n ```\n ```app/adapters/post.js\n import MyCustomAdapter from './custom-adapter';\n export default class PostAdapter extends MyCustomAdapter {\n updateRecord(store, type, snapshot) {\n if (snapshot.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n }\n ```\n @method save\n @public\n @param {Object} options\n @return {Promise} a promise that will be resolved when the adapter returns\n successfully or rejected if the adapter returns with an error.\n */\n save(options) {\n let promise;\n if (this.currentState.isNew && this.currentState.isDeleted) {\n promise = resolve(this);\n } else {\n promise = storeFor(this).saveRecord(this, options);\n }\n if (true /* DEPRECATE_SAVE_PROMISE_ACCESS */) {\n return deprecatedPromiseObject(promise);\n }\n return promise;\n }\n\n /**\n Reload the record from the adapter.\n This will only work if the record has already finished loading.\n Example\n ```app/controllers/model/view.js\n import Controller from '@ember/controller';\n import { action } from '@ember/object';\n export default class ViewController extends Controller {\n @action\n reload() {\n this.model.reload().then(function(model) {\n // do something with the reloaded model\n });\n }\n }\n ```\n @method reload\n @public\n @param {Object} options optional, may include `adapterOptions` hash which will be passed to adapter request\n @return {Promise} a promise that will be resolved with the record when the\n adapter returns successfully or rejected if the adapter returns\n with an error.\n */\n reload(_options) {\n let options = {};\n if (typeof _options === 'object' && _options !== null && _options.adapterOptions) {\n options.adapterOptions = _options.adapterOptions;\n }\n options.isReloading = true;\n let identifier = recordIdentifierFor(this);\n assert(`You cannot reload a record without an ID`, identifier.id);\n this.isReloading = true;\n const promise = storeFor(this)._fetchManager.scheduleFetch(identifier, options).then(() => this).finally(() => {\n this.isReloading = false;\n });\n if (true /* DEPRECATE_SAVE_PROMISE_ACCESS */) {\n return deprecatedPromiseObject(promise);\n }\n return promise;\n }\n attr() {\n assert('The `attr` method is not available on Model, a Snapshot was probably expected. Are you passing a Model instead of a Snapshot to your serializer?', false);\n }\n\n /**\n Get the reference for the specified belongsTo relationship.\n Example\n ```app/models/blog.js\n import Model, { belongsTo } from '@ember-data/model';\n export default class BlogModel extends Model {\n @belongsTo({ async: true }) user;\n }\n ```\n ```javascript\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\n let userRef = blog.belongsTo('user');\n // check if the user relationship is loaded\n let isLoaded = userRef.value() !== null;\n // get the record of the reference (null if not yet available)\n let user = userRef.value();\n // get the identifier of the reference\n if (userRef.remoteType() === \"id\") {\n let id = userRef.id();\n } else if (userRef.remoteType() === \"link\") {\n let link = userRef.link();\n }\n // load user (via store.findRecord or store.findBelongsTo)\n userRef.load().then(...)\n // or trigger a reload\n userRef.reload().then(...)\n // provide data for reference\n userRef.push({\n type: 'user',\n id: 1,\n attributes: {\n username: \"@user\"\n }\n }).then(function(user) {\n userRef.value() === user;\n });\n ```\n @method belongsTo\n @public\n @param {String} name of the relationship\n @since 2.5.0\n @return {BelongsToReference} reference for this relationship\n */\n belongsTo(name) {\n return LEGACY_SUPPORT.lookup(this).referenceFor('belongsTo', name);\n }\n\n /**\n Get the reference for the specified hasMany relationship.\n Example\n ```app/models/blog.js\n import Model, { hasMany } from '@ember-data/model';\n export default class BlogModel extends Model {\n @hasMany({ async: true }) comments;\n }\n let blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n comments: {\n data: [\n { type: 'comment', id: 1 },\n { type: 'comment', id: 2 }\n ]\n }\n }\n }\n });\n let commentsRef = blog.hasMany('comments');\n // check if the comments are loaded already\n let isLoaded = commentsRef.value() !== null;\n // get the records of the reference (null if not yet available)\n let comments = commentsRef.value();\n // get the identifier of the reference\n if (commentsRef.remoteType() === \"ids\") {\n let ids = commentsRef.ids();\n } else if (commentsRef.remoteType() === \"link\") {\n let link = commentsRef.link();\n }\n // load comments (via store.findMany or store.findHasMany)\n commentsRef.load().then(...)\n // or trigger a reload\n commentsRef.reload().then(...)\n // provide data for reference\n commentsRef.push([{ type: 'comment', id: 1 }, { type: 'comment', id: 2 }]).then(function(comments) {\n commentsRef.value() === comments;\n });\n ```\n @method hasMany\n @public\n @param {String} name of the relationship\n @since 2.5.0\n @return {HasManyReference} reference for this relationship\n */\n hasMany(name) {\n return LEGACY_SUPPORT.lookup(this).referenceFor('hasMany', name);\n }\n\n /**\n Given a callback, iterates over each of the relationships in the model,\n invoking the callback with the name of each relationship and its relationship\n descriptor.\n The callback method you provide should have the following signature (all\n parameters are optional):\n ```javascript\n function(name, descriptor);\n ```\n - `name` the name of the current property in the iteration\n - `descriptor` the meta object that describes this relationship\n The relationship descriptor argument is an object with the following properties.\n - **key** String the name of this relationship on the Model\n - **kind** String \"hasMany\" or \"belongsTo\"\n - **options** Object the original options hash passed when the relationship was declared\n - **parentType** Model the type of the Model that owns this relationship\n - **type** String the type name of the related Model\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context.\n Example\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n export default class ApplicationSerializer extends JSONSerializer {\n serialize(record, options) {\n let json = {};\n record.eachRelationship(function(name, descriptor) {\n if (descriptor.kind === 'hasMany') {\n let serializedHasManyName = name.toUpperCase() + '_IDS';\n json[serializedHasManyName] = record.get(name).mapBy('id');\n }\n });\n return json;\n }\n }\n ```\n @method eachRelationship\n @public\n @param {Function} callback the callback to invoke\n @param {any} binding the value to which the callback's `this` should be bound\n */\n eachRelationship(callback, binding) {\n this.constructor.eachRelationship(callback, binding);\n }\n relationshipFor(name) {\n return this.constructor.relationshipsByName.get(name);\n }\n inverseFor(key) {\n return this.constructor.inverseFor(key, storeFor(this));\n }\n eachAttribute(callback, binding) {\n this.constructor.eachAttribute(callback, binding);\n }\n /*\n These class methods below provide relationship\n introspection abilities about relationships.\n A note about the computed properties contained here:\n **These properties are effectively sealed once called for the first time.**\n To avoid repeatedly doing expensive iteration over a model's fields, these\n values are computed once and then cached for the remainder of the runtime of\n your application.\n If your application needs to modify a class after its initial definition\n (for example, using `reopen()` to add additional attributes), make sure you\n do it before using your model with the store, which uses these properties\n extensively.\n */\n\n /**\n For a given relationship name, returns the model type of the relationship.\n For example, if you define a model like this:\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n export default class PostModel extends Model {\n @hasMany('comment') comments;\n }\n ```\n Calling `store.modelFor('post').typeForRelationship('comments', store)` will return `Comment`.\n @method typeForRelationship\n @public\n @static\n @param {String} name the name of the relationship\n @param {store} store an instance of Store\n @return {Model} the type of the relationship, or undefined\n */\n static typeForRelationship(name, store) {\n let relationship = this.relationshipsByName.get(name);\n return relationship && store.modelFor(relationship.type);\n }\n static get inverseMap() {\n return Object.create(null);\n }\n\n /**\n Find the relationship which is the inverse of the one asked for.\n For example, if you define models like this:\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n export default class PostModel extends Model {\n @hasMany('message') comments;\n }\n ```\n ```app/models/message.js\n import Model, { belongsTo } from '@ember-data/model';\n export default class MessageModel extends Model {\n @belongsTo('post') owner;\n }\n ```\n ``` js\n store.modelFor('post').inverseFor('comments', store) // { type: App.Message, name: 'owner', kind: 'belongsTo' }\n store.modelFor('message').inverseFor('owner', store) // { type: App.Post, name: 'comments', kind: 'hasMany' }\n ```\n @method inverseFor\n @public\n @static\n @param {String} name the name of the relationship\n @param {Store} store\n @return {Object} the inverse relationship, or null\n */\n static inverseFor(name, store) {\n let inverseMap = this.inverseMap;\n if (inverseMap[name]) {\n return inverseMap[name];\n } else {\n let inverse = this._findInverseFor(name, store);\n inverseMap[name] = inverse;\n return inverse;\n }\n }\n\n //Calculate the inverse, ignoring the cache\n static _findInverseFor(name, store) {\n let inverseType = this.typeForRelationship(name, store);\n if (!inverseType) {\n return null;\n }\n let propertyMeta = this.metaForProperty(name);\n //If inverse is manually specified to be null, like `comments: hasMany('message', { inverse: null })`\n let options = propertyMeta.options;\n if (options.inverse === null) {\n return null;\n }\n let inverseName, inverseKind, inverse, inverseOptions;\n\n //If inverse is specified manually, return the inverse\n if (options.inverse) {\n inverseName = options.inverse;\n inverse = inverseType.relationshipsByName.get(inverseName);\n assert(\"We found no inverse relationships by the name of '\" + inverseName + \"' on the '\" + inverseType.modelName + \"' model. This is most likely due to a missing attribute on your model definition.\", !isNone(inverse));\n\n // TODO probably just return the whole inverse here\n inverseKind = inverse.kind;\n inverseOptions = inverse.options;\n } else {\n //No inverse was specified manually, we need to use a heuristic to guess one\n if (propertyMeta.type === propertyMeta.parentModelName) {\n warn(`Detected a reflexive relationship by the name of '${name}' without an inverse option. Look at https://guides.emberjs.com/current/models/relationships/#toc_reflexive-relations for how to explicitly specify inverses.`, false, {\n id: 'ds.model.reflexive-relationship-without-inverse'\n });\n }\n let possibleRelationships = findPossibleInverses(this, inverseType, name);\n if (possibleRelationships.length === 0) {\n return null;\n }\n let filteredRelationships = possibleRelationships.filter(possibleRelationship => {\n let optionsForRelationship = inverseType.metaForProperty(possibleRelationship.name).options;\n return name === optionsForRelationship.inverse;\n });\n assert(\"You defined the '\" + name + \"' relationship on \" + this + ', but you defined the inverse relationships of type ' + inverseType.toString() + ' multiple times. Look at https://guides.emberjs.com/current/models/relationships/#toc_explicit-inverses for how to explicitly specify inverses', filteredRelationships.length < 2);\n if (filteredRelationships.length === 1) {\n possibleRelationships = filteredRelationships;\n }\n assert(\"You defined the '\" + name + \"' relationship on \" + this + ', but multiple possible inverse relationships of type ' + this + ' were found on ' + inverseType + '. Look at https://guides.emberjs.com/current/models/relationships/#toc_explicit-inverses for how to explicitly specify inverses', possibleRelationships.length === 1);\n inverseName = possibleRelationships[0].name;\n inverseKind = possibleRelationships[0].kind;\n inverseOptions = possibleRelationships[0].options;\n }\n assert(`The ${inverseType.modelName}:${inverseName} relationship declares 'inverse: null', but it was resolved as the inverse for ${this.modelName}:${name}.`, !inverseOptions || inverseOptions.inverse !== null);\n return {\n type: inverseType,\n name: inverseName,\n kind: inverseKind,\n options: inverseOptions\n };\n }\n\n /**\n The model's relationships as a map, keyed on the type of the\n relationship. The value of each entry is an array containing a descriptor\n for each relationship with that type, describing the name of the relationship\n as well as the type.\n For example, given the following model definition:\n ```app/models/blog.js\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n @hasMany('post') posts;\n }\n ```\n This computed property would return a map describing these\n relationships, like this:\n ```javascript\n import { get } from '@ember/object';\n import Blog from 'app/models/blog';\n import User from 'app/models/user';\n import Post from 'app/models/post';\n let relationships = Blog.relationships;\n relationships.get('user');\n //=> [ { name: 'users', kind: 'hasMany' },\n // { name: 'owner', kind: 'belongsTo' } ]\n relationships.get('post');\n //=> [ { name: 'posts', kind: 'hasMany' } ]\n ```\n @property relationships\n @public\n @static\n @type Map\n @readOnly\n */\n\n static get relationships() {\n let map = new Map();\n let relationshipsByName = this.relationshipsByName;\n\n // Loop through each computed property on the class\n relationshipsByName.forEach(desc => {\n let {\n type\n } = desc;\n if (!map.has(type)) {\n map.set(type, []);\n }\n map.get(type).push(desc);\n });\n return map;\n }\n\n /**\n A hash containing lists of the model's relationships, grouped\n by the relationship kind. For example, given a model with this\n definition:\n ```app/models/blog.js\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n @hasMany('post') posts;\n }\n ```\n This property would contain the following:\n ```javascript\n import { get } from '@ember/object';\n import Blog from 'app/models/blog';\n let relationshipNames = Blog.relationshipNames;\n relationshipNames.hasMany;\n //=> ['users', 'posts']\n relationshipNames.belongsTo;\n //=> ['owner']\n ```\n @property relationshipNames\n @public\n @static\n @type Object\n @readOnly\n */\n static get relationshipNames() {\n let names = {\n hasMany: [],\n belongsTo: []\n };\n this.eachComputedProperty((name, meta) => {\n if (meta.isRelationship) {\n names[meta.kind].push(name);\n }\n });\n return names;\n }\n\n /**\n An array of types directly related to a model. Each type will be\n included once, regardless of the number of relationships it has with\n the model.\n For example, given a model with this definition:\n ```app/models/blog.js\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n @hasMany('post') posts;\n }\n ```\n This property would contain the following:\n ```javascript\n import { get } from '@ember/object';\n import Blog from 'app/models/blog';\n let relatedTypes = Blog.relatedTypes');\n //=> [ User, Post ]\n ```\n @property relatedTypes\n @public\n @static\n @type Ember.Array\n @readOnly\n */\n static get relatedTypes() {\n let types = [];\n let rels = this.relationshipsObject;\n let relationships = Object.keys(rels);\n\n // create an array of the unique types involved\n // in relationships\n for (let i = 0; i < relationships.length; i++) {\n let name = relationships[i];\n let meta = rels[name];\n let modelName = meta.type;\n if (types.indexOf(modelName) === -1) {\n types.push(modelName);\n }\n }\n return types;\n }\n\n /**\n A map whose keys are the relationships of a model and whose values are\n relationship descriptors.\n For example, given a model with this\n definition:\n ```app/models/blog.js\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n @hasMany('post') posts;\n }\n ```\n This property would contain the following:\n ```javascript\n import { get } from '@ember/object';\n import Blog from 'app/models/blog';\n let relationshipsByName = Blog.relationshipsByName;\n relationshipsByName.get('users');\n //=> { key: 'users', kind: 'hasMany', type: 'user', options: Object, isRelationship: true }\n relationshipsByName.get('owner');\n //=> { key: 'owner', kind: 'belongsTo', type: 'user', options: Object, isRelationship: true }\n ```\n @property relationshipsByName\n @public\n @static\n @type Map\n @readOnly\n */\n static get relationshipsByName() {\n let map = new Map();\n let rels = this.relationshipsObject;\n let relationships = Object.keys(rels);\n for (let i = 0; i < relationships.length; i++) {\n let key = relationships[i];\n let value = rels[key];\n map.set(value.key, value);\n }\n return map;\n }\n static get relationshipsObject() {\n let relationships = Object.create(null);\n let modelName = this.modelName;\n this.eachComputedProperty((name, meta) => {\n if (meta.isRelationship) {\n meta.key = name;\n meta.name = name;\n meta.parentModelName = modelName;\n relationships[name] = relationshipFromMeta(meta);\n }\n });\n return relationships;\n }\n\n /**\n A map whose keys are the fields of the model and whose values are strings\n describing the kind of the field. A model's fields are the union of all of its\n attributes and relationships.\n For example:\n ```app/models/blog.js\n import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n export default class BlogModel extends Model {\n @hasMany('user') users;\n @belongsTo('user') owner;\n @hasMany('post') posts;\n @attr('string') title;\n }\n ```\n ```js\n import { get } from '@ember/object';\n import Blog from 'app/models/blog'\n let fields = Blog.fields;\n fields.forEach(function(kind, field) {\n console.log(field, kind);\n });\n // prints:\n // users, hasMany\n // owner, belongsTo\n // posts, hasMany\n // title, attribute\n ```\n @property fields\n @public\n @static\n @type Map\n @readOnly\n */\n static get fields() {\n let map = new Map();\n this.eachComputedProperty((name, meta) => {\n if (meta.isRelationship) {\n map.set(name, meta.kind);\n } else if (meta.isAttribute) {\n map.set(name, 'attribute');\n }\n });\n return map;\n }\n\n /**\n Given a callback, iterates over each of the relationships in the model,\n invoking the callback with the name of each relationship and its relationship\n descriptor.\n @method eachRelationship\n @public\n @static\n @param {Function} callback the callback to invoke\n @param {any} binding the value to which the callback's `this` should be bound\n */\n static eachRelationship(callback, binding) {\n this.relationshipsByName.forEach((relationship, name) => {\n callback.call(binding, name, relationship);\n });\n }\n\n /**\n Given a callback, iterates over each of the types related to a model,\n invoking the callback with the related type's class. Each type will be\n returned just once, regardless of how many different relationships it has\n with a model.\n @method eachRelatedType\n @public\n @static\n @param {Function} callback the callback to invoke\n @param {any} binding the value to which the callback's `this` should be bound\n */\n static eachRelatedType(callback, binding) {\n let relationshipTypes = this.relatedTypes;\n for (let i = 0; i < relationshipTypes.length; i++) {\n let type = relationshipTypes[i];\n callback.call(binding, type);\n }\n }\n static determineRelationshipType(knownSide, store) {\n let knownKey = knownSide.key;\n let knownKind = knownSide.kind;\n let inverse = this.inverseFor(knownKey, store);\n // let key;\n let otherKind;\n if (!inverse) {\n return knownKind === 'belongsTo' ? 'oneToNone' : 'manyToNone';\n }\n\n // key = inverse.name;\n otherKind = inverse.kind;\n if (otherKind === 'belongsTo') {\n return knownKind === 'belongsTo' ? 'oneToOne' : 'manyToOne';\n } else {\n return knownKind === 'belongsTo' ? 'oneToMany' : 'manyToMany';\n }\n }\n\n /**\n A map whose keys are the attributes of the model (properties\n described by attr) and whose values are the meta object for the\n property.\n Example\n ```app/models/person.js\n import Model, { attr } from '@ember-data/model';\n export default class PersonModel extends Model {\n @attr('string') firstName;\n @attr('string') lastName;\n @attr('date') birthday;\n }\n ```\n ```javascript\n import { get } from '@ember/object';\n import Person from 'app/models/person'\n let attributes = Person.attributes\n attributes.forEach(function(meta, name) {\n console.log(name, meta);\n });\n // prints:\n // firstName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"firstName\"}\n // lastName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"lastName\"}\n // birthday {type: \"date\", isAttribute: true, options: Object, parentType: function, name: \"birthday\"}\n ```\n @property attributes\n @public\n @static\n @type {Map}\n @readOnly\n */\n static get attributes() {\n let map = new Map();\n this.eachComputedProperty((name, meta) => {\n if (meta.isAttribute) {\n assert(\"You may not set `id` as an attribute on your model. Please remove any lines that look like: `id: attr('')` from \" + this.toString(), name !== 'id');\n meta.name = name;\n map.set(name, meta);\n }\n });\n return map;\n }\n\n /**\n A map whose keys are the attributes of the model (properties\n described by attr) and whose values are type of transformation\n applied to each attribute. This map does not include any\n attributes that do not have an transformation type.\n Example\n ```app/models/person.js\n import Model, { attr } from '@ember-data/model';\n export default class PersonModel extends Model {\n @attr firstName;\n @attr('string') lastName;\n @attr('date') birthday;\n }\n ```\n ```javascript\n import { get } from '@ember/object';\n import Person from 'app/models/person';\n let transformedAttributes = Person.transformedAttributes\n transformedAttributes.forEach(function(field, type) {\n console.log(field, type);\n });\n // prints:\n // lastName string\n // birthday date\n ```\n @property transformedAttributes\n @public\n @static\n @type {Map}\n @readOnly\n */\n static get transformedAttributes() {\n let map = new Map();\n this.eachAttribute((key, meta) => {\n if (meta.type) {\n map.set(key, meta.type);\n }\n });\n return map;\n }\n\n /**\n Iterates through the attributes of the model, calling the passed function on each\n attribute.\n The callback method you provide should have the following signature (all\n parameters are optional):\n ```javascript\n function(name, meta);\n ```\n - `name` the name of the current property in the iteration\n - `meta` the meta object for the attribute property in the iteration\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context.\n Example\n ```javascript\n import Model, { attr } from '@ember-data/model';\n class PersonModel extends Model {\n @attr('string') firstName;\n @attr('string') lastName;\n @attr('date') birthday;\n }\n PersonModel.eachAttribute(function(name, meta) {\n console.log(name, meta);\n });\n // prints:\n // firstName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"firstName\"}\n // lastName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"lastName\"}\n // birthday {type: \"date\", isAttribute: true, options: Object, parentType: function, name: \"birthday\"}\n ```\n @method eachAttribute\n @public\n @param {Function} callback The callback to execute\n @param {Object} [binding] the value to which the callback's `this` should be bound\n @static\n */\n static eachAttribute(callback, binding) {\n this.attributes.forEach((meta, name) => {\n callback.call(binding, name, meta);\n });\n }\n\n /**\n Iterates through the transformedAttributes of the model, calling\n the passed function on each attribute. Note the callback will not be\n called for any attributes that do not have an transformation type.\n The callback method you provide should have the following signature (all\n parameters are optional):\n ```javascript\n function(name, type);\n ```\n - `name` the name of the current property in the iteration\n - `type` a string containing the name of the type of transformed\n applied to the attribute\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context.\n Example\n ```javascript\n import Model, { attr } from '@ember-data/model';\n let Person = Model.extend({\n firstName: attr(),\n lastName: attr('string'),\n birthday: attr('date')\n });\n Person.eachTransformedAttribute(function(name, type) {\n console.log(name, type);\n });\n // prints:\n // lastName string\n // birthday date\n ```\n @method eachTransformedAttribute\n @public\n @param {Function} callback The callback to execute\n @param {Object} [binding] the value to which the callback's `this` should be bound\n @static\n */\n static eachTransformedAttribute(callback, binding) {\n this.transformedAttributes.forEach((type, name) => {\n callback.call(binding, name, type);\n });\n }\n\n /**\n Returns the name of the model class.\n @method toString\n @public\n @static\n */\n static toString() {\n return `model:${get(this, 'modelName')}`;\n }\n}, _Model.isModel = true, _Model.modelName = null, _Model), _descriptor = _applyDecoratedDescriptor(_class.prototype, \"store\", [service], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"isEmpty\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"isEmpty\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"isLoading\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"isLoading\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"isLoaded\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"isLoaded\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"hasDirtyAttributes\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"hasDirtyAttributes\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"isSaving\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"isSaving\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"isDeleted\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"isDeleted\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"isNew\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"isNew\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"isValid\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"isValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"dirtyType\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"dirtyType\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"isError\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"isError\"), _class.prototype), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"isReloading\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return false;\n }\n}), _applyDecoratedDescriptor(_class.prototype, \"id\", [tagged], Object.getOwnPropertyDescriptor(_class.prototype, \"id\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"currentState\", [tagged], Object.getOwnPropertyDescriptor(_class.prototype, \"currentState\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"errors\", [computeOnce], Object.getOwnPropertyDescriptor(_class.prototype, \"errors\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"adapterError\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"adapterError\"), _class.prototype), _applyDecoratedDescriptor(_class, \"inverseMap\", [computeOnce], Object.getOwnPropertyDescriptor(_class, \"inverseMap\"), _class), _applyDecoratedDescriptor(_class, \"relationships\", [computeOnce], Object.getOwnPropertyDescriptor(_class, \"relationships\"), _class), _applyDecoratedDescriptor(_class, \"relationshipNames\", [computeOnce], Object.getOwnPropertyDescriptor(_class, \"relationshipNames\"), _class), _applyDecoratedDescriptor(_class, \"relatedTypes\", [computeOnce], Object.getOwnPropertyDescriptor(_class, \"relatedTypes\"), _class), _applyDecoratedDescriptor(_class, \"relationshipsByName\", [computeOnce], Object.getOwnPropertyDescriptor(_class, \"relationshipsByName\"), _class), _applyDecoratedDescriptor(_class, \"relationshipsObject\", [computeOnce], Object.getOwnPropertyDescriptor(_class, \"relationshipsObject\"), _class), _applyDecoratedDescriptor(_class, \"fields\", [computeOnce], Object.getOwnPropertyDescriptor(_class, \"fields\"), _class), _applyDecoratedDescriptor(_class, \"attributes\", [computeOnce], Object.getOwnPropertyDescriptor(_class, \"attributes\"), _class), _applyDecoratedDescriptor(_class, \"transformedAttributes\", [computeOnce], Object.getOwnPropertyDescriptor(_class, \"transformedAttributes\"), _class), _class); // this is required to prevent `init` from passing\n// the values initialized during create to `setUnknownProperty`\nModel.prototype._internalModel = null;\nModel.prototype._createProps = null;\nModel.prototype._secretInit = null;\nif (true /* HAS_DEBUG_PACKAGE */) {\n /**\n Provides info about the model for debugging purposes\n by grouping the properties into more semantic groups.\n Meant to be used by debugging tools such as the Chrome Ember Extension.\n - Groups all attributes in \"Attributes\" group.\n - Groups all belongsTo relationships in \"Belongs To\" group.\n - Groups all hasMany relationships in \"Has Many\" group.\n - Groups all flags in \"Flags\" group.\n - Flags relationship CPs as expensive properties.\n @method _debugInfo\n @for Model\n @private\n */\n Model.prototype._debugInfo = function () {\n let attributes = ['id'];\n let relationships = {};\n let expensiveProperties = [];\n this.eachAttribute((name, meta) => attributes.push(name));\n let groups = [{\n name: 'Attributes',\n properties: attributes,\n expand: true\n }];\n this.eachRelationship((name, relationship) => {\n let properties = relationships[relationship.kind];\n if (properties === undefined) {\n properties = relationships[relationship.kind] = [];\n groups.push({\n name: relationship.kind,\n properties,\n expand: true\n });\n }\n properties.push(name);\n expensiveProperties.push(name);\n });\n groups.push({\n name: 'Flags',\n properties: ['isLoaded', 'hasDirtyAttributes', 'isSaving', 'isDeleted', 'isError', 'isNew', 'isValid']\n });\n return {\n propertyInfo: {\n // include all other mixins / properties (not just the grouped ones)\n includeOtherProperties: true,\n groups: groups,\n // don't pre-calculate unless cached\n expensiveProperties: expensiveProperties\n }\n };\n };\n}\nif (DEBUG) {\n let lookupDescriptor = function lookupDescriptor(obj, keyName) {\n let current = obj;\n do {\n let descriptor = Object.getOwnPropertyDescriptor(current, keyName);\n if (descriptor !== undefined) {\n return descriptor;\n }\n current = Object.getPrototypeOf(current);\n } while (current !== null);\n return null;\n };\n let isBasicDesc = function isBasicDesc(desc) {\n return !desc || !desc.get && !desc.set && desc.enumerable === true && desc.writable === true && desc.configurable === true;\n };\n let isDefaultEmptyDescriptor = function isDefaultEmptyDescriptor(obj, keyName) {\n let instanceDesc = lookupDescriptor(obj, keyName);\n return isBasicDesc(instanceDesc) && lookupDescriptor(obj.constructor, keyName) === null;\n };\n Model.reopen({\n init() {\n this._super(...arguments);\n if (!isDefaultEmptyDescriptor(this, '_internalModel') || !(this._internalModel instanceof InternalModel)) {\n throw new Error(`'_internalModel' is a reserved property name on instances of classes extending Model. Please choose a different property name for ${this.constructor.toString()}`);\n }\n let ourDescriptor = lookupDescriptor(Model.prototype, 'currentState');\n let theirDescriptor = lookupDescriptor(this, 'currentState');\n let realState = this.___recordState;\n if (ourDescriptor.get !== theirDescriptor.get || realState !== this.currentState) {\n throw new Error(`'currentState' is a reserved property name on instances of classes extending Model. Please choose a different property name for ${this.constructor.toString()}`);\n }\n const ID_DESCRIPTOR = lookupDescriptor(Model.prototype, 'id');\n let idDesc = lookupDescriptor(this, 'id');\n if (idDesc.get !== ID_DESCRIPTOR.get) {\n throw new EmberError(`You may not set 'id' as an attribute on your model. Please remove any lines that look like: \\`id: attr('')\\` from ${this.constructor.toString()}`);\n }\n }\n });\n}\nexport default Model;","import { DEBUG } from '@glimmer/env';\nimport { singularize } from 'ember-inflector';\nimport { normalizeModelName } from '@ember-data/store/-private';\n/**\n @module @ember-data/store\n*/\n\nfunction typeForRelationshipMeta(meta) {\n let modelName = normalizeModelName(meta.type || meta.key);\n if (meta.kind === 'hasMany') {\n modelName = singularize(modelName);\n }\n return modelName;\n}\nfunction shouldFindInverse(relationshipMeta) {\n let options = relationshipMeta.options;\n return !(options && options.inverse === null);\n}\nexport class RelationshipDefinition {\n constructor(meta) {\n this._type = '';\n this.__inverseKey = '';\n this.__inverseIsAsync = true;\n this.__hasCalculatedInverse = false;\n this.parentModelName = meta.parentModelName;\n this.meta = meta;\n }\n\n /**\n * @internal\n * @deprecated\n */\n get key() {\n return this.meta.key;\n }\n get kind() {\n return this.meta.kind;\n }\n get type() {\n if (this._type) {\n return this._type;\n }\n this._type = typeForRelationshipMeta(this.meta);\n return this._type;\n }\n get options() {\n return this.meta.options;\n }\n get name() {\n return this.meta.name;\n }\n _inverseKey(store, modelClass) {\n if (this.__hasCalculatedInverse === false) {\n this._calculateInverse(store, modelClass);\n }\n return this.__inverseKey;\n }\n _inverseIsAsync(store, modelClass) {\n if (this.__hasCalculatedInverse === false) {\n this._calculateInverse(store, modelClass);\n }\n return this.__inverseIsAsync;\n }\n _calculateInverse(store, modelClass) {\n this.__hasCalculatedInverse = true;\n let inverseKey, inverseIsAsync;\n let inverse = null;\n if (shouldFindInverse(this.meta)) {\n inverse = modelClass.inverseFor(this.key, store);\n } else if (DEBUG) {\n modelClass.typeForRelationship(this.key, store);\n }\n if (inverse) {\n inverseKey = inverse.name;\n inverseIsAsync = isRelationshipAsync(inverse);\n } else {\n inverseKey = null;\n inverseIsAsync = false;\n }\n this.__inverseKey = inverseKey;\n this.__inverseIsAsync = inverseIsAsync;\n }\n}\nfunction isRelationshipAsync(meta) {\n let inverseAsync = meta.options && meta.options.async;\n return typeof inverseAsync === 'undefined' ? true : inverseAsync;\n}\nexport function relationshipFromMeta(meta) {\n return new RelationshipDefinition(meta);\n}","import { assert, inspect, warn } from '@ember/debug';\nimport { computed } from '@ember/object';\nimport { DEBUG } from '@glimmer/env';\nimport { LEGACY_SUPPORT } from './model';\nimport { computedMacroWithOptionalParams } from './util';\n\n/**\n @module @ember-data/model\n*/\n\n/**\n `belongsTo` is used to define One-To-One and One-To-Many\n relationships on a [Model](/ember-data/release/classes/Model).\n\n\n `belongsTo` takes an optional hash as a second parameter, currently\n supported options are:\n\n - `async`: A boolean value used to explicitly declare this to be an async relationship. The default is true.\n - `inverse`: A string used to identify the inverse property on a\n related model in a One-To-Many relationship. See [Explicit Inverses](#explicit-inverses)\n - `polymorphic` A boolean value to mark the relationship as polymorphic\n\n #### One-To-One\n To declare a one-to-one relationship between two models, use\n `belongsTo`:\n\n ```app/models/user.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @belongsTo('profile') profile;\n }\n ```\n\n ```app/models/profile.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class ProfileModel extends Model {\n @belongsTo('user') user;\n }\n ```\n\n #### One-To-Many\n To declare a one-to-many relationship between two models, use\n `belongsTo` in combination with `hasMany`, like this:\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment') comments;\n }\n ```\n\n ```app/models/comment.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class CommentModel extends Model {\n @belongsTo('post') post;\n }\n ```\n\n You can avoid passing a string as the first parameter. In that case Ember Data\n will infer the type from the key name.\n\n ```app/models/comment.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class CommentModel extends Model {\n @belongsTo post;\n }\n ```\n\n will lookup for a Post type.\n\n #### Sync relationships\n\n Ember Data resolves sync relationships with the related resources\n available in its local store, hence it is expected these resources\n to be loaded before or along-side the primary resource.\n\n ```app/models/comment.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class CommentModel extends Model {\n @belongsTo('post', {\n async: false\n })\n post;\n }\n ```\n\n In contrast to async relationship, accessing a sync relationship\n will always return the record (Model instance) for the existing\n local resource, or null. But it will error on access when\n a related resource is known to exist and it has not been loaded.\n\n ```\n let post = comment.get('post');\n\n ```\n\n @method belongsTo\n @public\n @static\n @for @ember-data/model\n @param {String} modelName (optional) type of the relationship\n @param {Object} options (optional) a hash of options\n @return {Ember.computed} relationship\n*/\nfunction belongsTo(modelName, options) {\n let opts, userEnteredModelName;\n if (typeof modelName === 'object') {\n opts = modelName;\n userEnteredModelName = undefined;\n } else {\n opts = options;\n userEnteredModelName = modelName;\n }\n assert('The first argument to belongsTo must be a string representing a model type key, not an instance of ' + inspect(userEnteredModelName) + \". E.g., to define a relation to the Person model, use belongsTo('person')\", typeof userEnteredModelName === 'string' || typeof userEnteredModelName === 'undefined');\n opts = opts || {};\n if (!('async' in opts)) {\n opts.async = true;\n }\n let meta = {\n type: userEnteredModelName,\n isRelationship: true,\n options: opts,\n kind: 'belongsTo',\n name: 'Belongs To',\n key: null\n };\n return computed({\n get(key) {\n const support = LEGACY_SUPPORT.lookup(this);\n if (DEBUG) {\n if (['_internalModel', 'recordData', 'currentState'].indexOf(key) !== -1) {\n throw new Error(`'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your belongsTo on ${this.constructor.toString()}`);\n }\n if (Object.prototype.hasOwnProperty.call(opts, 'serialize')) {\n warn(`You provided a serialize option on the \"${key}\" property in the \"${support.identifier.type}\" class, this belongs in the serializer. See Serializer and it's implementations https://api.emberjs.com/ember-data/release/classes/Serializer`, false, {\n id: 'ds.model.serialize-option-in-belongs-to'\n });\n }\n if (Object.prototype.hasOwnProperty.call(opts, 'embedded')) {\n warn(`You provided an embedded option on the \"${key}\" property in the \"${support.identifier.type}\" class, this belongs in the serializer. See EmbeddedRecordsMixin https://api.emberjs.com/ember-data/release/classes/EmbeddedRecordsMixin`, false, {\n id: 'ds.model.embedded-option-in-belongs-to'\n });\n }\n }\n return support.getBelongsTo(key);\n },\n set(key, value) {\n const support = LEGACY_SUPPORT.lookup(this);\n if (DEBUG) {\n if (['_internalModel', 'recordData', 'currentState'].indexOf(key) !== -1) {\n throw new Error(`'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your belongsTo on ${this.constructor.toString()}`);\n }\n }\n this.store._backburner.join(() => {\n support.setDirtyBelongsTo(key, value);\n });\n return support.getBelongsTo(key);\n }\n }).meta(meta);\n}\nexport default computedMacroWithOptionalParams(belongsTo);","/**\n @module @ember-data/model\n*/\nimport { assert, inspect } from '@ember/debug';\nimport { computed } from '@ember/object';\nimport { DEBUG } from '@glimmer/env';\nimport { LEGACY_SUPPORT } from './model';\nimport { computedMacroWithOptionalParams } from './util';\n\n/**\n `hasMany` is used to define One-To-Many and Many-To-Many\n relationships on a [Model](/ember-data/release/classes/Model).\n\n `hasMany` takes an optional hash as a second parameter, currently\n supported options are:\n\n - `async`: A boolean value used to explicitly declare this to be an async relationship. The default is true.\n - `inverse`: A string used to identify the inverse property on a related model.\n - `polymorphic` A boolean value to mark the relationship as polymorphic\n\n #### One-To-Many\n To declare a one-to-many relationship between two models, use\n `belongsTo` in combination with `hasMany`, like this:\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment') comments;\n }\n ```\n\n ```app/models/comment.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class CommentModel extends Model {\n @belongsTo('post') post;\n }\n ```\n\n #### Many-To-Many\n To declare a many-to-many relationship between two models, use\n `hasMany`:\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('tag') tags;\n }\n ```\n\n ```app/models/tag.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class TagModel extends Model {\n @hasMany('post') posts;\n }\n ```\n\n You can avoid passing a string as the first parameter. In that case Ember Data\n will infer the type from the singularized key name.\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany tags;\n }\n ```\n\n will lookup for a Tag type.\n\n #### Explicit Inverses\n\n Ember Data will do its best to discover which relationships map to\n one another. In the one-to-many code above, for example, Ember Data\n can figure out that changing the `comments` relationship should update\n the `post` relationship on the inverse because post is the only\n relationship to that model.\n\n However, sometimes you may have multiple `belongsTo`/`hasMany` for the\n same type. You can specify which property on the related model is\n the inverse using `hasMany`'s `inverse` option:\n\n ```app/models/comment.js\n import Model, { belongsTo } from '@ember-data/model';\n\n export default class CommentModel extends Model {\n @belongsTo('post') onePost;\n @belongsTo('post') twoPost\n @belongsTo('post') redPost;\n @belongsTo('post') bluePost;\n }\n ```\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', {\n inverse: 'redPost'\n })\n comments;\n }\n ```\n\n You can also specify an inverse on a `belongsTo`, which works how\n you'd expect.\n\n #### Sync relationships\n\n Ember Data resolves sync relationships with the related resources\n available in its local store, hence it is expected these resources\n to be loaded before or along-side the primary resource.\n\n ```app/models/post.js\n import Model, { hasMany } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @hasMany('comment', {\n async: false\n })\n comments;\n }\n ```\n\n In contrast to async relationship, accessing a sync relationship\n will always return a [ManyArray](/ember-data/release/classes/ManyArray) instance\n containing the existing local resources. But it will error on access\n when any of the known related resources have not been loaded.\n\n ```\n post.get('comments').forEach((comment) => {\n\n });\n\n ```\n\n If you are using `links` with sync relationships, you have to use\n `ref.reload` to fetch the resources.\n\n @method hasMany\n @public\n @static\n @for @ember-data/model\n @param {String} type (optional) type of the relationship\n @param {Object} options (optional) a hash of options\n @return {Ember.computed} relationship\n*/\nfunction hasMany(type, options) {\n if (typeof type === 'object') {\n options = type;\n type = undefined;\n }\n assert(`The first argument to hasMany must be a string representing a model type key, not an instance of ${inspect(type)}. E.g., to define a relation to the Comment model, use hasMany('comment')`, typeof type === 'string' || typeof type === 'undefined');\n options = options || {};\n if (!('async' in options)) {\n options.async = true;\n }\n\n // Metadata about relationships is stored on the meta of\n // the relationship. This is used for introspection and\n // serialization. Note that `key` is populated lazily\n // the first time the CP is called.\n let meta = {\n type,\n options,\n isRelationship: true,\n kind: 'hasMany',\n name: 'Has Many',\n key: null\n };\n return computed({\n get(key) {\n if (DEBUG) {\n if (['_internalModel', 'currentState'].indexOf(key) !== -1) {\n throw new Error(`'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your hasMany on ${this.constructor.toString()}`);\n }\n }\n return LEGACY_SUPPORT.lookup(this).getHasMany(key);\n },\n set(key, records) {\n if (DEBUG) {\n if (['_internalModel', 'currentState'].indexOf(key) !== -1) {\n throw new Error(`'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your hasMany on ${this.constructor.toString()}`);\n }\n }\n const support = LEGACY_SUPPORT.lookup(this);\n this.store._backburner.join(() => {\n support.setDirtyHasMany(key, records);\n });\n return support.getHasMany(key);\n }\n }).meta(meta);\n}\nexport default computedMacroWithOptionalParams(hasMany);","import { getOwner } from '@ember/application';\nimport Model from './model';\n\n/*\n In case someone defined a relationship to a mixin, for example:\n ```\n import Model, { belongsTo, hasMany } from '@ember-data/model';\n import Mixin from '@ember/object/mixin';\n\n class CommentModel extends Model {\n @belongsTo('commentable', { polymorphic: true }) owner;\n }\n\n let Commentable = Mixin.create({\n @hasMany('comment') comments;\n });\n ```\n we want to look up a Commentable class which has all the necessary\n relationship meta data. Thus, we look up the mixin and create a mock\n Model, so we can access the relationship CPs of the mixin (`comments`)\n in this case\n */\nexport default function modelForMixin(store, normalizedModelName) {\n let owner = getOwner(store);\n let MaybeMixin = owner.factoryFor(`mixin:${normalizedModelName}`);\n let mixin = MaybeMixin && MaybeMixin.class;\n if (mixin) {\n let ModelForMixin = Model.extend(mixin);\n ModelForMixin.reopenClass({\n __isMixin: true,\n __mixin: mixin\n });\n //Cache the class as a model\n owner.register('model:' + normalizedModelName, ModelForMixin);\n }\n return owner.factoryFor(`model:${normalizedModelName}`);\n}","import { DEBUG } from '@glimmer/env';\n\n// Used by the store to normalize IDs entering the store. Despite the fact\n// that developers may provide IDs as numbers (e.g., `store.findRecord('person', 1)`),\n// it is important that internally we use strings, since IDs may be serialized\n// and lose type information. For example, Ember's router may put a record's\n// ID into the URL, and if we later try to deserialize that URL and find the\n// corresponding record, we will not know if it is a string or a number.\n\nfunction coerceId(id) {\n if (id === null || id === undefined || id === '') {\n return null;\n }\n if (typeof id === 'string') {\n return id;\n }\n if (typeof id === 'symbol') {\n return id.toString();\n }\n return '' + id;\n}\nexport function ensureStringId(id) {\n let normalized = null;\n if (typeof id === 'string') {\n normalized = id.length > 0 ? id : null;\n } else if (typeof id === 'number' && !isNaN(id)) {\n normalized = '' + id;\n }\n if (DEBUG && normalized === null) {\n throw new Error(`Expected id to be a string or number, received ${String(id)}`);\n }\n return normalized;\n}\nexport default coerceId;","import { assert, inspect, warn } from '@ember/debug';\nimport { coerceId, recordDataFor as peekRecordData } from '@ember-data/store/-private';\nexport function expandingGet(cache, key1, key2) {\n let mainCache = cache[key1] = cache[key1] || Object.create(null);\n return mainCache[key2];\n}\nexport function expandingSet(cache, key1, key2, value) {\n let mainCache = cache[key1] = cache[key1] || Object.create(null);\n mainCache[key2] = value;\n}\nexport function assertValidRelationshipPayload(graph, op) {\n const relationship = graph.get(op.record, op.field);\n assert(`Cannot update an implicit relationship`, isHasMany(relationship) || isBelongsTo(relationship));\n const payload = op.value;\n const {\n definition,\n identifier,\n state\n } = relationship;\n const {\n type\n } = identifier;\n const {\n field\n } = op;\n const {\n isAsync,\n kind\n } = definition;\n if (payload.links) {\n warn(`You pushed a record of type '${type}' with a relationship '${field}' configured as 'async: false'. You've included a link but no primary data, this may be an error in your payload. EmberData will treat this relationship as known-to-be-empty.`, isAsync || !!payload.data || state.hasReceivedData, {\n id: 'ds.store.push-link-for-sync-relationship'\n });\n } else if (payload.data) {\n if (kind === 'belongsTo') {\n assert(`A ${type} record was pushed into the store with the value of ${field} being ${inspect(payload.data)}, but ${field} is a belongsTo relationship so the value must not be an array. You should probably check your data payload or serializer.`, !Array.isArray(payload.data));\n assertRelationshipData(graph.store._store, identifier, payload.data, definition);\n } else if (kind === 'hasMany') {\n assert(`A ${type} record was pushed into the store with the value of ${field} being '${inspect(payload.data)}', but ${field} is a hasMany relationship so the value must be an array. You should probably check your data payload or serializer.`, Array.isArray(payload.data));\n if (Array.isArray(payload.data)) {\n for (let i = 0; i < payload.data.length; i++) {\n assertRelationshipData(graph.store._store, identifier, payload.data[i], definition);\n }\n }\n }\n }\n}\nexport function isNew(identifier) {\n if (!identifier.id) {\n return true;\n }\n const recordData = peekRecordData(identifier);\n return recordData ? isRelationshipRecordData(recordData) && recordData.isNew() : false;\n}\nfunction isRelationshipRecordData(recordData) {\n return typeof recordData.isNew === 'function';\n}\nexport function isBelongsTo(relationship) {\n return relationship.definition.kind === 'belongsTo';\n}\nexport function isImplicit(relationship) {\n return relationship.definition.isImplicit;\n}\nexport function isHasMany(relationship) {\n return relationship.definition.kind === 'hasMany';\n}\nexport function assertRelationshipData(store, identifier, data, meta) {\n assert(`A ${identifier.type} record was pushed into the store with the value of ${meta.key} being '${JSON.stringify(data)}', but ${meta.key} is a belongsTo relationship so the value must not be an array. You should probably check your data payload or serializer.`, !Array.isArray(data));\n assert(`Encountered a relationship identifier without a type for the ${meta.kind} relationship '${meta.key}' on <${identifier.type}:${identifier.id}>, expected a json-api identifier with type '${meta.type}' but found '${JSON.stringify(data)}'. Please check your serializer and make sure it is serializing the relationship payload into a JSON API format.`, data === null || typeof data.type === 'string' && data.type.length);\n assert(`Encountered a relationship identifier without an id for the ${meta.kind} relationship '${meta.key}' on <${identifier.type}:${identifier.id}>, expected a json-api identifier but found '${JSON.stringify(data)}'. Please check your serializer and make sure it is serializing the relationship payload into a JSON API format.`, data === null || !!coerceId(data.id));\n assert(`Encountered a relationship identifier with type '${data.type}' for the ${meta.kind} relationship '${meta.key}' on <${identifier.type}:${identifier.id}>, Expected a json-api identifier with type '${meta.type}'. No model was found for '${data.type}'.`, data === null || !data.type || store.getSchemaDefinitionService().doesTypeExist(data.type));\n}","import { createState } from '../../graph/-state';\nimport { isNew } from '../../graph/-utils';\nexport default class BelongsToRelationship {\n constructor(graph, definition, identifier) {\n this.graph = graph;\n this.store = graph.store;\n this.definition = definition;\n this.identifier = identifier;\n this._state = null;\n this.transactionRef = 0;\n this.meta = null;\n this.links = null;\n this.localState = null;\n this.remoteState = null;\n }\n get state() {\n let {\n _state\n } = this;\n if (!_state) {\n _state = this._state = createState();\n }\n return _state;\n }\n recordDataDidDematerialize() {\n if (this.definition.inverseIsImplicit) {\n return;\n }\n const inverseKey = this.definition.inverseKey;\n const callback = inverseIdentifier => {\n if (!inverseIdentifier || !this.graph.has(inverseIdentifier, inverseKey)) {\n return;\n }\n let relationship = this.graph.get(inverseIdentifier, inverseKey);\n\n // For canonical members, it is possible that inverseRecordData has already been associated to\n // to another record. For such cases, do not dematerialize the inverseRecordData\n if (relationship.definition.kind !== 'belongsTo' || !relationship.localState || this.identifier === relationship.localState) {\n relationship.inverseDidDematerialize(this.identifier);\n }\n };\n if (this.remoteState) {\n callback(this.remoteState);\n }\n if (this.localState && this.localState !== this.remoteState) {\n callback(this.localState);\n }\n }\n inverseDidDematerialize() {\n const inverseRecordData = this.localState;\n if (!this.definition.isAsync || inverseRecordData && isNew(inverseRecordData)) {\n // unloading inverse of a sync relationship is treated as a client-side\n // delete, so actually remove the models don't merely invalidate the cp\n // cache.\n // if the record being unloaded only exists on the client, we similarly\n // treat it as a client side delete\n if (this.localState === inverseRecordData && inverseRecordData !== null) {\n this.localState = null;\n }\n if (this.remoteState === inverseRecordData && inverseRecordData !== null) {\n this.remoteState = null;\n this.state.hasReceivedData = true;\n this.state.isEmpty = true;\n if (this.localState && !isNew(this.localState)) {\n this.localState = null;\n }\n }\n } else {\n this.state.hasDematerializedInverse = true;\n }\n this.notifyBelongsToChange();\n }\n getData() {\n let data;\n let payload = {};\n if (this.localState) {\n data = this.localState;\n }\n if (this.localState === null && this.state.hasReceivedData) {\n data = null;\n }\n if (this.links) {\n payload.links = this.links;\n }\n if (data !== undefined) {\n payload.data = data;\n }\n if (this.meta) {\n payload.meta = this.meta;\n }\n payload._relationship = this;\n return payload;\n }\n\n /*\n Removes the given RecordData from BOTH canonical AND current state.\n This method is useful when either a deletion or a rollback on a new record\n needs to entirely purge itself from an inverse relationship.\n */\n removeCompletelyFromOwn(recordData) {\n if (this.remoteState === recordData) {\n this.remoteState = null;\n }\n if (this.localState === recordData) {\n this.localState = null;\n // This allows dematerialized inverses to be rematerialized\n // we shouldn't be notifying here though, figure out where\n // a notification was missed elsewhere.\n this.notifyBelongsToChange();\n }\n }\n notifyBelongsToChange() {\n let recordData = this.identifier;\n this.store.notifyBelongsToChange(recordData.type, recordData.id, recordData.lid, this.definition.key);\n }\n clear() {\n this.localState = null;\n this.remoteState = null;\n this.state.hasReceivedData = false;\n this.state.isEmpty = true;\n }\n}","export function createState() {\n return {\n hasReceivedData: false,\n isEmpty: true,\n isStale: false,\n hasFailedLoadAttempt: false,\n shouldForceReload: false,\n hasDematerializedInverse: false\n };\n}","import { assert } from '@ember/debug';\nimport { createState } from '../../graph/-state';\nimport { isImplicit, isNew } from '../../graph/-utils';\nexport default class ManyRelationship {\n constructor(graph, definition, identifier) {\n this.graph = graph;\n this.store = graph.store;\n this.definition = definition;\n this.identifier = identifier;\n this._state = null;\n this.transactionRef = 0;\n this.members = new Set();\n this.canonicalMembers = new Set();\n this.meta = null;\n this.links = null;\n\n // persisted state\n this.canonicalState = [];\n // local client state\n this.currentState = [];\n this._willUpdateManyArray = false;\n this._pendingManyArrayUpdates = null;\n }\n get state() {\n let {\n _state\n } = this;\n if (!_state) {\n _state = this._state = createState();\n }\n return _state;\n }\n recordDataDidDematerialize() {\n if (this.definition.inverseIsImplicit) {\n return;\n }\n const inverseKey = this.definition.inverseKey;\n this.forAllMembers(inverseIdentifier => {\n inverseIdentifier;\n if (!inverseIdentifier || !this.graph.has(inverseIdentifier, inverseKey)) {\n return;\n }\n let relationship = this.graph.get(inverseIdentifier, inverseKey);\n assert(`expected no implicit`, !isImplicit(relationship));\n\n // For canonical members, it is possible that inverseRecordData has already been associated to\n // to another record. For such cases, do not dematerialize the inverseRecordData\n if (relationship.definition.kind !== 'belongsTo' || !relationship.localState || this.identifier === relationship.localState) {\n relationship.inverseDidDematerialize(this.identifier);\n }\n });\n }\n forAllMembers(callback) {\n // ensure we don't walk anything twice if an entry is\n // in both members and canonicalMembers\n let seen = Object.create(null);\n for (let i = 0; i < this.currentState.length; i++) {\n const inverseInternalModel = this.currentState[i];\n const id = inverseInternalModel.lid;\n if (!seen[id]) {\n seen[id] = true;\n callback(inverseInternalModel);\n }\n }\n for (let i = 0; i < this.canonicalState.length; i++) {\n const inverseInternalModel = this.canonicalState[i];\n const id = inverseInternalModel.lid;\n if (!seen[id]) {\n seen[id] = true;\n callback(inverseInternalModel);\n }\n }\n }\n clear() {\n this.members.clear();\n this.canonicalMembers.clear();\n this.currentState = [];\n this.canonicalState = [];\n }\n inverseDidDematerialize(inverseRecordData) {\n if (!this.definition.isAsync || inverseRecordData && isNew(inverseRecordData)) {\n // unloading inverse of a sync relationship is treated as a client-side\n // delete, so actually remove the models don't merely invalidate the cp\n // cache.\n // if the record being unloaded only exists on the client, we similarly\n // treat it as a client side delete\n this.removeCompletelyFromOwn(inverseRecordData);\n } else {\n this.state.hasDematerializedInverse = true;\n }\n this.notifyHasManyChange();\n }\n\n /*\n Removes the given RecordData from BOTH canonical AND current state.\n This method is useful when either a deletion or a rollback on a new record\n needs to entirely purge itself from an inverse relationship.\n */\n removeCompletelyFromOwn(recordData) {\n this.canonicalMembers.delete(recordData);\n this.members.delete(recordData);\n const canonicalIndex = this.canonicalState.indexOf(recordData);\n if (canonicalIndex !== -1) {\n this.canonicalState.splice(canonicalIndex, 1);\n }\n const currentIndex = this.currentState.indexOf(recordData);\n if (currentIndex !== -1) {\n this.currentState.splice(currentIndex, 1);\n // This allows dematerialized inverses to be rematerialized\n // we shouldn't be notifying here though, figure out where\n // a notification was missed elsewhere.\n this.notifyHasManyChange();\n }\n }\n notifyHasManyChange() {\n const {\n store,\n identifier: recordData\n } = this;\n store.notifyHasManyChange(recordData.type, recordData.id, recordData.lid, this.definition.key);\n }\n getData() {\n let payload = {};\n if (this.state.hasReceivedData) {\n payload.data = this.currentState.slice();\n }\n if (this.links) {\n payload.links = this.links;\n }\n if (this.meta) {\n payload.meta = this.meta;\n }\n return payload;\n }\n}","/**\n @module @ember-data/store\n*/\nexport default class ImplicitRelationship {\n constructor(graph, definition, identifier) {\n this.graph = graph;\n this.definition = definition;\n this.identifier = identifier;\n this.members = new Set();\n this.canonicalMembers = new Set();\n }\n addCanonicalRecordData(recordData, idx) {\n if (!this.canonicalMembers.has(recordData)) {\n this.canonicalMembers.add(recordData);\n this.members.add(recordData);\n }\n }\n addRecordData(recordData, idx) {\n if (!this.members.has(recordData)) {\n this.members.add(recordData);\n }\n }\n removeRecordData(recordData) {\n if (recordData && this.members.has(recordData)) {\n this.members.delete(recordData);\n }\n }\n removeCompletelyFromOwn(recordData) {\n this.canonicalMembers.delete(recordData);\n this.members.delete(recordData);\n }\n clear() {\n this.canonicalMembers.clear();\n this.members.clear();\n }\n}","import { assert } from '@ember/debug';\nimport { expandingGet, expandingSet } from './-utils';\nconst BOOL_LATER = null;\nconst STR_LATER = '';\nconst IMPLICIT_KEY_RAND = Date.now();\nfunction implicitKeyFor(type, key) {\n return `implicit-${type}:${key}${IMPLICIT_KEY_RAND}`;\n}\nfunction syncMeta(definition, inverseDefinition) {\n definition.inverseKind = inverseDefinition.kind;\n definition.inverseKey = inverseDefinition.key;\n definition.inverseType = inverseDefinition.type;\n definition.inverseIsAsync = inverseDefinition.isAsync;\n definition.inverseIsCollection = inverseDefinition.isCollection;\n definition.inverseIsPolymorphic = inverseDefinition.isPolymorphic;\n definition.inverseIsImplicit = inverseDefinition.isImplicit;\n}\nfunction upgradeMeta(meta) {\n let niceMeta = {};\n let options = meta.options;\n niceMeta.kind = meta.kind;\n niceMeta.key = meta.name;\n niceMeta.type = meta.type;\n niceMeta.isAsync = options && options.async !== undefined ? !!options.async : true;\n niceMeta.isImplicit = false;\n niceMeta.isCollection = meta.kind === 'hasMany';\n niceMeta.isPolymorphic = options && !!options.polymorphic;\n niceMeta.inverseKey = options && options.inverse || STR_LATER;\n niceMeta.inverseType = STR_LATER;\n niceMeta.inverseIsAsync = BOOL_LATER;\n niceMeta.inverseIsImplicit = options && options.inverse === null || BOOL_LATER;\n niceMeta.inverseIsCollection = BOOL_LATER;\n return niceMeta;\n}\nexport function isLHS(info, type, key) {\n let isSelfReferential = info.isSelfReferential;\n let isRelationship = key === info.lhs_relationshipName;\n if (isRelationship === true) {\n return isSelfReferential === true ||\n // itself\n type === info.lhs_baseModelName ||\n // base or non-polymorphic\n // if the other side is polymorphic then we need to scan our modelNames\n info.rhs_isPolymorphic && info.lhs_modelNames.indexOf(type) !== -1 // polymorphic\n ;\n }\n return false;\n}\nexport function isRHS(info, type, key) {\n let isSelfReferential = info.isSelfReferential;\n let isRelationship = key === info.rhs_relationshipName;\n if (isRelationship === true) {\n return isSelfReferential === true ||\n // itself\n type === info.rhs_baseModelName ||\n // base or non-polymorphic\n // if the other side is polymorphic then we need to scan our modelNames\n info.lhs_isPolymorphic && info.rhs_modelNames.indexOf(type) !== -1 // polymorphic\n ;\n }\n return false;\n}\nexport function upgradeDefinition(graph, identifier, propertyName, isImplicit = false) {\n const cache = graph._definitionCache;\n const storeWrapper = graph.store;\n const polymorphicLookup = graph._potentialPolymorphicTypes;\n const {\n type\n } = identifier;\n let cached = expandingGet(cache, type, propertyName);\n\n // CASE: We have a cached resolution (null if no relationship exists)\n if (cached !== undefined) {\n return cached;\n }\n assert(`Expected to find relationship definition in the cache for the implicit relationship ${propertyName}`, !isImplicit);\n let relationships = storeWrapper.relationshipsDefinitionFor(type);\n assert(`Expected to have a relationship definition for ${type} but none was found.`, relationships);\n let meta = relationships[propertyName];\n if (!meta) {\n if (polymorphicLookup[type]) {\n const altTypes = Object.keys(polymorphicLookup[type]);\n for (let i = 0; i < altTypes.length; i++) {\n let cached = expandingGet(cache, altTypes[i], propertyName);\n if (cached) {\n expandingSet(cache, type, propertyName, cached);\n return cached;\n }\n }\n }\n\n // CASE: We don't have a relationship at all\n // we should only hit this in prod\n assert(`Expected to find a relationship definition for ${type}.${propertyName} but none was found.`, meta);\n cache[type][propertyName] = null;\n return null;\n }\n const definition = upgradeMeta(meta);\n let inverseDefinition;\n let inverseKey;\n const inverseType = definition.type;\n\n // CASE: Inverse is explicitly null\n if (definition.inverseKey === null) {\n assert(`Expected the inverse model to exist`, storeWrapper._store.modelFor(inverseType));\n inverseDefinition = null;\n } else {\n inverseKey = storeWrapper.inverseForRelationship(type, propertyName);\n\n // CASE: Inverse resolves to null\n if (!inverseKey) {\n inverseDefinition = null;\n } else {\n // CASE: We have an explicit inverse or were able to resolve one\n let inverseDefinitions = storeWrapper.relationshipsDefinitionFor(inverseType);\n assert(`Expected to have a relationship definition for ${inverseType} but none was found.`, inverseDefinitions);\n let meta = inverseDefinitions[inverseKey];\n assert(`Expected to find a relationship definition for ${inverseType}.${inverseKey} but none was found.`, meta);\n inverseDefinition = upgradeMeta(meta);\n }\n }\n\n // CASE: We have no inverse\n if (!inverseDefinition) {\n // polish off meta\n inverseKey = implicitKeyFor(type, propertyName);\n inverseDefinition = {\n kind: 'implicit',\n key: inverseKey,\n type: type,\n isAsync: false,\n isImplicit: true,\n isCollection: true,\n // with implicits any number of records could point at us\n isPolymorphic: false\n };\n syncMeta(definition, inverseDefinition);\n syncMeta(inverseDefinition, definition);\n const info = {\n lhs_key: `${type}:${propertyName}`,\n lhs_modelNames: [type],\n lhs_baseModelName: type,\n lhs_relationshipName: propertyName,\n lhs_definition: definition,\n lhs_isPolymorphic: definition.isPolymorphic,\n rhs_key: '',\n rhs_modelNames: [],\n rhs_baseModelName: inverseType,\n rhs_relationshipName: '',\n rhs_definition: inverseDefinition,\n rhs_isPolymorphic: false,\n hasInverse: false,\n isSelfReferential: type === inverseType,\n // this could be wrong if we are self-referential but also polymorphic\n isReflexive: false // we can't be reflexive if we don't define an inverse\n };\n expandingSet(cache, inverseType, inverseKey, info);\n expandingSet(cache, type, propertyName, info);\n return info;\n }\n\n // CASE: We do have an inverse\n const baseType = inverseDefinition.type;\n\n // TODO we want to assert this but this breaks all of our shoddily written tests\n /*\n if (DEBUG) {\n let inverseDoubleCheck = inverseMeta.type.inverseFor(inverseRelationshipName, store);\n assert(`The ${inverseBaseModelName}:${inverseRelationshipName} relationship declares 'inverse: null', but it was resolved as the inverse for ${baseModelName}:${relationshipName}.`, inverseDoubleCheck);\n }\n */\n // CASE: We may have already discovered the inverse for the baseModelName\n // CASE: We have already discovered the inverse\n cached = expandingGet(cache, baseType, propertyName) || expandingGet(cache, inverseType, inverseKey);\n if (cached) {\n // TODO this assert can be removed if the above assert is enabled\n assert(`The ${inverseType}:${inverseKey} relationship declares 'inverse: null', but it was resolved as the inverse for ${type}:${propertyName}.`, cached.hasInverse !== false);\n let isLHS = cached.lhs_baseModelName === baseType;\n let modelNames = isLHS ? cached.lhs_modelNames : cached.rhs_modelNames;\n // make this lookup easier in the future by caching the key\n modelNames.push(type);\n expandingSet(cache, type, propertyName, cached);\n return cached;\n }\n\n // this is our first time so polish off the metas\n syncMeta(definition, inverseDefinition);\n syncMeta(inverseDefinition, definition);\n const lhs_modelNames = [type];\n if (type !== baseType) {\n lhs_modelNames.push(baseType);\n }\n const isSelfReferential = type === inverseType;\n const info = {\n lhs_key: `${baseType}:${propertyName}`,\n lhs_modelNames,\n lhs_baseModelName: baseType,\n lhs_relationshipName: propertyName,\n lhs_definition: definition,\n lhs_isPolymorphic: definition.isPolymorphic,\n rhs_key: `${inverseType}:${inverseKey}`,\n rhs_modelNames: [inverseType],\n rhs_baseModelName: inverseType,\n rhs_relationshipName: inverseKey,\n rhs_definition: inverseDefinition,\n rhs_isPolymorphic: inverseDefinition.isPolymorphic,\n hasInverse: true,\n isSelfReferential,\n isReflexive: isSelfReferential && propertyName === inverseKey\n };\n\n // Create entries for the baseModelName as well as modelName to speed up\n // inverse lookups\n expandingSet(cache, baseType, propertyName, info);\n expandingSet(cache, type, propertyName, info);\n\n // Greedily populate the inverse\n expandingSet(cache, inverseType, inverseKey, info);\n return info;\n}","import { assert } from '@ember/debug';\nimport { isBelongsTo, isHasMany, isNew } from '../-utils';\n/*\n case many:1\n ========\n In a bi-directional graph with Many:1 edges, adding a value\n results in up-to 3 discrete value transitions, while removing\n a value is only 2 transitions.\n\n For adding C to A\n If: A <<-> B, C <->> D is the initial state,\n and: B <->> A <<-> C, D is the final state\n\n then we would undergo the following transitions.\n\n add C to A\n remove C from D\n add A to C\n\n For removing B from A\n If: A <<-> B, C <->> D is the initial state,\n and: A, B, C <->> D is the final state\n\n then we would undergo the following transitions.\n\n remove B from A\n remove A from B\n\n case many:many\n ===========\n In a bi-directional graph with Many:Many edges, adding or\n removing a value requires only 2 value transitions.\n\n For Adding\n If: A<<->>B, C<<->>D is the initial state (double arrows representing the many side)\n And: D<<->>C<<->>A<<->>B is the final state\n\n Then we would undergo two transitions.\n\n add C to A.\n add A to C\n\n For Removing\n If: A<<->>B, C<<->>D is the initial state (double arrows representing the many side)\n And: A, B, C<<->>D is the final state\n\n Then we would undergo two transitions.\n\n remove B from A\n remove A from B\n\n case many:?\n ========\n In a uni-directional graph with Many:? edges (modeled in EmberData with `inverse:null`) with\n artificial (implicit) inverses, replacing a value results in 2 discrete value transitions.\n This is because a Many:? relationship is effectively Many:Many.\n */\nexport default function replaceRelatedRecords(graph, op, isRemote) {\n if (isRemote) {\n replaceRelatedRecordsRemote(graph, op, isRemote);\n } else {\n replaceRelatedRecordsLocal(graph, op, isRemote);\n }\n}\nfunction replaceRelatedRecordsLocal(graph, op, isRemote) {\n const identifiers = op.value;\n const relationship = graph.get(op.record, op.field);\n assert(`expected hasMany relationship`, isHasMany(relationship));\n relationship.state.hasReceivedData = true;\n\n // cache existing state\n const {\n currentState,\n members,\n definition\n } = relationship;\n const newValues = new Set(identifiers);\n const identifiersLength = identifiers.length;\n const newState = new Array(newValues.size);\n const newMembership = new Set();\n\n // wipe existing state\n relationship.members = newMembership;\n relationship.currentState = newState;\n const {\n type\n } = relationship.definition;\n let changed = false;\n const currentLength = currentState.length;\n const iterationLength = currentLength > identifiersLength ? currentLength : identifiersLength;\n const equalLength = currentLength === identifiersLength;\n for (let i = 0, j = 0; i < iterationLength; i++) {\n let adv = false;\n if (i < identifiersLength) {\n const identifier = identifiers[i];\n // skip processing if we encounter a duplicate identifier in the array\n if (!newMembership.has(identifier)) {\n if (type !== identifier.type) {\n graph.registerPolymorphicType(type, identifier.type);\n }\n newState[j] = identifier;\n adv = true;\n newMembership.add(identifier);\n if (!members.has(identifier)) {\n changed = true;\n addToInverse(graph, identifier, definition.inverseKey, op.record, isRemote);\n }\n }\n }\n if (i < currentLength) {\n const identifier = currentState[i];\n\n // detect reordering\n if (!newMembership.has(identifier)) {\n if (equalLength && newState[i] !== identifier) {\n changed = true;\n }\n if (!newValues.has(identifier)) {\n changed = true;\n removeFromInverse(graph, identifier, definition.inverseKey, op.record, isRemote);\n }\n }\n }\n if (adv) {\n j++;\n }\n }\n if (changed) {\n relationship.notifyHasManyChange();\n }\n}\nfunction replaceRelatedRecordsRemote(graph, op, isRemote) {\n const identifiers = op.value;\n const relationship = graph.get(op.record, op.field);\n assert(`You can only '${op.op}' on a hasMany relationship. ${op.record.type}.${op.field} is a ${relationship.definition.kind}`, isHasMany(relationship));\n if (isRemote) {\n graph._addToTransaction(relationship);\n }\n relationship.state.hasReceivedData = true;\n\n // cache existing state\n const {\n canonicalState,\n canonicalMembers,\n definition\n } = relationship;\n const newValues = new Set(identifiers);\n const identifiersLength = identifiers.length;\n const newState = new Array(newValues.size);\n const newMembership = new Set();\n\n // wipe existing state\n relationship.canonicalMembers = newMembership;\n relationship.canonicalState = newState;\n const {\n type\n } = relationship.definition;\n let changed = false;\n const canonicalLength = canonicalState.length;\n const iterationLength = canonicalLength > identifiersLength ? canonicalLength : identifiersLength;\n const equalLength = canonicalLength === identifiersLength;\n for (let i = 0, j = 0; i < iterationLength; i++) {\n let adv = false;\n if (i < identifiersLength) {\n const identifier = identifiers[i];\n if (!newMembership.has(identifier)) {\n if (type !== identifier.type) {\n graph.registerPolymorphicType(type, identifier.type);\n }\n newState[j] = identifier;\n newMembership.add(identifier);\n adv = true;\n if (!canonicalMembers.has(identifier)) {\n changed = true;\n addToInverse(graph, identifier, definition.inverseKey, op.record, isRemote);\n }\n }\n }\n if (i < canonicalLength) {\n const identifier = canonicalState[i];\n if (!newMembership.has(identifier)) {\n // detect reordering\n if (equalLength && newState[j] !== identifier) {\n changed = true;\n }\n if (!newValues.has(identifier)) {\n changed = true;\n removeFromInverse(graph, identifier, definition.inverseKey, op.record, isRemote);\n }\n }\n }\n if (adv) {\n j++;\n }\n }\n if (changed) {\n flushCanonical(graph, relationship);\n /*\n replaceRelatedRecordsLocal(\n graph,\n {\n op: op.op,\n record: op.record,\n field: op.field,\n value: canonicalState,\n },\n false\n );*/\n } else {\n // preserve legacy behavior we want to change but requires some sort\n // of deprecation.\n flushCanonical(graph, relationship);\n }\n}\nexport function addToInverse(graph, identifier, key, value, isRemote) {\n const relationship = graph.get(identifier, key);\n const {\n type\n } = relationship.definition;\n if (type !== value.type) {\n graph.registerPolymorphicType(type, value.type);\n }\n if (isBelongsTo(relationship)) {\n relationship.state.hasReceivedData = true;\n relationship.state.isEmpty = false;\n if (isRemote) {\n graph._addToTransaction(relationship);\n if (relationship.remoteState !== null) {\n removeFromInverse(graph, relationship.remoteState, relationship.definition.inverseKey, identifier, isRemote);\n }\n relationship.remoteState = value;\n }\n if (relationship.localState !== value) {\n if (!isRemote && relationship.localState) {\n removeFromInverse(graph, relationship.localState, relationship.definition.inverseKey, identifier, isRemote);\n }\n relationship.localState = value;\n relationship.notifyBelongsToChange();\n }\n } else if (isHasMany(relationship)) {\n if (isRemote) {\n if (!relationship.canonicalMembers.has(value)) {\n graph._addToTransaction(relationship);\n relationship.canonicalState.push(value);\n relationship.canonicalMembers.add(value);\n relationship.state.hasReceivedData = true;\n flushCanonical(graph, relationship);\n }\n } else {\n if (!relationship.members.has(value)) {\n relationship.currentState.push(value);\n relationship.members.add(value);\n relationship.state.hasReceivedData = true;\n relationship.notifyHasManyChange();\n }\n }\n } else {\n if (isRemote) {\n relationship.addCanonicalRecordData(value);\n } else {\n relationship.addRecordData(value);\n }\n }\n}\nexport function notifyInverseOfPotentialMaterialization(graph, identifier, key, value, isRemote) {\n const relationship = graph.get(identifier, key);\n if (isHasMany(relationship) && isRemote && relationship.canonicalMembers.has(value)) {\n relationship.notifyHasManyChange();\n }\n}\nexport function removeFromInverse(graph, identifier, key, value, isRemote) {\n const relationship = graph.get(identifier, key);\n if (isBelongsTo(relationship)) {\n relationship.state.isEmpty = true;\n if (isRemote) {\n graph._addToTransaction(relationship);\n relationship.remoteState = null;\n }\n if (relationship.localState === value) {\n relationship.localState = null;\n relationship.notifyBelongsToChange();\n }\n } else if (isHasMany(relationship)) {\n if (isRemote) {\n graph._addToTransaction(relationship);\n let index = relationship.canonicalState.indexOf(value);\n if (index !== -1) {\n relationship.canonicalMembers.delete(value);\n relationship.canonicalState.splice(index, 1);\n }\n }\n let index = relationship.currentState.indexOf(value);\n if (index !== -1) {\n relationship.members.delete(value);\n relationship.currentState.splice(index, 1);\n }\n relationship.notifyHasManyChange();\n } else {\n if (isRemote) {\n relationship.removeCompletelyFromOwn(value);\n } else {\n relationship.removeRecordData(value);\n }\n }\n}\nexport function syncRemoteToLocal(rel) {\n let toSet = rel.canonicalState;\n let newRecordDatas = rel.currentState.filter(recordData => isNew(recordData) && toSet.indexOf(recordData) === -1);\n let existingState = rel.currentState;\n rel.currentState = toSet.concat(newRecordDatas);\n let members = rel.members = new Set();\n rel.canonicalMembers.forEach(v => members.add(v));\n for (let i = 0; i < newRecordDatas.length; i++) {\n members.add(newRecordDatas[i]);\n }\n\n // TODO always notifying fails only one test and we should probably do away with it\n if (existingState.length !== rel.currentState.length) {\n rel.notifyHasManyChange();\n } else {\n for (let i = 0; i < existingState.length; i++) {\n if (existingState[i] !== rel.currentState[i]) {\n rel.notifyHasManyChange();\n break;\n }\n }\n }\n}\nfunction flushCanonical(graph, rel) {\n graph._scheduleLocalSync(rel);\n}","import { assert } from '@ember/debug';\nimport { isHasMany } from '../-utils';\nimport { addToInverse } from './replace-related-records';\nexport default function addToRelatedRecords(graph, op, isRemote) {\n const {\n record,\n value,\n index\n } = op;\n const relationship = graph.get(record, op.field);\n assert(`You can only '${op.op}' on a hasMany relationship. ${record.type}.${op.field} is a ${relationship.definition.kind}`, isHasMany(relationship));\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n addRelatedRecord(graph, relationship, record, value[i], index !== undefined ? index + i : index, isRemote);\n }\n } else {\n addRelatedRecord(graph, relationship, record, value, index, isRemote);\n }\n relationship.notifyHasManyChange();\n}\nfunction addRelatedRecord(graph, relationship, record, value, index, isRemote) {\n assert(`expected an identifier to add to the relationship`, value);\n const {\n members,\n currentState\n } = relationship;\n if (members.has(value)) {\n return;\n }\n const {\n type\n } = relationship.definition;\n if (type !== value.type) {\n graph.registerPolymorphicType(value.type, type);\n }\n relationship.state.hasReceivedData = true;\n members.add(value);\n if (index === undefined) {\n currentState.push(value);\n } else {\n currentState.splice(index, 0, value);\n }\n addToInverse(graph, value, relationship.definition.inverseKey, record, isRemote);\n}","import { assert } from '@ember/debug';\nimport { isHasMany } from '../-utils';\nimport { removeFromInverse } from './replace-related-records';\nexport default function removeFromRelatedRecords(graph, op, isRemote) {\n const {\n record,\n value\n } = op;\n const relationship = graph.get(record, op.field);\n assert(`You can only '${op.op}' on a hasMany relationship. ${record.type}.${op.field} is a ${relationship.definition.kind}`, isHasMany(relationship));\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n removeRelatedRecord(graph, relationship, record, value[i], isRemote);\n }\n } else {\n removeRelatedRecord(graph, relationship, record, value, isRemote);\n }\n relationship.notifyHasManyChange();\n}\nfunction removeRelatedRecord(graph, relationship, record, value, isRemote) {\n assert(`expected an identifier to add to the relationship`, value);\n const {\n members,\n currentState\n } = relationship;\n if (!members.has(value)) {\n return;\n }\n members.delete(value);\n let index = currentState.indexOf(value);\n assert(`expected members and currentState to be in sync`, index !== -1);\n currentState.splice(index, 1);\n removeFromInverse(graph, value, relationship.definition.inverseKey, record, isRemote);\n}","/*\n This method normalizes a link to an \"links object\". If the passed link is\n already an object it's returned without any modifications.\n\n See http://jsonapi.org/format/#document-links for more information.\n*/\nexport default function _normalizeLink(link) {\n switch (typeof link) {\n case 'object':\n return link;\n case 'string':\n return {\n href: link\n };\n }\n}","import { assert } from '@ember/debug';\nimport { DEBUG } from '@glimmer/env';\nimport { WeakCache } from '@ember-data/store/-private';\nimport BelongsToRelationship from '../relationships/state/belongs-to';\nimport ManyRelationship from '../relationships/state/has-many';\nimport ImplicitRelationship from '../relationships/state/implicit';\nimport { isLHS, upgradeDefinition } from './-edge-definition';\nimport { assertValidRelationshipPayload, isBelongsTo, isHasMany, isImplicit } from './-utils';\nimport addToRelatedRecords from './operations/add-to-related-records';\nimport removeFromRelatedRecords from './operations/remove-from-related-records';\nimport replaceRelatedRecord from './operations/replace-related-record';\nimport replaceRelatedRecords, { syncRemoteToLocal } from './operations/replace-related-records';\nimport updateRelationshipOperation from './operations/update-relationship';\nconst Graphs = new WeakCache(DEBUG ? 'graph' : '');\nGraphs._generator = wrapper => {\n const graph = new Graph(wrapper);\n\n // in DEBUG we attach the graph to the main store for improved debuggability\n if (DEBUG) {\n Graphs.set(wrapper._store, graph);\n }\n return graph;\n};\nfunction isStore(maybeStore) {\n return maybeStore._instanceCache !== undefined;\n}\nfunction getWrapper(store) {\n return isStore(store) ? store._instanceCache._storeWrapper : store;\n}\nexport function peekGraph(store) {\n return Graphs.get(getWrapper(store));\n}\nexport function graphFor(store) {\n return Graphs.lookup(getWrapper(store));\n}\n\n/*\n * Graph acts as the cache for relationship data. It allows for\n * us to ask about and update relationships for a given Identifier\n * without requiring other objects for that Identifier to be\n * instantiated (such as `InternalModel`, `RecordData` or a `Record`)\n *\n * This also allows for us to make more substantive changes to relationships\n * with increasingly minor alterations to other portions of the internals\n * over time.\n *\n * The graph is made up of nodes and edges. Each unique identifier gets\n * its own node, which is a dictionary with a list of that node's edges\n * (or connections) to other nodes. In `Model` terms, a node represents a\n * record instance, with each key (an edge) in the dictionary correlating\n * to either a `hasMany` or `belongsTo` field on that record instance.\n *\n * The value for each key, or `edge` is the identifier(s) the node relates\n * to in the graph from that key.\n */\nexport class Graph {\n constructor(store) {\n this._definitionCache = Object.create(null);\n this._potentialPolymorphicTypes = Object.create(null);\n this.identifiers = new Map();\n this.store = store;\n this._willSyncRemote = false;\n this._willSyncLocal = false;\n this._pushedUpdates = {\n belongsTo: [],\n hasMany: [],\n deletions: []\n };\n this._updatedRelationships = new Set();\n this._transaction = null;\n }\n has(identifier, propertyName) {\n let relationships = this.identifiers.get(identifier);\n if (!relationships) {\n return false;\n }\n return relationships[propertyName] !== undefined;\n }\n get(identifier, propertyName) {\n assert(`expected propertyName`, propertyName);\n let relationships = this.identifiers.get(identifier);\n if (!relationships) {\n relationships = Object.create(null);\n this.identifiers.set(identifier, relationships);\n }\n let relationship = relationships[propertyName];\n if (!relationship) {\n const info = upgradeDefinition(this, identifier, propertyName);\n assert(`Could not determine relationship information for ${identifier.type}.${propertyName}`, info !== null);\n const meta = isLHS(info, identifier.type, propertyName) ? info.lhs_definition : info.rhs_definition;\n const Klass = meta.kind === 'hasMany' ? ManyRelationship : meta.kind === 'belongsTo' ? BelongsToRelationship : ImplicitRelationship;\n relationship = relationships[propertyName] = new Klass(this, meta, identifier);\n }\n return relationship;\n }\n\n /*\n * Allows for the graph to dynamically discover polymorphic connections\n * without needing to walk prototype chains.\n *\n * Used by edges when an added `type` does not match the expected `type`\n * for that edge.\n *\n * Currently we assert before calling this. For a public API we will want\n * to call out to the schema manager to ask if we should consider these\n * types as equivalent for a given relationship.\n */\n registerPolymorphicType(type1, type2) {\n const typeCache = this._potentialPolymorphicTypes;\n let t1 = typeCache[type1];\n if (!t1) {\n t1 = typeCache[type1] = Object.create(null);\n }\n t1[type2] = true;\n let t2 = typeCache[type2];\n if (!t2) {\n t2 = typeCache[type2] = Object.create(null);\n }\n t2[type1] = true;\n }\n\n /*\n TODO move this comment somewhere else\n implicit relationships are relationships which have not been declared but the inverse side exists on\n another record somewhere\n For example if there was:\n ```app/models/comment.js\n import Model, { attr } from '@ember-data/model';\n export default class Comment extends Model {\n @attr text;\n }\n ```\n and there is also:\n ```app/models/post.js\n import Model, { attr, hasMany } from '@ember-data/model';\n export default class Post extends Model {\n @attr title;\n @hasMany('comment') comments;\n }\n ```\n Then we would have a implicit 'post' relationship for the comment record in order\n to be do things like remove the comment from the post if the comment were to be deleted.\n */\n\n isReleasable(identifier) {\n const relationships = this.identifiers.get(identifier);\n if (!relationships) {\n return true;\n }\n const keys = Object.keys(relationships);\n for (let i = 0; i < keys.length; i++) {\n const relationship = relationships[keys[i]];\n assert(`Expected a relationship`, relationship);\n if (relationship.definition.inverseIsAsync) {\n return false;\n }\n }\n return true;\n }\n unload(identifier) {\n const relationships = this.identifiers.get(identifier);\n if (relationships) {\n // cleans up the graph but retains some nodes\n // to allow for rematerialization\n Object.keys(relationships).forEach(key => {\n let rel = relationships[key];\n destroyRelationship(rel);\n if (isImplicit(rel)) {\n delete relationships[key];\n }\n });\n }\n }\n remove(identifier) {\n this.unload(identifier);\n this.identifiers.delete(identifier);\n }\n\n /*\n * Remote state changes\n */\n push(op) {\n if (op.op === 'deleteRecord') {\n this._pushedUpdates.deletions.push(op);\n } else if (op.op === 'replaceRelatedRecord') {\n this._pushedUpdates.belongsTo.push(op);\n } else {\n const relationship = this.get(op.record, op.field);\n assert(`Cannot push a remote update for an implicit relationship`, !relationship.definition.isImplicit);\n this._pushedUpdates[relationship.definition.kind].push(op);\n }\n if (!this._willSyncRemote) {\n this._willSyncRemote = true;\n const backburner = this.store._store._backburner;\n backburner.schedule('coalesce', this, this._flushRemoteQueue);\n }\n }\n\n /*\n * Local state changes\n */\n\n update(op, isRemote = false) {\n assert(`Cannot update an implicit relationship`, op.op === 'deleteRecord' || !isImplicit(this.get(op.record, op.field)));\n switch (op.op) {\n case 'updateRelationship':\n assert(`Can only perform the operation updateRelationship on remote state`, isRemote);\n if (DEBUG) {\n // in debug, assert payload validity eagerly\n // TODO add deprecations/assertion here for duplicates\n assertValidRelationshipPayload(this, op);\n }\n updateRelationshipOperation(this, op);\n break;\n case 'deleteRecord':\n {\n assert(`Can only perform the operation deleteRelationship on remote state`, isRemote);\n const identifier = op.record;\n const relationships = this.identifiers.get(identifier);\n if (relationships) {\n Object.keys(relationships).forEach(key => {\n const rel = relationships[key];\n // works together with the has check\n delete relationships[key];\n removeCompletelyFromInverse(rel);\n });\n this.identifiers.delete(identifier);\n }\n break;\n }\n case 'replaceRelatedRecord':\n replaceRelatedRecord(this, op, isRemote);\n break;\n case 'addToRelatedRecords':\n addToRelatedRecords(this, op, isRemote);\n break;\n case 'removeFromRelatedRecords':\n removeFromRelatedRecords(this, op, isRemote);\n break;\n case 'replaceRelatedRecords':\n replaceRelatedRecords(this, op, isRemote);\n break;\n default:\n assert(`No local relationship update operation exists for '${op.op}'`);\n }\n }\n _scheduleLocalSync(relationship) {\n this._updatedRelationships.add(relationship);\n if (!this._willSyncLocal) {\n this._willSyncLocal = true;\n const backburner = this.store._store._backburner;\n backburner.schedule('sync', this, this._flushLocalQueue);\n }\n }\n _flushRemoteQueue() {\n if (!this._willSyncRemote) {\n return;\n }\n this._transaction = new Set();\n this._willSyncRemote = false;\n const {\n deletions,\n hasMany,\n belongsTo\n } = this._pushedUpdates;\n this._pushedUpdates.deletions = [];\n this._pushedUpdates.hasMany = [];\n this._pushedUpdates.belongsTo = [];\n for (let i = 0; i < deletions.length; i++) {\n this.update(deletions[i], true);\n }\n for (let i = 0; i < hasMany.length; i++) {\n this.update(hasMany[i], true);\n }\n for (let i = 0; i < belongsTo.length; i++) {\n this.update(belongsTo[i], true);\n }\n this._finalize();\n }\n _addToTransaction(relationship) {\n assert(`expected a transaction`, this._transaction !== null);\n relationship.transactionRef++;\n this._transaction.add(relationship);\n }\n _finalize() {\n if (this._transaction) {\n this._transaction.forEach(v => v.transactionRef = 0);\n this._transaction = null;\n }\n }\n _flushLocalQueue() {\n if (!this._willSyncLocal) {\n return;\n }\n this._willSyncLocal = false;\n let updated = this._updatedRelationships;\n this._updatedRelationships = new Set();\n updated.forEach(syncRemoteToLocal);\n }\n willDestroy() {\n this.identifiers.clear();\n this.store = null;\n }\n destroy() {\n Graphs.delete(this.store);\n if (DEBUG) {\n Graphs.delete(this.store._store);\n }\n }\n}\n\n// Handle dematerialization for relationship `rel`. In all cases, notify the\n// relationship of the dematerialization: this is done so the relationship can\n// notify its inverse which needs to update state\n//\n// If the inverse is sync, unloading this record is treated as a client-side\n// delete, so we remove the inverse records from this relationship to\n// disconnect the graph. Because it's not async, we don't need to keep around\n// the internalModel as an id-wrapper for references and because the graph is\n// disconnected we can actually destroy the internalModel when checking for\n// orphaned models.\nfunction destroyRelationship(rel) {\n if (isImplicit(rel)) {\n if (rel.graph.isReleasable(rel.identifier)) {\n removeCompletelyFromInverse(rel);\n }\n return;\n }\n rel.recordDataDidDematerialize();\n if (!rel.definition.inverseIsImplicit && !rel.definition.inverseIsAsync) {\n rel.state.isStale = true;\n rel.clear();\n\n // necessary to clear relationships in the ui from dematerialized records\n // hasMany is managed by InternalModel which calls `retreiveLatest` after\n // dematerializing the recordData instance.\n // but sync belongsTo require this since they don't have a proxy to update.\n // so we have to notify so it will \"update\" to null.\n // we should discuss whether we still care about this, probably fine to just\n // leave the ui relationship populated since the record is destroyed and\n // internally we've fully cleaned up.\n if (!rel.definition.isAsync) {\n if (isBelongsTo(rel)) {\n rel.notifyBelongsToChange();\n } else {\n rel.notifyHasManyChange();\n }\n }\n }\n}\nfunction removeCompletelyFromInverse(relationship) {\n // we actually want a union of members and canonicalMembers\n // they should be disjoint but currently are not due to a bug\n const seen = Object.create(null);\n const {\n identifier\n } = relationship;\n const {\n inverseKey\n } = relationship.definition;\n const unload = inverseIdentifier => {\n const id = inverseIdentifier.lid;\n if (seen[id] === undefined) {\n if (relationship.graph.has(inverseIdentifier, inverseKey)) {\n relationship.graph.get(inverseIdentifier, inverseKey).removeCompletelyFromOwn(identifier);\n }\n seen[id] = true;\n }\n };\n if (isBelongsTo(relationship)) {\n if (relationship.localState) {\n unload(relationship.localState);\n }\n if (relationship.remoteState) {\n unload(relationship.remoteState);\n }\n if (!relationship.definition.isAsync) {\n relationship.clear();\n }\n relationship.localState = null;\n } else if (isHasMany(relationship)) {\n relationship.members.forEach(unload);\n relationship.canonicalMembers.forEach(unload);\n if (!relationship.definition.isAsync) {\n relationship.clear();\n relationship.notifyHasManyChange();\n }\n } else {\n relationship.members.forEach(unload);\n relationship.canonicalMembers.forEach(unload);\n relationship.clear();\n }\n}","import { assert, warn } from '@ember/debug';\nimport _normalizeLink from '../../normalize-link';\nimport { isBelongsTo, isHasMany } from '../-utils';\n/*\n Updates the \"canonical\" or \"remote\" state of a relationship, replacing any existing\n state and blowing away any local changes (excepting new records).\n*/\nexport default function updateRelationshipOperation(graph, op) {\n const relationship = graph.get(op.record, op.field);\n assert(`Cannot update an implicit relationship`, isHasMany(relationship) || isBelongsTo(relationship));\n const {\n definition,\n state,\n identifier\n } = relationship;\n const {\n isCollection\n } = definition;\n const payload = op.value;\n let hasRelationshipDataProperty = false;\n let hasUpdatedLink = false;\n if (payload.meta) {\n relationship.meta = payload.meta;\n }\n if (payload.data !== undefined) {\n hasRelationshipDataProperty = true;\n if (isCollection) {\n // TODO deprecate this case. We\n // have tests saying we support it.\n if (payload.data === null) {\n payload.data = [];\n }\n assert(`Expected an array`, Array.isArray(payload.data));\n graph.update({\n op: 'replaceRelatedRecords',\n record: identifier,\n field: op.field,\n value: payload.data.map(i => graph.store.identifierCache.getOrCreateRecordIdentifier(i))\n }, true);\n } else {\n graph.update({\n op: 'replaceRelatedRecord',\n record: identifier,\n field: op.field,\n value: payload.data ? graph.store.identifierCache.getOrCreateRecordIdentifier(payload.data) : null\n }, true);\n }\n } else if (definition.isAsync === false && !state.hasReceivedData) {\n hasRelationshipDataProperty = true;\n if (isCollection) {\n graph.update({\n op: 'replaceRelatedRecords',\n record: identifier,\n field: op.field,\n value: []\n }, true);\n } else {\n graph.update({\n op: 'replaceRelatedRecord',\n record: identifier,\n field: op.field,\n value: null\n }, true);\n }\n }\n if (payload.links) {\n let originalLinks = relationship.links;\n relationship.links = payload.links;\n if (payload.links.related) {\n let relatedLink = _normalizeLink(payload.links.related);\n let currentLink = originalLinks && originalLinks.related ? _normalizeLink(originalLinks.related) : null;\n let currentLinkHref = currentLink ? currentLink.href : null;\n if (relatedLink && relatedLink.href && relatedLink.href !== currentLinkHref) {\n warn(`You pushed a record of type '${identifier.type}' with a relationship '${definition.key}' configured as 'async: false'. You've included a link but no primary data, this may be an error in your payload. EmberData will treat this relationship as known-to-be-empty.`, definition.isAsync || state.hasReceivedData, {\n id: 'ds.store.push-link-for-sync-relationship'\n });\n assert(`You have pushed a record of type '${identifier.type}' with '${definition.key}' as a link, but the value of that link is not a string.`, typeof relatedLink.href === 'string' || relatedLink.href === null);\n hasUpdatedLink = true;\n }\n }\n }\n\n /*\n Data being pushed into the relationship might contain only data or links,\n or a combination of both.\n IF contains only data\n IF contains both links and data\n state.isEmpty -> true if is empty array (has-many) or is null (belongs-to)\n state.hasReceivedData -> true\n hasDematerializedInverse -> false\n state.isStale -> false\n allInverseRecordsAreLoaded -> run-check-to-determine\n IF contains only links\n state.isStale -> true\n */\n relationship.state.hasFailedLoadAttempt = false;\n if (hasRelationshipDataProperty) {\n let relationshipIsEmpty = payload.data === null || Array.isArray(payload.data) && payload.data.length === 0;\n\n // we don't need to notify here as the update op we pushed in above will notify once\n // membership is in the correct state.\n relationship.state.hasReceivedData = true;\n relationship.state.isStale = false;\n relationship.state.hasDematerializedInverse = false;\n relationship.state.isEmpty = relationshipIsEmpty;\n } else if (hasUpdatedLink) {\n // only notify stale if we have not previously received membership data.\n // within this same transaction\n // this prevents refetching when only one side of the relationship in the\n // payload contains the info while the other side contains just a link\n // this only works when the side with just a link is a belongsTo, as we\n // don't know if a hasMany has full information or not.\n // see #7049 for context.\n if (isCollection || !relationship.state.hasReceivedData || relationship.transactionRef === 0) {\n relationship.state.isStale = true;\n if (isHasMany(relationship)) {\n relationship.notifyHasManyChange();\n } else {\n relationship.notifyBelongsToChange();\n }\n } else {\n relationship.state.isStale = false;\n }\n }\n}","import { assert } from '@ember/debug';\nimport { isBelongsTo, isNew } from '../-utils';\nimport { addToInverse, notifyInverseOfPotentialMaterialization, removeFromInverse } from './replace-related-records';\nexport default function replaceRelatedRecord(graph, op, isRemote = false) {\n const relationship = graph.get(op.record, op.field);\n assert(`You can only '${op.op}' on a belongsTo relationship. ${op.record.type}.${op.field} is a ${relationship.definition.kind}`, isBelongsTo(relationship));\n if (isRemote) {\n graph._addToTransaction(relationship);\n }\n const {\n definition,\n state\n } = relationship;\n const prop = isRemote ? 'remoteState' : 'localState';\n const existingState = relationship[prop];\n\n /*\n case 1:1\n ========\n In a bi-directional graph with 1:1 edges, replacing a value\n results in up-to 4 discrete value transitions.\n If: A <-> B, C <-> D is the initial state,\n and: A <-> C, B, D is the final state\n then we would undergo the following 4 transitions.\n remove A from B\n add C to A\n remove C from D\n add A to C\n case 1:many\n ===========\n In a bi-directional graph with 1:Many edges, replacing a value\n results in up-to 3 discrete value transitions.\n If: A<->>B<<->D, C<<->D is the initial state (double arrows representing the many side)\n And: A<->>C<<->D, B<<->D is the final state\n Then we would undergo three transitions.\n remove A from B\n add C to A.\n add A to C\n case 1:?\n ========\n In a uni-directional graph with 1:? edges (modeled in EmberData with `inverse:null`) with\n artificial (implicit) inverses, replacing a value results in up-to 3 discrete value transitions.\n This is because a 1:? relationship is effectively 1:many.\n If: A->B, C->B is the initial state\n And: A->C, C->B is the final state\n Then we would undergo three transitions.\n Remove A from B\n Add C to A\n Add A to C\n */\n\n // nothing for us to do\n if (op.value === existingState) {\n // if we were empty before but now know we are empty this needs to be true\n state.hasReceivedData = true;\n // if this is a remote update we still sync\n if (isRemote) {\n const {\n localState\n } = relationship;\n // don't sync if localState is a new record and our canonicalState is null\n if (localState && isNew(localState) && !existingState) {\n return;\n }\n if (existingState && localState === existingState) {\n notifyInverseOfPotentialMaterialization(graph, existingState, definition.inverseKey, op.record, isRemote);\n } else {\n relationship.localState = existingState;\n relationship.notifyBelongsToChange();\n }\n }\n return;\n }\n\n // remove this value from the inverse if required\n if (existingState) {\n removeFromInverse(graph, existingState, definition.inverseKey, op.record, isRemote);\n }\n\n // update value to the new value\n relationship[prop] = op.value;\n state.hasReceivedData = true;\n state.isEmpty = op.value === null;\n state.isStale = false;\n state.hasFailedLoadAttempt = false;\n if (op.value) {\n if (definition.type !== op.value.type) {\n graph.registerPolymorphicType(definition.type, op.value.type);\n }\n addToInverse(graph, op.value, definition.inverseKey, op.record, isRemote);\n }\n if (isRemote) {\n const {\n localState,\n remoteState\n } = relationship;\n if (localState && isNew(localState) && !remoteState) {\n return;\n }\n if (localState !== remoteState) {\n relationship.localState = remoteState;\n relationship.notifyBelongsToChange();\n }\n } else {\n relationship.notifyBelongsToChange();\n }\n}","/**\n * @module @ember-data/record-data\n */\nimport { assert } from '@ember/debug';\nimport { _backburner as emberBackburner } from '@ember/runloop';\nimport { isEqual } from '@ember/utils';\nimport { recordDataFor, recordIdentifierFor, removeRecordDataFor } from '@ember-data/store/-private';\nimport coerceId from './coerce-id';\nimport { isImplicit } from './graph/-utils';\nimport { graphFor } from './graph/index';\nlet nextBfsId = 1;\nconst EMPTY_ITERATOR = {\n iterator() {\n return {\n next() {\n return {\n done: true,\n value: undefined\n };\n }\n };\n }\n};\n\n/**\n The default cache implementation used by ember-data. The cache\n is configurable and using a different implementation can be\n achieved by implementing the store's createRecordDataFor hook.\n\n @class RecordDataDefault\n @public\n */\nexport default class RecordDataDefault {\n constructor(identifier, storeWrapper) {\n /*\n Iterates over the set of internal models reachable from `this` across exactly one\n relationship.\n */\n this._directlyRelatedRecordDatasIterable = () => {\n const graph = graphFor(this.storeWrapper);\n const initializedRelationships = graph.identifiers.get(this.identifier);\n if (!initializedRelationships) {\n return EMPTY_ITERATOR;\n }\n const initializedRelationshipsArr = Object.keys(initializedRelationships).map(key => initializedRelationships[key]).filter(rel => {\n return !isImplicit(rel);\n });\n let i = 0;\n let j = 0;\n let k = 0;\n const findNext = () => {\n while (i < initializedRelationshipsArr.length) {\n while (j < 2) {\n let members = j === 0 ? getLocalState(initializedRelationshipsArr[i]) : getRemoteState(initializedRelationshipsArr[i]);\n while (k < members.length) {\n let member = members[k++];\n if (member !== null) {\n return recordDataFor(member);\n }\n }\n k = 0;\n j++;\n }\n j = 0;\n i++;\n }\n return undefined;\n };\n return {\n iterator() {\n return {\n next: () => {\n const value = findNext();\n return {\n value,\n done: value === undefined\n };\n }\n };\n }\n };\n };\n this.modelName = identifier.type;\n this.clientId = identifier.lid;\n this.id = identifier.id;\n this.identifier = identifier;\n this.storeWrapper = storeWrapper;\n this.isDestroyed = false;\n this._isNew = false;\n this._isDeleted = false;\n // Used during the mark phase of unloading to avoid checking the same internal\n // model twice in the same scan\n this._bfsId = 0;\n this.reset();\n }\n\n // PUBLIC API\n getResourceIdentifier() {\n return this.identifier;\n }\n pushData(data, calculateChange) {\n let changedKeys;\n if (this._isNew) {\n this._isNew = false;\n this.notifyStateChange();\n }\n if (calculateChange) {\n changedKeys = this._changedKeys(data.attributes);\n }\n Object.assign(this._data, data.attributes);\n if (this.__attributes) {\n // only do if we have attribute changes\n this._updateChangedAttributes();\n }\n if (data.relationships) {\n this._setupRelationships(data);\n }\n if (data.id) {\n if (!this.id) {\n this.id = coerceId(data.id);\n }\n }\n if (changedKeys && changedKeys.length) {\n this._notifyAttributes(changedKeys);\n }\n return changedKeys;\n }\n willCommit() {\n this._inFlightAttributes = this._attributes;\n this._attributes = null;\n }\n hasChangedAttributes() {\n return this.__attributes !== null && Object.keys(this.__attributes).length > 0;\n }\n _clearErrors() {\n if (this._errors) {\n this._errors = undefined;\n this.storeWrapper.notifyErrorsChange(this.modelName, this.id, this.clientId);\n }\n }\n getErrors() {\n let errors = this._errors || [];\n return errors;\n }\n\n // this is a hack bc we don't have access to the state machine\n // and relationships need this info and @runspired didn't see\n // how to get it just yet from storeWrapper.\n isEmpty() {\n return this.__attributes === null && this.__inFlightAttributes === null && this.__data === null;\n }\n isDeleted() {\n return this._isDeleted;\n }\n setIsDeleted(isDeleted) {\n this._isDeleted = isDeleted;\n if (this._isNew) {\n this._deletionConfirmed();\n }\n this.notifyStateChange();\n }\n isDeletionCommitted() {\n return this._isDeletionCommited;\n }\n reset() {\n this.__attributes = null;\n this.__inFlightAttributes = null;\n this.__data = null;\n this._errors = undefined;\n }\n _setupRelationships(data) {\n // TODO @runspired iterating by definitions instead of by payload keys\n // allows relationship payloads to be ignored silently if no relationship\n // definition exists. Ensure there's a test for this and then consider\n // moving this to an assertion. This check should possibly live in the graph.\n let relationships = this.storeWrapper.relationshipsDefinitionFor(this.modelName);\n let keys = Object.keys(relationships);\n for (let i = 0; i < keys.length; i++) {\n let relationshipName = keys[i];\n if (!data.relationships[relationshipName]) {\n continue;\n }\n let relationshipData = data.relationships[relationshipName];\n graphFor(this.storeWrapper).push({\n op: 'updateRelationship',\n record: this.identifier,\n field: relationshipName,\n value: relationshipData\n });\n }\n }\n\n /**\n Checks if the attributes which are considered as changed are still\n different to the state which is acknowledged by the server.\n This method is needed when data for the internal model is pushed and the\n pushed data might acknowledge dirty attributes as confirmed.\n @method updateChangedAttributes\n @private\n */\n _updateChangedAttributes() {\n let changedAttributes = this.changedAttributes();\n let changedAttributeNames = Object.keys(changedAttributes);\n let attrs = this._attributes;\n for (let i = 0, length = changedAttributeNames.length; i < length; i++) {\n let attribute = changedAttributeNames[i];\n let data = changedAttributes[attribute];\n let oldData = data[0];\n let newData = data[1];\n if (oldData === newData) {\n delete attrs[attribute];\n }\n }\n this._notifyAttributes(changedAttributeNames);\n }\n _notifyAttributes(keys) {\n const {\n type,\n id,\n lid\n } = this.identifier;\n const manager = this.storeWrapper;\n if (!keys) {\n manager.notifyPropertyChange(type, id, lid);\n return;\n }\n for (let i = 0; i < keys.length; i++) {\n manager.notifyPropertyChange(type, id, lid, keys[i]);\n }\n }\n\n /**\n Returns an object, whose keys are changed properties, and value is an\n [oldProp, newProp] array.\n @method changedAttributes\n @private\n */\n changedAttributes() {\n let oldData = this._data;\n let currentData = this._attributes;\n let inFlightData = this._inFlightAttributes;\n let newData = {\n ...inFlightData,\n ...currentData\n };\n let diffData = Object.create(null);\n let newDataKeys = Object.keys(newData);\n for (let i = 0, length = newDataKeys.length; i < length; i++) {\n let key = newDataKeys[i];\n diffData[key] = [oldData[key], newData[key]];\n }\n return diffData;\n }\n isNew() {\n return this._isNew;\n }\n rollbackAttributes() {\n let dirtyKeys;\n this._isDeleted = false;\n if (this.hasChangedAttributes()) {\n dirtyKeys = Object.keys(this._attributes);\n this._attributes = null;\n }\n if (this.isNew()) {\n this.removeFromInverseRelationships();\n this._isDeleted = true;\n this._isNew = false;\n }\n this._inFlightAttributes = null;\n this._clearErrors();\n this.notifyStateChange();\n return dirtyKeys;\n }\n _deletionConfirmed() {\n this.removeFromInverseRelationships();\n }\n didCommit(data) {\n if (this._isDeleted) {\n this._deletionConfirmed();\n this._isDeletionCommited = true;\n }\n this._isNew = false;\n let newCanonicalAttributes;\n if (data) {\n if (data.id) {\n // didCommit provided an ID, notify the store of it\n this.storeWrapper.setRecordId(this.modelName, data.id, this.clientId);\n this.id = coerceId(data.id);\n }\n if (data.relationships) {\n this._setupRelationships(data);\n }\n newCanonicalAttributes = data.attributes;\n }\n let changedKeys = this._changedKeys(newCanonicalAttributes);\n Object.assign(this._data, this.__inFlightAttributes, newCanonicalAttributes);\n this._inFlightAttributes = null;\n this._updateChangedAttributes();\n this._notifyAttributes(changedKeys);\n this._clearErrors();\n this.notifyStateChange();\n return changedKeys;\n }\n notifyStateChange() {\n this.storeWrapper.notifyStateChange(this.modelName, this.id, this.clientId);\n }\n\n // get ResourceIdentifiers for \"current state\"\n getHasMany(key) {\n return graphFor(this.storeWrapper).get(this.identifier, key).getData();\n }\n\n // set a new \"current state\" via ResourceIdentifiers\n setDirtyHasMany(key, recordDatas) {\n graphFor(this.storeWrapper).update({\n op: 'replaceRelatedRecords',\n record: this.identifier,\n field: key,\n value: recordDatas.map(recordIdentifierFor)\n });\n }\n\n // append to \"current state\" via RecordDatas\n addToHasMany(key, recordDatas, idx) {\n graphFor(this.storeWrapper).update({\n op: 'addToRelatedRecords',\n record: this.identifier,\n field: key,\n value: recordDatas.map(recordIdentifierFor),\n index: idx\n });\n }\n\n // remove from \"current state\" via RecordDatas\n removeFromHasMany(key, recordDatas) {\n graphFor(this.storeWrapper).update({\n op: 'removeFromRelatedRecords',\n record: this.identifier,\n field: key,\n value: recordDatas.map(recordIdentifierFor)\n });\n }\n commitWasRejected(identifier, errors) {\n let keys = Object.keys(this._inFlightAttributes);\n if (keys.length > 0) {\n let attrs = this._attributes;\n for (let i = 0; i < keys.length; i++) {\n if (attrs[keys[i]] === undefined) {\n attrs[keys[i]] = this._inFlightAttributes[keys[i]];\n }\n }\n }\n this._inFlightAttributes = null;\n if (errors) {\n this._errors = errors;\n }\n this.storeWrapper.notifyErrorsChange(this.modelName, this.id, this.clientId);\n }\n getBelongsTo(key) {\n return graphFor(this.storeWrapper).get(this.identifier, key).getData();\n }\n setDirtyBelongsTo(key, recordData) {\n graphFor(this.storeWrapper).update({\n op: 'replaceRelatedRecord',\n record: this.identifier,\n field: key,\n value: recordData ? recordIdentifierFor(recordData) : null\n });\n }\n setDirtyAttribute(key, value) {\n const {\n type,\n id,\n lid\n } = this.identifier;\n this.storeWrapper.notifyPropertyChange(type, id, lid, key);\n let originalValue;\n // Add the new value to the changed attributes hash\n this._attributes[key] = value;\n if (key in this._inFlightAttributes) {\n originalValue = this._inFlightAttributes[key];\n } else {\n originalValue = this._data[key];\n }\n // If we went back to our original value, we shouldn't keep the attribute around anymore\n if (value === originalValue) {\n delete this._attributes[key];\n }\n }\n\n // internal set coming from the model\n __setId(id) {\n if (this.id !== id) {\n this.id = id;\n }\n }\n getAttr(key) {\n if (key in this._attributes) {\n return this._attributes[key];\n } else if (key in this._inFlightAttributes) {\n return this._inFlightAttributes[key];\n } else {\n return this._data[key];\n }\n }\n hasAttr(key) {\n return key in this._attributes || key in this._inFlightAttributes || key in this._data;\n }\n unloadRecord() {\n if (this.isDestroyed) {\n return;\n }\n graphFor(this.storeWrapper).unload(this.identifier);\n this.reset();\n if (!this._scheduledDestroy) {\n this._scheduledDestroy = emberBackburner.schedule('destroy', this, '_cleanupOrphanedRecordDatas');\n }\n }\n _cleanupOrphanedRecordDatas() {\n let relatedRecordDatas = this._allRelatedRecordDatas();\n if (areAllModelsUnloaded(relatedRecordDatas)) {\n // we don't have a backburner queue yet since\n // we scheduled this into ember's destroy\n // disconnectRecord called from destroy will teardown\n // relationships. We do this to queue that.\n this.storeWrapper._store._backburner.join(() => {\n for (let i = 0; i < relatedRecordDatas.length; ++i) {\n let recordData = relatedRecordDatas[i];\n if (!recordData.isDestroyed) {\n // TODO @runspired we do not currently destroy RecordData instances *except* via this relationship\n // traversal. This seems like an oversight since the store should be able to notify destroy.\n removeRecordDataFor(recordData.identifier);\n recordData.destroy();\n }\n }\n });\n }\n this._scheduledDestroy = null;\n }\n destroy() {\n this.isDestroyed = true;\n this.storeWrapper.disconnectRecord(this.modelName, this.id, this.clientId);\n }\n isRecordInUse() {\n return this.storeWrapper.isRecordInUse(this.modelName, this.id, this.clientId);\n }\n /*\n Computes the set of internal models reachable from this internal model.\n Reachability is determined over the relationship graph (ie a graph where\n nodes are internal models and edges are belongs to or has many\n relationships).\n Returns an array including `this` and all internal models reachable\n from `this`.\n */\n _allRelatedRecordDatas() {\n let array = [];\n let queue = [];\n let bfsId = nextBfsId++;\n queue.push(this);\n this._bfsId = bfsId;\n while (queue.length > 0) {\n let node = queue.shift();\n array.push(node);\n const iterator = this._directlyRelatedRecordDatasIterable().iterator();\n for (let obj = iterator.next(); !obj.done; obj = iterator.next()) {\n const recordData = obj.value;\n if (recordData && recordData instanceof RecordDataDefault) {\n assert('Internal Error: seen a future bfs iteration', recordData._bfsId <= bfsId);\n if (recordData._bfsId < bfsId) {\n queue.push(recordData);\n recordData._bfsId = bfsId;\n }\n }\n }\n }\n return array;\n }\n isAttrDirty(key) {\n if (this._attributes[key] === undefined) {\n return false;\n }\n let originalValue;\n if (this._inFlightAttributes[key] !== undefined) {\n originalValue = this._inFlightAttributes[key];\n } else {\n originalValue = this._data[key];\n }\n return originalValue !== this._attributes[key];\n }\n get _attributes() {\n if (this.__attributes === null) {\n this.__attributes = Object.create(null);\n }\n return this.__attributes;\n }\n set _attributes(v) {\n this.__attributes = v;\n }\n get _data() {\n if (this.__data === null) {\n this.__data = Object.create(null);\n }\n return this.__data;\n }\n set _data(v) {\n this.__data = v;\n }\n get _inFlightAttributes() {\n if (this.__inFlightAttributes === null) {\n this.__inFlightAttributes = Object.create(null);\n }\n return this.__inFlightAttributes;\n }\n set _inFlightAttributes(v) {\n this.__inFlightAttributes = v;\n }\n\n /**\n * Receives options passed to `store.createRecord` and is given the opportunity\n * to handle them.\n *\n * The return value is an object of options to pass to `Record.create()`\n *\n * @name _initRecordCreateOptions\n * @param options\n * @private\n */\n _initRecordCreateOptions(options) {\n let createOptions = {};\n if (options !== undefined) {\n const {\n storeWrapper,\n identifier\n } = this;\n let attributeDefs = storeWrapper.attributesDefinitionFor(identifier.type);\n let relationshipDefs = storeWrapper.relationshipsDefinitionFor(identifier.type);\n const graph = graphFor(storeWrapper);\n let propertyNames = Object.keys(options);\n for (let i = 0; i < propertyNames.length; i++) {\n let name = propertyNames[i];\n let propertyValue = options[name];\n if (name === 'id') {\n this.id = propertyValue;\n continue;\n }\n let fieldType = relationshipDefs[name] || attributeDefs[name];\n let kind = fieldType !== undefined ? fieldType.kind : null;\n let relationship;\n switch (kind) {\n case 'attribute':\n this.setDirtyAttribute(name, propertyValue);\n break;\n case 'belongsTo':\n this.setDirtyBelongsTo(name, propertyValue);\n relationship = graph.get(identifier, name);\n relationship.state.hasReceivedData = true;\n relationship.state.isEmpty = false;\n break;\n case 'hasMany':\n this.setDirtyHasMany(name, propertyValue);\n relationship = graph.get(identifier, name);\n relationship.state.hasReceivedData = true;\n relationship.state.isEmpty = false;\n break;\n default:\n // reflect back (pass-thru) unknown properties\n createOptions[name] = propertyValue;\n }\n }\n }\n return createOptions;\n }\n\n /*\n TODO IGOR AND DAVID this shouldn't be public\n This method should only be called by records in the `isNew()` state OR once the record\n has been deleted and that deletion has been persisted.\n It will remove this record from any associated relationships.\n If `isNew` is true (default false), it will also completely reset all\n relationships to an empty state as well.\n @method removeFromInverseRelationships\n @param {Boolean} isNew whether to unload from the `isNew` perspective\n @private\n */\n removeFromInverseRelationships() {\n graphFor(this.storeWrapper).push({\n op: 'deleteRecord',\n record: this.identifier,\n isNew: this.isNew()\n });\n }\n clientDidCreate() {\n this._isNew = true;\n }\n\n /*\n Ember Data has 3 buckets for storing the value of an attribute on an internalModel.\n `_data` holds all of the attributes that have been acknowledged by\n a backend via the adapter. When rollbackAttributes is called on a model all\n attributes will revert to the record's state in `_data`.\n `_attributes` holds any change the user has made to an attribute\n that has not been acknowledged by the adapter. Any values in\n `_attributes` are have priority over values in `_data`.\n `_inFlightAttributes`. When a record is being synced with the\n backend the values in `_attributes` are copied to\n `_inFlightAttributes`. This way if the backend acknowledges the\n save but does not return the new state Ember Data can copy the\n values from `_inFlightAttributes` to `_data`. Without having to\n worry about changes made to `_attributes` while the save was\n happenign.\n Changed keys builds a list of all of the values that may have been\n changed by the backend after a successful save.\n It does this by iterating over each key, value pair in the payload\n returned from the server after a save. If the `key` is found in\n `_attributes` then the user has a local changed to the attribute\n that has not been synced with the server and the key is not\n included in the list of changed keys.\n \n If the value, for a key differs from the value in what Ember Data\n believes to be the truth about the backend state (A merger of the\n `_data` and `_inFlightAttributes` objects where\n `_inFlightAttributes` has priority) then that means the backend\n has updated the value and the key is added to the list of changed\n keys.\n @method _changedKeys\n @private\n */\n /*\n TODO IGOR DAVID\n There seems to be a potential bug here, where we will return keys that are not\n in the schema\n */\n _changedKeys(updates) {\n let changedKeys = [];\n if (updates) {\n let original, i, value, key;\n let keys = Object.keys(updates);\n let length = keys.length;\n let hasAttrs = this.hasChangedAttributes();\n let attrs;\n if (hasAttrs) {\n attrs = this._attributes;\n }\n original = Object.assign(Object.create(null), this._data, this.__inFlightAttributes);\n for (i = 0; i < length; i++) {\n key = keys[i];\n value = updates[key];\n\n // A value in _attributes means the user has a local change to\n // this attributes. We never override this value when merging\n // updates from the backend so we should not sent a change\n // notification if the server value differs from the original.\n if (hasAttrs === true && attrs[key] !== undefined) {\n continue;\n }\n if (!isEqual(original[key], value)) {\n changedKeys.push(key);\n }\n }\n }\n return changedKeys;\n }\n toString() {\n return `<${this.modelName}:${this.id}>`;\n }\n}\nfunction areAllModelsUnloaded(recordDatas) {\n for (let i = 0; i < recordDatas.length; ++i) {\n if (recordDatas[i].isRecordInUse()) {\n return false;\n }\n }\n return true;\n}\nfunction getLocalState(rel) {\n if (rel.definition.kind === 'belongsTo') {\n return rel.localState ? [rel.localState] : [];\n }\n return rel.currentState;\n}\nfunction getRemoteState(rel) {\n if (rel.definition.kind === 'belongsTo') {\n return rel.remoteState ? [rel.remoteState] : [];\n }\n return rel.canonicalState;\n}","import { A } from '@ember/array';\nimport { warn } from '@ember/debug';\nimport { get, set } from '@ember/object';\nimport Mixin from '@ember/object/mixin';\nimport { camelize } from '@ember/string';\nimport { typeOf } from '@ember/utils';\n\n/**\n @module @ember-data/serializer/rest\n*/\n\n/**\n ## Using Embedded Records\n\n `EmbeddedRecordsMixin` supports serializing embedded records.\n\n To set up embedded records, include the mixin when extending a serializer,\n then define and configure embedded (model) relationships.\n\n Note that embedded records will serialize with the serializer for their model instead of the serializer in which they are defined.\n\n Note also that this mixin does not work with JSONAPISerializer because the JSON:API specification does not describe how to format embedded resources.\n\n Below is an example of a per-type serializer (`post` type).\n\n ```app/serializers/post.js\n import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\n export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n author: { embedded: 'always' },\n comments: { serialize: 'ids' }\n }\n }\n ```\n Note that this use of `{ embedded: 'always' }` is unrelated to\n the `{ embedded: 'always' }` that is defined as an option on `attr` as part of\n defining a model while working with the `ActiveModelSerializer`. Nevertheless,\n using `{ embedded: 'always' }` as an option to `attr` is not a valid way to set up\n embedded records.\n\n The `attrs` option for a resource `{ embedded: 'always' }` is shorthand for:\n\n ```js\n {\n serialize: 'records',\n deserialize: 'records'\n }\n ```\n\n ### Configuring Attrs\n\n A resource's `attrs` option may be set to use `ids`, `records` or false for the\n `serialize` and `deserialize` settings.\n\n The `attrs` property can be set on the `ApplicationSerializer` or a per-type\n serializer.\n\n In the case where embedded JSON is expected while extracting a payload (reading)\n the setting is `deserialize: 'records'`, there is no need to use `ids` when\n extracting as that is the default behaviour without this mixin if you are using\n the vanilla `EmbeddedRecordsMixin`. Likewise, to embed JSON in the payload while\n serializing `serialize: 'records'` is the setting to use. There is an option of\n not embedding JSON in the serialized payload by using `serialize: 'ids'`. If you\n do not want the relationship sent at all, you can use `serialize: false`.\n\n\n ### EmbeddedRecordsMixin defaults\n If you do not overwrite `attrs` for a specific relationship, the `EmbeddedRecordsMixin`\n will behave in the following way:\n\n BelongsTo: `{ serialize: 'id', deserialize: 'id' }`\n HasMany: `{ serialize: false, deserialize: 'ids' }`\n\n ### Model Relationships\n\n Embedded records must have a model defined to be extracted and serialized. Note that\n when defining any relationships on your model such as `belongsTo` and `hasMany`, you\n should not both specify `async: true` and also indicate through the serializer's\n `attrs` attribute that the related model should be embedded for deserialization.\n If a model is declared embedded for deserialization (`embedded: 'always'` or `deserialize: 'records'`),\n then do not use `async: true`.\n\n To successfully extract and serialize embedded records the model relationships\n must be set up correctly. See the\n [defining relationships](https://guides.emberjs.com/current/models/relationships)\n section of the **Defining Models** guide page.\n\n Records without an `id` property are not considered embedded records, model\n instances must have an `id` property to be used with Ember Data.\n\n ### Example JSON payloads, Models and Serializers\n\n **When customizing a serializer it is important to grok what the customizations\n are. Please read the docs for the methods this mixin provides, in case you need\n to modify it to fit your specific needs.**\n\n For example, review the docs for each method of this mixin:\n * [normalize](/ember-data/release/classes/EmbeddedRecordsMixin/methods/normalize?anchor=normalize)\n * [serializeBelongsTo](/ember-data/release/classes/EmbeddedRecordsMixin/methods/serializeBelongsTo?anchor=serializeBelongsTo)\n * [serializeHasMany](/ember-data/release/classes/EmbeddedRecordsMixin/methods/serializeHasMany?anchor=serializeHasMany)\n\n @class EmbeddedRecordsMixin\n @public\n*/\nexport default Mixin.create({\n /**\n Normalize the record and recursively normalize/extract all the embedded records\n while pushing them into the store as they are encountered\n A payload with an attr configured for embedded records needs to be extracted:\n ```js\n {\n \"post\": {\n \"id\": \"1\"\n \"title\": \"Rails is omakase\",\n \"comments\": [{\n \"id\": \"1\",\n \"body\": \"Rails is unagi\"\n }, {\n \"id\": \"2\",\n \"body\": \"Omakase O_o\"\n }]\n }\n }\n ```\n @method normalize\n @public\n @param {Model} typeClass\n @param {Object} hash to be normalized\n @param {String} prop the hash has been referenced by\n @return {Object} the normalized hash\n **/\n normalize(typeClass, hash, prop) {\n let normalizedHash = this._super(typeClass, hash, prop);\n return this._extractEmbeddedRecords(this, this.store, typeClass, normalizedHash);\n },\n keyForRelationship(key, typeClass, method) {\n if (method === 'serialize' && this.hasSerializeRecordsOption(key) || method === 'deserialize' && this.hasDeserializeRecordsOption(key)) {\n return this.keyForAttribute(key, method);\n } else {\n return this._super(key, typeClass, method) || key;\n }\n },\n /**\n Serialize `belongsTo` relationship when it is configured as an embedded object.\n This example of an author model belongs to a post model:\n ```js\n import Model, { attr, belongsTo } from '@ember-data/model';\n Post = Model.extend({\n title: attr('string'),\n body: attr('string'),\n author: belongsTo('author')\n });\n Author = Model.extend({\n name: attr('string'),\n post: belongsTo('post')\n });\n ```\n Use a custom (type) serializer for the post model to configure embedded author\n ```app/serializers/post.js\n import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n author: { embedded: 'always' }\n }\n }\n ```\n A payload with an attribute configured for embedded records can serialize\n the records together under the root attribute's payload:\n ```js\n {\n \"post\": {\n \"id\": \"1\"\n \"title\": \"Rails is omakase\",\n \"author\": {\n \"id\": \"2\"\n \"name\": \"dhh\"\n }\n }\n }\n ```\n @method serializeBelongsTo\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {Object} relationship\n */\n serializeBelongsTo(snapshot, json, relationship) {\n let attr = relationship.key;\n if (this.noSerializeOptionSpecified(attr)) {\n this._super(snapshot, json, relationship);\n return;\n }\n let includeIds = this.hasSerializeIdsOption(attr);\n let includeRecords = this.hasSerializeRecordsOption(attr);\n let embeddedSnapshot = snapshot.belongsTo(attr);\n if (includeIds) {\n let schema = this.store.modelFor(snapshot.modelName);\n let serializedKey = this._getMappedKey(relationship.key, schema);\n if (serializedKey === relationship.key && this.keyForRelationship) {\n serializedKey = this.keyForRelationship(relationship.key, relationship.kind, 'serialize');\n }\n if (!embeddedSnapshot) {\n json[serializedKey] = null;\n } else {\n json[serializedKey] = embeddedSnapshot.id;\n if (relationship.options.polymorphic) {\n this.serializePolymorphicType(snapshot, json, relationship);\n }\n }\n } else if (includeRecords) {\n this._serializeEmbeddedBelongsTo(snapshot, json, relationship);\n }\n },\n _serializeEmbeddedBelongsTo(snapshot, json, relationship) {\n let embeddedSnapshot = snapshot.belongsTo(relationship.key);\n let schema = this.store.modelFor(snapshot.modelName);\n let serializedKey = this._getMappedKey(relationship.key, schema);\n if (serializedKey === relationship.key && this.keyForRelationship) {\n serializedKey = this.keyForRelationship(relationship.key, relationship.kind, 'serialize');\n }\n if (!embeddedSnapshot) {\n json[serializedKey] = null;\n } else {\n json[serializedKey] = embeddedSnapshot.serialize({\n includeId: true\n });\n this.removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, json[serializedKey]);\n if (relationship.options.polymorphic) {\n this.serializePolymorphicType(snapshot, json, relationship);\n }\n }\n },\n /**\n Serializes `hasMany` relationships when it is configured as embedded objects.\n This example of a post model has many comments:\n ```js\n import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n Post = Model.extend({\n title: attr('string'),\n body: attr('string'),\n comments: hasMany('comment')\n });\n Comment = Model.extend({\n body: attr('string'),\n post: belongsTo('post')\n });\n ```\n Use a custom (type) serializer for the post model to configure embedded comments\n ```app/serializers/post.js\n import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n comments: { embedded: 'always' }\n }\n }\n ```\n A payload with an attribute configured for embedded records can serialize\n the records together under the root attribute's payload:\n ```js\n {\n \"post\": {\n \"id\": \"1\"\n \"title\": \"Rails is omakase\",\n \"body\": \"I want this for my ORM, I want that for my template language...\"\n \"comments\": [{\n \"id\": \"1\",\n \"body\": \"Rails is unagi\"\n }, {\n \"id\": \"2\",\n \"body\": \"Omakase O_o\"\n }]\n }\n }\n ```\n The attrs options object can use more specific instruction for extracting and\n serializing. When serializing, an option to embed `ids`, `ids-and-types` or `records` can be set.\n When extracting the only option is `records`.\n So `{ embedded: 'always' }` is shorthand for:\n `{ serialize: 'records', deserialize: 'records' }`\n To embed the `ids` for a related object (using a hasMany relationship):\n ```app/serializers/post.js\n import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n comments: { serialize: 'ids', deserialize: 'records' }\n }\n }\n ```\n ```js\n {\n \"post\": {\n \"id\": \"1\"\n \"title\": \"Rails is omakase\",\n \"body\": \"I want this for my ORM, I want that for my template language...\"\n \"comments\": [\"1\", \"2\"]\n }\n }\n ```\n To embed the relationship as a collection of objects with `id` and `type` keys, set\n `ids-and-types` for the related object.\n This is particularly useful for polymorphic relationships where records don't share\n the same table and the `id` is not enough information.\n For example having a user that has many pets:\n ```js\n User = Model.extend({\n name: attr('string'),\n pets: hasMany('pet', { polymorphic: true })\n });\n Pet = Model.extend({\n name: attr('string'),\n });\n Cat = Pet.extend({\n // ...\n });\n Parrot = Pet.extend({\n // ...\n });\n ```\n ```app/serializers/user.js\n import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n export default class UserSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n pets: { serialize: 'ids-and-types', deserialize: 'records' }\n }\n }\n ```\n ```js\n {\n \"user\": {\n \"id\": \"1\"\n \"name\": \"Bertin Osborne\",\n \"pets\": [\n { \"id\": \"1\", \"type\": \"Cat\" },\n { \"id\": \"1\", \"type\": \"Parrot\"}\n ]\n }\n }\n ```\n @method serializeHasMany\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {Object} relationship\n */\n serializeHasMany(snapshot, json, relationship) {\n let attr = relationship.key;\n if (this.noSerializeOptionSpecified(attr)) {\n this._super(snapshot, json, relationship);\n return;\n }\n if (this.hasSerializeIdsOption(attr)) {\n let schema = this.store.modelFor(snapshot.modelName);\n let serializedKey = this._getMappedKey(relationship.key, schema);\n if (serializedKey === relationship.key && this.keyForRelationship) {\n serializedKey = this.keyForRelationship(relationship.key, relationship.kind, 'serialize');\n }\n json[serializedKey] = snapshot.hasMany(attr, {\n ids: true\n });\n } else if (this.hasSerializeRecordsOption(attr)) {\n this._serializeEmbeddedHasMany(snapshot, json, relationship);\n } else {\n if (this.hasSerializeIdsAndTypesOption(attr)) {\n this._serializeHasManyAsIdsAndTypes(snapshot, json, relationship);\n }\n }\n },\n /*\n Serializes a hasMany relationship as an array of objects containing only `id` and `type`\n keys.\n This has its use case on polymorphic hasMany relationships where the server is not storing\n all records in the same table using STI, and therefore the `id` is not enough information\n TODO: Make the default in Ember-data 3.0??\n */\n _serializeHasManyAsIdsAndTypes(snapshot, json, relationship) {\n let serializedKey = this.keyForAttribute(relationship.key, 'serialize');\n let hasMany = snapshot.hasMany(relationship.key);\n json[serializedKey] = A(hasMany).map(function (recordSnapshot) {\n //\n // I'm sure I'm being utterly naive here. Probably id is a configurable property and\n // type too, and the modelName has to be normalized somehow.\n //\n return {\n id: recordSnapshot.id,\n type: recordSnapshot.modelName\n };\n });\n },\n _serializeEmbeddedHasMany(snapshot, json, relationship) {\n let schema = this.store.modelFor(snapshot.modelName);\n let serializedKey = this._getMappedKey(relationship.key, schema);\n if (serializedKey === relationship.key && this.keyForRelationship) {\n serializedKey = this.keyForRelationship(relationship.key, relationship.kind, 'serialize');\n }\n warn(`The embedded relationship '${serializedKey}' is undefined for '${snapshot.modelName}' with id '${snapshot.id}'. Please include it in your original payload.`, typeOf(snapshot.hasMany(relationship.key)) !== 'undefined', {\n id: 'ds.serializer.embedded-relationship-undefined'\n });\n json[serializedKey] = this._generateSerializedHasMany(snapshot, relationship);\n },\n /*\n Returns an array of embedded records serialized to JSON\n */\n _generateSerializedHasMany(snapshot, relationship) {\n let hasMany = snapshot.hasMany(relationship.key);\n let manyArray = A(hasMany);\n let ret = new Array(manyArray.length);\n for (let i = 0; i < manyArray.length; i++) {\n let embeddedSnapshot = manyArray[i];\n let embeddedJson = embeddedSnapshot.serialize({\n includeId: true\n });\n this.removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, embeddedJson);\n ret[i] = embeddedJson;\n }\n return ret;\n },\n /**\n When serializing an embedded record, modify the property (in the `JSON` payload)\n that refers to the parent record (foreign key for the relationship).\n Serializing a `belongsTo` relationship removes the property that refers to the\n parent record\n Serializing a `hasMany` relationship does not remove the property that refers to\n the parent record.\n @method removeEmbeddedForeignKey\n @public\n @param {Snapshot} snapshot\n @param {Snapshot} embeddedSnapshot\n @param {Object} relationship\n @param {Object} json\n */\n removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, json) {\n if (relationship.kind === 'belongsTo') {\n let schema = this.store.modelFor(snapshot.modelName);\n let parentRecord = schema.inverseFor(relationship.key, this.store);\n if (parentRecord) {\n let name = parentRecord.name;\n let embeddedSerializer = this.store.serializerFor(embeddedSnapshot.modelName);\n let parentKey = embeddedSerializer.keyForRelationship(name, parentRecord.kind, 'deserialize');\n if (parentKey) {\n delete json[parentKey];\n }\n }\n } /*else if (relationship.kind === 'hasMany') {\n return;\n }*/\n },\n // checks config for attrs option to embedded (always) - serialize and deserialize\n hasEmbeddedAlwaysOption(attr) {\n let option = this.attrsOption(attr);\n return option && option.embedded === 'always';\n },\n // checks config for attrs option to serialize ids\n hasSerializeRecordsOption(attr) {\n let alwaysEmbed = this.hasEmbeddedAlwaysOption(attr);\n let option = this.attrsOption(attr);\n return alwaysEmbed || option && option.serialize === 'records';\n },\n // checks config for attrs option to serialize records\n hasSerializeIdsOption(attr) {\n let option = this.attrsOption(attr);\n return option && (option.serialize === 'ids' || option.serialize === 'id');\n },\n // checks config for attrs option to serialize records as objects containing id and types\n hasSerializeIdsAndTypesOption(attr) {\n let option = this.attrsOption(attr);\n return option && (option.serialize === 'ids-and-types' || option.serialize === 'id-and-type');\n },\n // checks config for attrs option to serialize records\n noSerializeOptionSpecified(attr) {\n let option = this.attrsOption(attr);\n return !(option && (option.serialize || option.embedded));\n },\n // checks config for attrs option to deserialize records\n // a defined option object for a resource is treated the same as\n // `deserialize: 'records'`\n hasDeserializeRecordsOption(attr) {\n let alwaysEmbed = this.hasEmbeddedAlwaysOption(attr);\n let option = this.attrsOption(attr);\n return alwaysEmbed || option && option.deserialize === 'records';\n },\n attrsOption(attr) {\n let attrs = this.get('attrs');\n return attrs && (attrs[camelize(attr)] || attrs[attr]);\n },\n /**\n @method _extractEmbeddedRecords\n @private\n */\n _extractEmbeddedRecords(serializer, store, typeClass, partial) {\n typeClass.eachRelationship((key, relationship) => {\n if (serializer.hasDeserializeRecordsOption(key)) {\n if (relationship.kind === 'hasMany') {\n this._extractEmbeddedHasMany(store, key, partial, relationship);\n }\n if (relationship.kind === 'belongsTo') {\n this._extractEmbeddedBelongsTo(store, key, partial, relationship);\n }\n }\n });\n return partial;\n },\n /**\n @method _extractEmbeddedHasMany\n @private\n */\n _extractEmbeddedHasMany(store, key, hash, relationshipMeta) {\n let relationshipHash = get(hash, `data.relationships.${key}.data`);\n if (!relationshipHash) {\n return;\n }\n let hasMany = new Array(relationshipHash.length);\n for (let i = 0; i < relationshipHash.length; i++) {\n let item = relationshipHash[i];\n let {\n data,\n included\n } = this._normalizeEmbeddedRelationship(store, relationshipMeta, item);\n hash.included = hash.included || [];\n hash.included.push(data);\n if (included) {\n hash.included = hash.included.concat(included);\n }\n hasMany[i] = {\n id: data.id,\n type: data.type\n };\n }\n let relationship = {\n data: hasMany\n };\n set(hash, `data.relationships.${key}`, relationship);\n },\n /**\n @method _extractEmbeddedBelongsTo\n @private\n */\n _extractEmbeddedBelongsTo(store, key, hash, relationshipMeta) {\n let relationshipHash = get(hash, `data.relationships.${key}.data`);\n if (!relationshipHash) {\n return;\n }\n let {\n data,\n included\n } = this._normalizeEmbeddedRelationship(store, relationshipMeta, relationshipHash);\n hash.included = hash.included || [];\n hash.included.push(data);\n if (included) {\n hash.included = hash.included.concat(included);\n }\n let belongsTo = {\n id: data.id,\n type: data.type\n };\n let relationship = {\n data: belongsTo\n };\n set(hash, `data.relationships.${key}`, relationship);\n },\n /**\n @method _normalizeEmbeddedRelationship\n @private\n */\n _normalizeEmbeddedRelationship(store, relationshipMeta, relationshipHash) {\n let modelName = relationshipMeta.type;\n if (relationshipMeta.options.polymorphic) {\n modelName = relationshipHash.type;\n }\n let modelClass = store.modelFor(modelName);\n let serializer = store.serializerFor(modelName);\n return serializer.normalize(modelClass, relationshipHash, null);\n },\n isEmbeddedRecordsMixin: true\n});","import { get } from '@ember/object';\n\n/*\n Check if the passed model has a `type` attribute or a relationship named `type`.\n */\nfunction modelHasAttributeOrRelationshipNamedType(modelClass) {\n return get(modelClass, 'attributes').has('type') || get(modelClass, 'relationshipsByName').has('type');\n}\nexport { modelHasAttributeOrRelationshipNamedType };","import EmberObject from '@ember/object';\n\n/**\n @module @ember-data/serializer\n*/\n\n/**\n The `Transform` class is used to serialize and deserialize model\n attributes when they are saved or loaded from an\n adapter. Subclassing `Transform` is useful for creating custom\n attributes. All subclasses of `Transform` must implement a\n `serialize` and a `deserialize` method.\n\n Example\n\n ```app/transforms/temperature.js\n import Transform from '@ember-data/serializer/transform';\n\n // Converts centigrade in the JSON to fahrenheit in the app\n export default class TemperatureTransform extends Transform {\n deserialize(serialized, options) {\n return (serialized * 1.8) + 32;\n }\n\n serialize(deserialized, options) {\n return (deserialized - 32) / 1.8;\n }\n }\n ```\n\n Usage\n\n ```app/models/requirement.js\n import Model, { attr } from '@ember-data/model';\n\n export default class RequirementModel extends Model {\n @attr('string') name;\n @attr('temperature') temperature;\n }\n ```\n\n The options passed into the `attr` function when the attribute is\n declared on the model is also available in the transform.\n\n ```app/models/post.js\n import Model, { attr } from '@ember-data/model';\n\n export default class PostModel extends Model {\n @attr('string') title;\n @attr('markdown', {\n markdown: {\n gfm: false,\n sanitize: true\n }\n })\n markdown;\n }\n ```\n\n ```app/transforms/markdown.js\n import Transform from '@ember-data/serializer/transform';\n\n export default class MarkdownTransform extends Transform {\n serialize(deserialized, options) {\n return deserialized.raw;\n }\n\n deserialize(serialized, options) {\n let markdownOptions = options.markdown || {};\n\n return marked(serialized, markdownOptions);\n }\n }\n ```\n\n @class Transform\n @public\n */\nexport default class Transform extends EmberObject {\n /**\n When given a deserialized value from a record attribute this\n method must return the serialized value.\n Example\n ```javascript\n import { isEmpty } from '@ember/utils';\n serialize(deserialized, options) {\n return isEmpty(deserialized) ? null : Number(deserialized);\n }\n ```\n @method serialize\n @public\n @param deserialized The deserialized value\n @param options hash of options passed to `attr`\n @return The serialized value\n */\n /**\n When given a serialized value from a JSON object this method must\n return the deserialized value for the record attribute.\n Example\n ```javascript\n deserialize(serialized, options) {\n return empty(serialized) ? null : Number(serialized);\n }\n ```\n @method deserialize\n @public\n @param serialized The serialized value\n @param options hash of options passed to `attr`\n @return The deserialized value\n */\n}","import { isNone } from '@ember/utils';\nimport Transform from './transform';\n\n/**\n @module @ember-data/serializer\n*/\n\n/**\n The `BooleanTransform` class is used to serialize and deserialize\n boolean attributes on Ember Data record objects. This transform is\n used when `boolean` is passed as the type parameter to the\n [attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function.\n\n Usage\n\n ```app/models/user.js\n import Model, { attr } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @attr('boolean') isAdmin;\n @attr('string') name;\n @attr('string') email;\n }\n ```\n\n By default, the boolean transform only allows for values of `true` or\n `false`. You can opt into allowing `null` values for\n boolean attributes via `attr('boolean', { allowNull: true })`\n\n ```app/models/user.js\n import Model, { attr } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @attr('string') email;\n @attr('string') username;\n @attr('boolean', { allowNull: true }) wantsWeeklyEmail;\n }\n ```\n\n @class BooleanTransform\n @public\n @extends Transform\n */\nexport default class BooleanTransform extends Transform {\n deserialize(serialized, options) {\n if (isNone(serialized) && options.allowNull === true) {\n return null;\n }\n let type = typeof serialized;\n if (type === 'boolean') {\n return serialized;\n } else if (type === 'string') {\n return /^(true|t|1)$/i.test(serialized);\n } else if (type === 'number') {\n return serialized === 1;\n } else {\n return false;\n }\n }\n serialize(deserialized, options) {\n if (isNone(deserialized) && options.allowNull === true) {\n return null;\n }\n return Boolean(deserialized);\n }\n}","import Transform from './transform';\n\n/**\n @module @ember-data/serializer\n*/\n\n/**\n The `DateTransform` class is used to serialize and deserialize\n date attributes on Ember Data record objects. This transform is used\n when `date` is passed as the type parameter to the\n [attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function. It uses the [`ISO 8601`](https://en.wikipedia.org/wiki/ISO_8601)\n standard.\n\n ```app/models/score.js\n import Model, { attr, belongsTo } from '@ember-data/model';\n\n export default class ScoreModel extends Model {\n @attr('number') value;\n @belongsTo('player') player;\n @attr('date') date;\n }\n ```\n\n @class DateTransform\n @public\n @extends Transform\n */\n\nexport default class DateTransform extends Transform {\n deserialize(serialized) {\n let type = typeof serialized;\n if (type === 'string') {\n let offset = serialized.indexOf('+');\n if (offset !== -1 && serialized.length - 5 === offset) {\n offset += 3;\n return new Date(serialized.slice(0, offset) + ':' + serialized.slice(offset));\n }\n return new Date(serialized);\n } else if (type === 'number') {\n return new Date(serialized);\n } else if (serialized === null || serialized === undefined) {\n // if the value is null return null\n // if the value is not present in the data return undefined\n return serialized;\n } else {\n return null;\n }\n }\n serialize(date) {\n if (date instanceof Date && !isNaN(date)) {\n return date.toISOString();\n } else {\n return null;\n }\n }\n}","import Transform from './transform';\n\n/**\n @module @ember-data/serializer\n*/\n\nfunction isNumber(value) {\n return value === value && value !== Infinity && value !== -Infinity;\n}\n\n/**\n The `NumberTransform` class is used to serialize and deserialize\n numeric attributes on Ember Data record objects. This transform is\n used when `number` is passed as the type parameter to the\n [attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function.\n\n Usage\n\n ```app/models/score.js\n import Model, { attr, belongsTo } from '@ember-data/model';\n\n export default class ScoreModel extends Model {\n @attr('number') value;\n @belongsTo('player') player;\n @attr('date') date;\n }\n ```\n\n @class NumberTransform\n @public\n @extends Transform\n */\nexport default class NumberTransform extends Transform {\n deserialize(serialized) {\n let transformed;\n if (serialized === '' || serialized === null || serialized === undefined) {\n return null;\n } else {\n transformed = Number(serialized);\n return isNumber(transformed) ? transformed : null;\n }\n }\n serialize(deserialized) {\n let transformed;\n if (deserialized === '' || deserialized === null || deserialized === undefined) {\n return null;\n } else {\n transformed = Number(deserialized);\n return isNumber(transformed) ? transformed : null;\n }\n }\n}","import { isNone as none } from '@ember/utils';\nimport Transform from './transform';\n\n/**\n @module @ember-data/serializer\n*/\n\n/**\n The `StringTransform` class is used to serialize and deserialize\n string attributes on Ember Data record objects. This transform is\n used when `string` is passed as the type parameter to the\n [attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function.\n\n Usage\n\n ```app/models/user.js\n import Model, { attr, belongsTo } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @attr('boolean') isAdmin;\n @attr('string') name;\n @attr('string') email;\n }\n ```\n\n @class StringTransform\n @public\n @extends Transform\n */\nexport default class StringTransform extends Transform {\n deserialize(serialized) {\n return none(serialized) ? null : String(serialized);\n }\n serialize(deserialized) {\n return none(deserialized) ? null : String(deserialized);\n }\n}","var _class2, _descriptor;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n/**\n ## Overview\n\n In order to properly manage and present your data, EmberData\n needs to understand the structure of data it receives.\n\n `Serializers` convert data between the server's API format and\n the format EmberData understands.\n\n Data received from an API response is **normalized** into\n [JSON:API](https://jsonapi.org/) (the format used internally\n by EmberData), while data sent to an API is **serialized**\n into the format the API expects.\n\n ### Implementing a Serializer\n\n There are only two required serializer methods, one for\n normalizing data from the server API format into JSON:API, and\n another for serializing records via `Snapshots` into the expected\n server API format.\n\n To implement a serializer, export a class that conforms to the structure\n described by the [MinimumSerializerInterface](/ember-data/release/classes/MinimumSerializerInterface)\n from the `app/serializers/` directory. An example is below.\n\n ```ts\n import EmberObject from '@ember/object';\n\n export default class ApplicationSerializer extends EmberObject {\n normalizeResponse(store, schema, rawPayload) {\n return rawPayload;\n }\n\n serialize(snapshot, options) {\n const serializedResource = {\n id: snapshot.id,\n type: snapshot.modelName,\n attributes: snapshot.attributes()\n };\n\n return serializedResource;\n }\n }\n ```\n\n\n ### Serializer Resolution\n\n `store.serializerFor(name)` will lookup serializers defined in\n `app/serializers/` and return an instance. If no serializer is found, an\n error will be thrown.\n\n `serializerFor` first attempts to find a serializer with an exact match on `name`,\n then falls back to checking for the presence of a serializer named `application`.\n\n ```ts\n store.serializerFor('author');\n\n // lookup paths (in order) =>\n // app/serializers/author.js\n // app/serializers/application.js\n ```\n\n Most requests in EmberData are made with respect to a particular `type` (or `modelName`)\n (e.g., \"get me the full collection of **books**\" or \"get me the **employee** whose id is 37\"). We\n refer to this as the **primary** resource `type`.\n\n Typically `serializerFor` will be used to find a serializer with a name matching that of the primary\n resource `type` for the request, falling back to the `application` serializer for those types that\n do not have a defined serializer. This is often described as a `per-model` or `per-type` strategy\n for defining serializers. However, because APIs rarely format payloads per-type but rather\n per-API-version, this may not be a desired strategy.\n\n It is recommended that applications define only a single `application` adapter and serializer\n where possible.\n\n If you have multiple API formats and the per-type strategy is not viable, one strategy is to\n write an `application` adapter and serializer that make use of `options` to specify the desired\n format when making a request.\n\n ### Using a Serializer\n\n Any serializer in `app/serializers/` can be looked up by `name` using `store.serializerFor(name)`.\n\n ### Default Serializers\n\n For applications whose APIs are *very close to* or *exactly* the **REST** format or **JSON:API**\n format the `@ember-data/serializer` package contains implementations these applications can\n extend. It also contains a simple `JSONSerializer` for serializing to/from very basic JSON objects.\n\n Many applications will find writing their own serializer to be more performant and less\n complex than extending these classes even when their API format is very close to that expected\n by these serializers.\n\n It is recommended that apps write their own serializer to best suit the needs of their API and\n application.\n\n @module @ember-data/serializer\n @main @ember-data/serializer\n*/\n\nimport EmberObject from '@ember/object';\nimport { inject as service } from '@ember/service';\n/**\n `Serializer` is an abstract base class that you should override in your\n application to customize it for your backend. The minimum set of methods\n that you should implement is:\n\n * `normalizeResponse()`\n * `serialize()`\n\n And you can optionally override the following methods:\n\n * `normalize()`\n\n For an example implementation, see\n [JSONSerializer](JSONSerializer), the included JSON serializer.\n\n @class Serializer\n @public\n @extends Ember.EmberObject\n*/\nlet _class = (_class2 = class _class2 extends EmberObject {\n constructor(...args) {\n super(...args);\n _initializerDefineProperty(this, \"store\", _descriptor, this);\n }\n /**\n The `store` property is the application's `store` that contains\n all records. It can be used to look up serializers for other model\n types that may be nested inside the payload response.\n Example:\n ```js\n Serializer.extend({\n extractRelationship(relationshipModelName, relationshipHash) {\n let modelClass = this.store.modelFor(relationshipModelName);\n let relationshipSerializer = this.store.serializerFor(relationshipModelName);\n return relationshipSerializer.normalize(modelClass, relationshipHash);\n }\n });\n ```\n @property store\n @type {Store}\n @public\n */\n\n /**\n The `normalizeResponse` method is used to normalize a payload from the\n server to a JSON-API Document.\n http://jsonapi.org/format/#document-structure\n Example:\n ```js\n Serializer.extend({\n normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n if (requestType === 'findRecord') {\n return this.normalize(primaryModelClass, payload);\n } else {\n return payload.reduce(function(documentHash, item) {\n let { data, included } = this.normalize(primaryModelClass, item);\n documentHash.included.push(...included);\n documentHash.data.push(data);\n return documentHash;\n }, { data: [], included: [] })\n }\n }\n });\n ```\n @since 1.13.0\n @method normalizeResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n\n /**\n The `serialize` method is used when a record is saved in order to convert\n the record into the form that your external data source expects.\n `serialize` takes an optional `options` hash with a single option:\n - `includeId`: If this is `true`, `serialize` should include the ID\n in the serialized object it builds.\n Example:\n ```js\n Serializer.extend({\n serialize(snapshot, options) {\n let json = {\n id: snapshot.id\n };\n snapshot.eachAttribute((key, attribute) => {\n json[key] = snapshot.attr(key);\n });\n snapshot.eachRelationship((key, relationship) => {\n if (relationship.kind === 'belongsTo') {\n json[key] = snapshot.belongsTo(key, { id: true });\n } else if (relationship.kind === 'hasMany') {\n json[key] = snapshot.hasMany(key, { ids: true });\n }\n });\n return json;\n },\n });\n ```\n @method serialize\n @public\n @param {Snapshot} snapshot\n @param {Object} [options]\n @return {Object}\n */\n\n /**\n The `normalize` method is used to convert a payload received from your\n external data source into the normalized form `store.push()` expects. You\n should override this method, munge the hash and return the normalized\n payload.\n Example:\n ```js\n Serializer.extend({\n normalize(modelClass, resourceHash) {\n let data = {\n id: resourceHash.id,\n type: modelClass.modelName,\n attributes: resourceHash\n };\n return { data: data };\n }\n })\n ```\n @method normalize\n @public\n @param {Model} typeClass\n @param {Object} hash\n @return {Object}\n */\n normalize(typeClass, hash) {\n return hash;\n }\n}, _descriptor = _applyDecoratedDescriptor(_class2.prototype, \"store\", [service], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _class2);\nexport { _class as default };","/**\n * @module @ember-data/serializer/json-api\n */\nimport { assert, warn } from '@ember/debug';\nimport { dasherize } from '@ember/string';\nimport { isNone, typeOf } from '@ember/utils';\nimport { DEBUG } from '@glimmer/env';\nimport { pluralize, singularize } from 'ember-inflector';\nimport JSONSerializer from '@ember-data/serializer/json';\nimport { normalizeModelName } from '@ember-data/store';\n\n/**\n Ember Data 2.0 Serializer:\n\n In Ember Data a Serializer is used to serialize and deserialize\n records when they are transferred in and out of an external source.\n This process involves normalizing property names, transforming\n attribute values and serializing relationships.\n\n `JSONAPISerializer` supports the http://jsonapi.org/ spec and is the\n serializer recommended by Ember Data.\n\n This serializer normalizes a JSON API payload that looks like:\n\n ```app/models/player.js\n import Model, { attr, belongsTo } from '@ember-data/model';\n\n export default class Player extends Model {\n @attr('string') name;\n @attr('string') skill;\n @attr('number') gamesPlayed;\n @belongsTo('club') club;\n }\n ```\n\n ```app/models/club.js\n import Model, { attr, hasMany } from '@ember-data/model';\n\n export default class Club extends Model {\n @attr('string') name;\n @attr('string') location;\n @hasMany('player') players;\n }\n ```\n\n ```js\n {\n \"data\": [\n {\n \"attributes\": {\n \"name\": \"Benfica\",\n \"location\": \"Portugal\"\n },\n \"id\": \"1\",\n \"relationships\": {\n \"players\": {\n \"data\": [\n {\n \"id\": \"3\",\n \"type\": \"players\"\n }\n ]\n }\n },\n \"type\": \"clubs\"\n }\n ],\n \"included\": [\n {\n \"attributes\": {\n \"name\": \"Eusebio Silva Ferreira\",\n \"skill\": \"Rocket shot\",\n \"games-played\": 431\n },\n \"id\": \"3\",\n \"relationships\": {\n \"club\": {\n \"data\": {\n \"id\": \"1\",\n \"type\": \"clubs\"\n }\n }\n },\n \"type\": \"players\"\n }\n ]\n }\n ```\n\n to the format that the Ember Data store expects.\n\n ### Customizing meta\n\n Since a JSON API Document can have meta defined in multiple locations you can\n use the specific serializer hooks if you need to customize the meta.\n\n One scenario would be to camelCase the meta keys of your payload. The example\n below shows how this could be done using `normalizeArrayResponse` and\n `extractRelationship`.\n\n ```app/serializers/application.js\n import JSONAPISerializer from '@ember-data/serializer/json-api';\n\n export default class ApplicationSerializer extends JSONAPISerializer {\n normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {\n let normalizedDocument = super.normalizeArrayResponse(...arguments);\n\n // Customize document meta\n normalizedDocument.meta = camelCaseKeys(normalizedDocument.meta);\n\n return normalizedDocument;\n }\n\n extractRelationship(relationshipHash) {\n let normalizedRelationship = super.extractRelationship(...arguments);\n\n // Customize relationship meta\n normalizedRelationship.meta = camelCaseKeys(normalizedRelationship.meta);\n\n return normalizedRelationship;\n }\n }\n ```\n\n @main @ember-data/serializer/json-api\n @since 1.13.0\n @class JSONAPISerializer\n @public\n @extends JSONSerializer\n*/\nconst JSONAPISerializer = JSONSerializer.extend({\n /**\n @method _normalizeDocumentHelper\n @param {Object} documentHash\n @return {Object}\n @private\n */\n _normalizeDocumentHelper(documentHash) {\n if (typeOf(documentHash.data) === 'object') {\n documentHash.data = this._normalizeResourceHelper(documentHash.data);\n } else if (Array.isArray(documentHash.data)) {\n let ret = new Array(documentHash.data.length);\n for (let i = 0; i < documentHash.data.length; i++) {\n let data = documentHash.data[i];\n ret[i] = this._normalizeResourceHelper(data);\n }\n documentHash.data = ret;\n }\n if (Array.isArray(documentHash.included)) {\n let ret = new Array();\n for (let i = 0; i < documentHash.included.length; i++) {\n let included = documentHash.included[i];\n let normalized = this._normalizeResourceHelper(included);\n if (normalized !== null) {\n // can be null when unknown type is encountered\n ret.push(normalized);\n }\n }\n documentHash.included = ret;\n }\n return documentHash;\n },\n /**\n @method _normalizeRelationshipDataHelper\n @param {Object} relationshipDataHash\n @return {Object}\n @private\n */\n _normalizeRelationshipDataHelper(relationshipDataHash) {\n relationshipDataHash.type = this.modelNameFromPayloadKey(relationshipDataHash.type);\n return relationshipDataHash;\n },\n /**\n @method _normalizeResourceHelper\n @param {Object} resourceHash\n @return {Object}\n @private\n */\n _normalizeResourceHelper(resourceHash) {\n assert(this.warnMessageForUndefinedType(), !isNone(resourceHash.type));\n let modelName, usedLookup;\n modelName = this.modelNameFromPayloadKey(resourceHash.type);\n usedLookup = 'modelNameFromPayloadKey';\n if (!this.store.getSchemaDefinitionService().doesTypeExist(modelName)) {\n warn(this.warnMessageNoModelForType(modelName, resourceHash.type, usedLookup), false, {\n id: 'ds.serializer.model-for-type-missing'\n });\n return null;\n }\n let modelClass = this.store.modelFor(modelName);\n let serializer = this.store.serializerFor(modelName);\n let {\n data\n } = serializer.normalize(modelClass, resourceHash);\n return data;\n },\n /**\n Normalize some data and push it into the store.\n @method pushPayload\n @public\n @param {Store} store\n @param {Object} payload\n */\n pushPayload(store, payload) {\n let normalizedPayload = this._normalizeDocumentHelper(payload);\n store.push(normalizedPayload);\n },\n /**\n @method _normalizeResponse\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @param {Boolean} isSingle\n @return {Object} JSON-API Document\n @private\n */\n _normalizeResponse(store, primaryModelClass, payload, id, requestType, isSingle) {\n let normalizedPayload = this._normalizeDocumentHelper(payload);\n return normalizedPayload;\n },\n normalizeQueryRecordResponse() {\n let normalized = this._super(...arguments);\n assert('Expected the primary data returned by the serializer for a `queryRecord` response to be a single object but instead it was an array.', !Array.isArray(normalized.data));\n return normalized;\n },\n extractAttributes(modelClass, resourceHash) {\n let attributes = {};\n if (resourceHash.attributes) {\n modelClass.eachAttribute(key => {\n let attributeKey = this.keyForAttribute(key, 'deserialize');\n if (resourceHash.attributes[attributeKey] !== undefined) {\n attributes[key] = resourceHash.attributes[attributeKey];\n }\n if (DEBUG) {\n if (resourceHash.attributes[attributeKey] === undefined && resourceHash.attributes[key] !== undefined) {\n assert(`Your payload for '${modelClass.modelName}' contains '${key}', but your serializer is setup to look for '${attributeKey}'. This is most likely because Ember Data's JSON API serializer dasherizes attribute keys by default. You should subclass JSONAPISerializer and implement 'keyForAttribute(key) { return key; }' to prevent Ember Data from customizing your attribute keys.`, false);\n }\n }\n });\n }\n return attributes;\n },\n /**\n Returns a relationship formatted as a JSON-API \"relationship object\".\n http://jsonapi.org/format/#document-resource-object-relationships\n @method extractRelationship\n @public\n @param {Object} relationshipHash\n @return {Object}\n */\n extractRelationship(relationshipHash) {\n if (typeOf(relationshipHash.data) === 'object') {\n relationshipHash.data = this._normalizeRelationshipDataHelper(relationshipHash.data);\n }\n if (Array.isArray(relationshipHash.data)) {\n let ret = new Array(relationshipHash.data.length);\n for (let i = 0; i < relationshipHash.data.length; i++) {\n let data = relationshipHash.data[i];\n ret[i] = this._normalizeRelationshipDataHelper(data);\n }\n relationshipHash.data = ret;\n }\n return relationshipHash;\n },\n /**\n Returns the resource's relationships formatted as a JSON-API \"relationships object\".\n http://jsonapi.org/format/#document-resource-object-relationships\n @method extractRelationships\n @public\n @param {Object} modelClass\n @param {Object} resourceHash\n @return {Object}\n */\n extractRelationships(modelClass, resourceHash) {\n let relationships = {};\n if (resourceHash.relationships) {\n modelClass.eachRelationship((key, relationshipMeta) => {\n let relationshipKey = this.keyForRelationship(key, relationshipMeta.kind, 'deserialize');\n if (resourceHash.relationships[relationshipKey] !== undefined) {\n let relationshipHash = resourceHash.relationships[relationshipKey];\n relationships[key] = this.extractRelationship(relationshipHash);\n }\n if (DEBUG) {\n if (resourceHash.relationships[relationshipKey] === undefined && resourceHash.relationships[key] !== undefined) {\n assert(`Your payload for '${modelClass.modelName}' contains '${key}', but your serializer is setup to look for '${relationshipKey}'. This is most likely because Ember Data's JSON API serializer dasherizes relationship keys by default. You should subclass JSONAPISerializer and implement 'keyForRelationship(key) { return key; }' to prevent Ember Data from customizing your relationship keys.`, false);\n }\n }\n });\n }\n return relationships;\n },\n /**\n @method _extractType\n @param {Model} modelClass\n @param {Object} resourceHash\n @return {String}\n @private\n */\n _extractType(modelClass, resourceHash) {\n return this.modelNameFromPayloadKey(resourceHash.type);\n },\n /**\n Dasherizes and singularizes the model name in the payload to match\n the format Ember Data uses internally for the model name.\n For example the key `posts` would be converted to `post` and the\n key `studentAssesments` would be converted to `student-assesment`.\n @method modelNameFromPayloadKey\n @public\n @param {String} key\n @return {String} the model's modelName\n */\n modelNameFromPayloadKey(key) {\n return singularize(normalizeModelName(key));\n },\n /**\n Converts the model name to a pluralized version of the model name.\n For example `post` would be converted to `posts` and\n `student-assesment` would be converted to `student-assesments`.\n @method payloadKeyFromModelName\n @public\n @param {String} modelName\n @return {String}\n */\n // TODO @deprecated Use payloadTypeFromModelName instead\n payloadKeyFromModelName(modelName) {\n return pluralize(modelName);\n },\n normalize(modelClass, resourceHash) {\n if (resourceHash.attributes) {\n this.normalizeUsingDeclaredMapping(modelClass, resourceHash.attributes);\n }\n if (resourceHash.relationships) {\n this.normalizeUsingDeclaredMapping(modelClass, resourceHash.relationships);\n }\n let data = {\n id: this.extractId(modelClass, resourceHash),\n type: this._extractType(modelClass, resourceHash),\n attributes: this.extractAttributes(modelClass, resourceHash),\n relationships: this.extractRelationships(modelClass, resourceHash)\n };\n this.applyTransforms(modelClass, data.attributes);\n return {\n data\n };\n },\n /**\n `keyForAttribute` can be used to define rules for how to convert an\n attribute name in your model to a key in your JSON.\n By default `JSONAPISerializer` follows the format used on the examples of\n http://jsonapi.org/format and uses dashes as the word separator in the JSON\n attribute keys.\n This behaviour can be easily customized by extending this method.\n Example\n ```app/serializers/application.js\n import JSONAPISerializer from '@ember-data/serializer/json-api';\n import { dasherize } from '@ember/string';\n export default class ApplicationSerializer extends JSONAPISerializer {\n keyForAttribute(attr, method) {\n return dasherize(attr).toUpperCase();\n }\n }\n ```\n @method keyForAttribute\n @public\n @param {String} key\n @param {String} method\n @return {String} normalized key\n */\n keyForAttribute(key, method) {\n return dasherize(key);\n },\n /**\n `keyForRelationship` can be used to define a custom key when\n serializing and deserializing relationship properties.\n By default `JSONAPISerializer` follows the format used on the examples of\n http://jsonapi.org/format and uses dashes as word separators in\n relationship properties.\n This behaviour can be easily customized by extending this method.\n Example\n ```app/serializers/post.js\n import JSONAPISerializer from '@ember-data/serializer/json-api';\n import { underscore } from '@ember/string';\n export default class ApplicationSerializer extends JSONAPISerializer {\n keyForRelationship(key, relationship, method) {\n return underscore(key);\n }\n }\n ```\n @method keyForRelationship\n @public\n @param {String} key\n @param {String} typeClass\n @param {String} method\n @return {String} normalized key\n */\n keyForRelationship(key, typeClass, method) {\n return dasherize(key);\n },\n /**\n Called when a record is saved in order to convert the\n record into JSON.\n For example, consider this model:\n ```app/models/comment.js\n import Model, { attr, belongsTo } from '@ember-data/model';\n export default class CommentModel extends Model {\n @attr title;\n @attr body;\n @belongsTo('user', { async: false, inverse: null })\n author;\n }\n ```\n The default serialization would create a JSON-API resource object like:\n ```javascript\n {\n \"data\": {\n \"type\": \"comments\",\n \"attributes\": {\n \"title\": \"Rails is unagi\",\n \"body\": \"Rails? Omakase? O_O\",\n },\n \"relationships\": {\n \"author\": {\n \"data\": {\n \"id\": \"12\",\n \"type\": \"users\"\n }\n }\n }\n }\n }\n ```\n By default, attributes are passed through as-is, unless\n you specified an attribute type (`attr('date')`). If\n you specify a transform, the JavaScript value will be\n serialized when inserted into the attributes hash.\n Belongs-to relationships are converted into JSON-API\n resource identifier objects.\n ## IDs\n `serialize` takes an options hash with a single option:\n `includeId`. If this option is `true`, `serialize` will,\n by default include the ID in the JSON object it builds.\n The JSONAPIAdapter passes in `includeId: true` when serializing a record\n for `createRecord` or `updateRecord`.\n ## Customization\n Your server may expect data in a different format than the\n built-in serialization format.\n In that case, you can implement `serialize` yourself and\n return data formatted to match your API's expectations, or override\n the invoked adapter method and do the serialization in the adapter directly\n by using the provided snapshot.\n If your API's format differs greatly from the JSON:API spec, you should\n consider authoring your own adapter and serializer instead of extending\n this class.\n ```app/serializers/post.js\n import JSONAPISerializer from '@ember-data/serializer/json-api';\n export default class PostSerializer extends JSONAPISerializer {\n serialize(snapshot, options) {\n let json = {\n POST_TTL: snapshot.attr('title'),\n POST_BDY: snapshot.attr('body'),\n POST_CMS: snapshot.hasMany('comments', { ids: true })\n };\n if (options.includeId) {\n json.POST_ID_ = snapshot.id;\n }\n return json;\n }\n }\n ```\n ## Customizing an App-Wide Serializer\n If you want to define a serializer for your entire\n application, you'll probably want to use `eachAttribute`\n and `eachRelationship` on the record.\n ```app/serializers/application.js\n import JSONAPISerializer from '@ember-data/serializer/json-api';\n import { singularize } from 'ember-inflector';\n import { underscore } from '@ember/string';\n export default class ApplicationSerializer extends JSONAPISerializer {\n serialize(snapshot, options) {\n let json = {};\n snapshot.eachAttribute((name) => {\n json[serverAttributeName(name)] = snapshot.attr(name);\n });\n snapshot.eachRelationship((name, relationship) => {\n if (relationship.kind === 'hasMany') {\n json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n }\n });\n if (options.includeId) {\n json.ID_ = snapshot.id;\n }\n return json;\n }\n }\n function serverAttributeName(attribute) {\n return underscore(attribute).toUpperCase();\n }\n function serverHasManyName(name) {\n return serverAttributeName(singularize(name)) + '_IDS';\n }\n ```\n This serializer will generate JSON that looks like this:\n ```javascript\n {\n \"TITLE\": \"Rails is omakase\",\n \"BODY\": \"Yep. Omakase.\",\n \"COMMENT_IDS\": [ \"1\", \"2\", \"3\" ]\n }\n ```\n ## Tweaking the Default Formatting\n If you just want to do some small tweaks on the default JSON:API formatted response,\n you can call `super.serialize` first and make the tweaks\n on the returned object.\n ```app/serializers/post.js\n import JSONAPISerializer from '@ember-data/serializer/json-api';\n export default class PostSerializer extends JSONAPISerializer {\n serialize(snapshot, options) {\n let json = super.serialize(...arguments);\n json.data.attributes.subject = json.data.attributes.title;\n delete json.data.attributes.title;\n return json;\n }\n }\n ```\n @method serialize\n @public\n @param {Snapshot} snapshot\n @param {Object} options\n @return {Object} json\n */\n serialize(snapshot, options) {\n let data = this._super(...arguments);\n data.type = this.payloadKeyFromModelName(snapshot.modelName);\n return {\n data\n };\n },\n serializeAttribute(snapshot, json, key, attribute) {\n let type = attribute.type;\n if (this._canSerialize(key)) {\n json.attributes = json.attributes || {};\n let value = snapshot.attr(key);\n if (type) {\n let transform = this.transformFor(type);\n value = transform.serialize(value, attribute.options);\n }\n let schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(key, schema);\n if (payloadKey === key) {\n payloadKey = this.keyForAttribute(key, 'serialize');\n }\n json.attributes[payloadKey] = value;\n }\n },\n serializeBelongsTo(snapshot, json, relationship) {\n let key = relationship.key;\n if (this._canSerialize(key)) {\n let belongsTo = snapshot.belongsTo(key);\n let belongsToIsNotNew = belongsTo && !belongsTo.isNew;\n if (belongsTo === null || belongsToIsNotNew) {\n json.relationships = json.relationships || {};\n let schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(key, schema);\n if (payloadKey === key) {\n payloadKey = this.keyForRelationship(key, 'belongsTo', 'serialize');\n }\n let data = null;\n if (belongsTo) {\n let payloadType = this.payloadKeyFromModelName(belongsTo.modelName);\n data = {\n type: payloadType,\n id: belongsTo.id\n };\n }\n json.relationships[payloadKey] = {\n data\n };\n }\n }\n },\n serializeHasMany(snapshot, json, relationship) {\n let key = relationship.key;\n if (this.shouldSerializeHasMany(snapshot, key, relationship)) {\n let hasMany = snapshot.hasMany(key);\n if (hasMany !== undefined) {\n json.relationships = json.relationships || {};\n let schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(key, schema);\n if (payloadKey === key && this.keyForRelationship) {\n payloadKey = this.keyForRelationship(key, 'hasMany', 'serialize');\n }\n\n // only serialize has many relationships that are not new\n let nonNewHasMany = hasMany.filter(item => item.record && !item.record.get('isNew'));\n let data = new Array(nonNewHasMany.length);\n for (let i = 0; i < nonNewHasMany.length; i++) {\n let item = hasMany[i];\n let payloadType = this.payloadKeyFromModelName(item.modelName);\n data[i] = {\n type: payloadType,\n id: item.id\n };\n }\n json.relationships[payloadKey] = {\n data\n };\n }\n }\n }\n});\nif (DEBUG) {\n JSONAPISerializer.reopen({\n init(...args) {\n this._super(...args);\n assert(`You've used the EmbeddedRecordsMixin in ${this.toString()} which is not fully compatible with the JSON:API specification. Please confirm that this works for your specific API and add \\`this.isEmbeddedRecordsMixinCompatible = true\\` to your serializer.`, !this.isEmbeddedRecordsMixin || this.isEmbeddedRecordsMixinCompatible === true);\n let constructor = this.constructor;\n warn(`You've defined 'extractMeta' in ${constructor.toString()} which is not used for serializers extending JSONAPISerializer. Read more at https://api.emberjs.com/ember-data/release/classes/JSONAPISerializer on how to customize meta when using JSON API.`, this.extractMeta === JSONSerializer.prototype.extractMeta, {\n id: 'ds.serializer.json-api.extractMeta'\n });\n },\n warnMessageForUndefinedType() {\n return 'Encountered a resource object with an undefined type (resolved resource using ' + this.constructor.toString() + ')';\n },\n warnMessageNoModelForType(modelName, originalType, usedLookup) {\n return `Encountered a resource object with type \"${originalType}\", but no model was found for model name \"${modelName}\" (resolved model name using '${this.constructor.toString()}.${usedLookup}(\"${originalType}\")').`;\n }\n });\n}\nexport default JSONAPISerializer;","/**\n * @module @ember-data/serializer/json\n */\nimport { getOwner } from '@ember/application';\nimport { assert, warn } from '@ember/debug';\nimport { get } from '@ember/object';\nimport { isNone, typeOf } from '@ember/utils';\nimport Serializer from '@ember-data/serializer';\nimport { normalizeModelName } from '@ember-data/store';\nimport { coerceId, errorsArrayToHash } from '@ember-data/store/-private';\nimport { modelHasAttributeOrRelationshipNamedType } from './-private';\n\n/**\n Ember Data 2.0 Serializer:\n\n In Ember Data a Serializer is used to serialize and deserialize\n records when they are transferred in and out of an external source.\n This process involves normalizing property names, transforming\n attribute values and serializing relationships.\n\n By default, Ember Data uses and recommends the `JSONAPISerializer`.\n\n `JSONSerializer` is useful for simpler or legacy backends that may\n not support the http://jsonapi.org/ spec.\n\n For example, given the following `User` model and JSON payload:\n\n ```app/models/user.js\n import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @hasMany('user') friends;\n @belongsTo('location') house;\n\n @attr('string') name;\n }\n ```\n\n ```js\n {\n id: 1,\n name: 'Sebastian',\n friends: [3, 4],\n links: {\n house: '/houses/lefkada'\n }\n }\n ```\n\n `JSONSerializer` will normalize the JSON payload to the JSON API format that the\n Ember Data store expects.\n\n You can customize how JSONSerializer processes its payload by passing options in\n the `attrs` hash or by subclassing the `JSONSerializer` and overriding hooks:\n\n - To customize how a single record is normalized, use the `normalize` hook.\n - To customize how `JSONSerializer` normalizes the whole server response, use the\n `normalizeResponse` hook.\n - To customize how `JSONSerializer` normalizes a specific response from the server,\n use one of the many specific `normalizeResponse` hooks.\n - To customize how `JSONSerializer` normalizes your id, attributes or relationships,\n use the `extractId`, `extractAttributes` and `extractRelationships` hooks.\n\n The `JSONSerializer` normalization process follows these steps:\n\n 1. `normalizeResponse`\n - entry method to the serializer.\n 2. `normalizeCreateRecordResponse`\n - a `normalizeResponse` for a specific operation is called.\n 3. `normalizeSingleResponse`|`normalizeArrayResponse`\n - for methods like `createRecord` we expect a single record back, while for methods like `findAll` we expect multiple records back.\n 4. `normalize`\n - `normalizeArrayResponse` iterates and calls `normalize` for each of its records while `normalizeSingle`\n calls it once. This is the method you most likely want to subclass.\n 5. `extractId` | `extractAttributes` | `extractRelationships`\n - `normalize` delegates to these methods to\n turn the record payload into the JSON API format.\n\n @main @ember-data/serializer/json\n @class JSONSerializer\n @public\n @extends Serializer\n*/\nconst JSONSerializer = Serializer.extend({\n /**\n The `primaryKey` is used when serializing and deserializing\n data. Ember Data always uses the `id` property to store the id of\n the record. The external source may not always follow this\n convention. In these cases it is useful to override the\n `primaryKey` property to match the `primaryKey` of your external\n store.\n Example\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n export default class ApplicationSerializer extends JSONSerializer {\n primaryKey = '_id'\n }\n ```\n @property primaryKey\n @type {String}\n @public\n @default 'id'\n */\n primaryKey: 'id',\n /**\n The `attrs` object can be used to declare a simple mapping between\n property names on `Model` records and payload keys in the\n serialized JSON object representing the record. An object with the\n property `key` can also be used to designate the attribute's key on\n the response payload.\n Example\n ```app/models/person.js\n import Model, { attr } from '@ember-data/model';\n export default class PersonModel extends Model {\n @attr('string') firstName;\n @attr('string') lastName;\n @attr('string') occupation;\n @attr('boolean') admin;\n }\n ```\n ```app/serializers/person.js\n import JSONSerializer from '@ember-data/serializer/json';\n export default class PersonSerializer extends JSONSerializer {\n attrs = {\n admin: 'is_admin',\n occupation: { key: 'career' }\n }\n }\n ```\n You can also remove attributes and relationships by setting the `serialize`\n key to `false` in your mapping object.\n Example\n ```app/serializers/person.js\n import JSONSerializer from '@ember-data/serializer/json';\n export default class PostSerializer extends JSONSerializer {\n attrs = {\n admin: { serialize: false },\n occupation: { key: 'career' }\n }\n }\n ```\n When serialized:\n ```javascript\n {\n \"firstName\": \"Harry\",\n \"lastName\": \"Houdini\",\n \"career\": \"magician\"\n }\n ```\n Note that the `admin` is now not included in the payload.\n Setting `serialize` to `true` enforces serialization for hasMany\n relationships even if it's neither a many-to-many nor many-to-none\n relationship.\n @property attrs\n @public\n @type {Object}\n */\n mergedProperties: ['attrs'],\n /**\n Given a subclass of `Model` and a JSON object this method will\n iterate through each attribute of the `Model` and invoke the\n `Transform#deserialize` method on the matching property of the\n JSON object. This method is typically called after the\n serializer's `normalize` method.\n @method applyTransforms\n @private\n @param {Model} typeClass\n @param {Object} data The data to transform\n @return {Object} data The transformed data object\n */\n applyTransforms(typeClass, data) {\n let attributes = get(typeClass, 'attributes');\n typeClass.eachTransformedAttribute((key, typeClass) => {\n if (data[key] === undefined) {\n return;\n }\n let transform = this.transformFor(typeClass);\n let transformMeta = attributes.get(key);\n data[key] = transform.deserialize(data[key], transformMeta.options);\n });\n return data;\n },\n /**\n The `normalizeResponse` method is used to normalize a payload from the\n server to a JSON-API Document.\n http://jsonapi.org/format/#document-structure\n This method delegates to a more specific normalize method based on\n the `requestType`.\n To override this method with a custom one, make sure to call\n `return super.normalizeResponse(store, primaryModelClass, payload, id, requestType)` with your\n pre-processed data.\n Here's an example of using `normalizeResponse` manually:\n ```javascript\n socket.on('message', function(message) {\n let data = message.data;\n let modelClass = store.modelFor(data.modelName);\n let serializer = store.serializerFor(data.modelName);\n let normalized = serializer.normalizeSingleResponse(store, modelClass, data, data.id);\n store.push(normalized);\n });\n ```\n @since 1.13.0\n @method normalizeResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n switch (requestType) {\n case 'findRecord':\n return this.normalizeFindRecordResponse(...arguments);\n case 'queryRecord':\n return this.normalizeQueryRecordResponse(...arguments);\n case 'findAll':\n return this.normalizeFindAllResponse(...arguments);\n case 'findBelongsTo':\n return this.normalizeFindBelongsToResponse(...arguments);\n case 'findHasMany':\n return this.normalizeFindHasManyResponse(...arguments);\n case 'findMany':\n return this.normalizeFindManyResponse(...arguments);\n case 'query':\n return this.normalizeQueryResponse(...arguments);\n case 'createRecord':\n return this.normalizeCreateRecordResponse(...arguments);\n case 'deleteRecord':\n return this.normalizeDeleteRecordResponse(...arguments);\n case 'updateRecord':\n return this.normalizeUpdateRecordResponse(...arguments);\n }\n },\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findRecord`\n @since 1.13.0\n @method normalizeFindRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSingleResponse(...arguments);\n },\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `queryRecord`\n @since 1.13.0\n @method normalizeQueryRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeQueryRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSingleResponse(...arguments);\n },\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findAll`\n @since 1.13.0\n @method normalizeFindAllResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindAllResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeArrayResponse(...arguments);\n },\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findBelongsTo`\n @since 1.13.0\n @method normalizeFindBelongsToResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindBelongsToResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSingleResponse(...arguments);\n },\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findHasMany`\n @since 1.13.0\n @method normalizeFindHasManyResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindHasManyResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeArrayResponse(...arguments);\n },\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `findMany`\n @since 1.13.0\n @method normalizeFindManyResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeFindManyResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeArrayResponse(...arguments);\n },\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `query`\n @since 1.13.0\n @method normalizeQueryResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeQueryResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeArrayResponse(...arguments);\n },\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `createRecord`\n @since 1.13.0\n @method normalizeCreateRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeCreateRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSaveResponse(...arguments);\n },\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `deleteRecord`\n @since 1.13.0\n @method normalizeDeleteRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeDeleteRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSaveResponse(...arguments);\n },\n /**\n Called by the default normalizeResponse implementation when the\n type of request is `updateRecord`\n @since 1.13.0\n @method normalizeUpdateRecordResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeUpdateRecordResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSaveResponse(...arguments);\n },\n /**\n normalizeUpdateRecordResponse, normalizeCreateRecordResponse and\n normalizeDeleteRecordResponse delegate to this method by default.\n @since 1.13.0\n @method normalizeSaveResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeSaveResponse(store, primaryModelClass, payload, id, requestType) {\n return this.normalizeSingleResponse(...arguments);\n },\n /**\n normalizeQueryResponse and normalizeFindRecordResponse delegate to this\n method by default.\n @since 1.13.0\n @method normalizeSingleResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeSingleResponse(store, primaryModelClass, payload, id, requestType) {\n return this._normalizeResponse(store, primaryModelClass, payload, id, requestType, true);\n },\n /**\n normalizeQueryResponse, normalizeFindManyResponse, and normalizeFindHasManyResponse delegate\n to this method by default.\n @since 1.13.0\n @method normalizeArrayResponse\n @public\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @return {Object} JSON-API Document\n */\n normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {\n return this._normalizeResponse(store, primaryModelClass, payload, id, requestType, false);\n },\n /**\n @method _normalizeResponse\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @param {Boolean} isSingle\n @return {Object} JSON-API Document\n @private\n */\n _normalizeResponse(store, primaryModelClass, payload, id, requestType, isSingle) {\n let documentHash = {\n data: null,\n included: []\n };\n let meta = this.extractMeta(store, primaryModelClass, payload);\n if (meta) {\n assert('The `meta` returned from `extractMeta` has to be an object, not \"' + typeOf(meta) + '\".', typeOf(meta) === 'object');\n documentHash.meta = meta;\n }\n if (isSingle) {\n let {\n data,\n included\n } = this.normalize(primaryModelClass, payload);\n documentHash.data = data;\n if (included) {\n documentHash.included = included;\n }\n } else {\n let ret = new Array(payload.length);\n for (let i = 0, l = payload.length; i < l; i++) {\n let item = payload[i];\n let {\n data,\n included\n } = this.normalize(primaryModelClass, item);\n if (included) {\n documentHash.included = documentHash.included.concat(included);\n }\n ret[i] = data;\n }\n documentHash.data = ret;\n }\n return documentHash;\n },\n /**\n Normalizes a part of the JSON payload returned by\n the server. You should override this method, munge the hash\n and call super if you have generic normalization to do.\n It takes the type of the record that is being normalized\n (as a Model class), the property where the hash was\n originally found, and the hash to normalize.\n You can use this method, for example, to normalize underscored keys to camelized\n or other general-purpose normalizations.\n Example\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { underscore } from '@ember/string';\n import { get } from '@ember/object';\n export default class ApplicationSerializer extends JSONSerializer {\n normalize(typeClass, hash) {\n let fields = get(typeClass, 'fields');\n fields.forEach(function(type, field) {\n let payloadField = underscore(field);\n if (field === payloadField) { return; }\n hash[field] = hash[payloadField];\n delete hash[payloadField];\n });\n return super.normalize(...arguments);\n }\n }\n ```\n @method normalize\n @public\n @param {Model} typeClass\n @param {Object} hash\n @return {Object}\n */\n normalize(modelClass, resourceHash) {\n let data = null;\n if (resourceHash) {\n this.normalizeUsingDeclaredMapping(modelClass, resourceHash);\n if (typeOf(resourceHash.links) === 'object') {\n this.normalizeUsingDeclaredMapping(modelClass, resourceHash.links);\n }\n data = {\n id: this.extractId(modelClass, resourceHash),\n type: modelClass.modelName,\n attributes: this.extractAttributes(modelClass, resourceHash),\n relationships: this.extractRelationships(modelClass, resourceHash)\n };\n this.applyTransforms(modelClass, data.attributes);\n }\n return {\n data\n };\n },\n /**\n Returns the resource's ID.\n @method extractId\n @public\n @param {Object} modelClass\n @param {Object} resourceHash\n @return {String}\n */\n extractId(modelClass, resourceHash) {\n let primaryKey = get(this, 'primaryKey');\n let id = resourceHash[primaryKey];\n return coerceId(id);\n },\n /**\n Returns the resource's attributes formatted as a JSON-API \"attributes object\".\n http://jsonapi.org/format/#document-resource-object-attributes\n @method extractAttributes\n @public\n @param {Object} modelClass\n @param {Object} resourceHash\n @return {Object}\n */\n extractAttributes(modelClass, resourceHash) {\n let attributeKey;\n let attributes = {};\n modelClass.eachAttribute(key => {\n attributeKey = this.keyForAttribute(key, 'deserialize');\n if (resourceHash[attributeKey] !== undefined) {\n attributes[key] = resourceHash[attributeKey];\n }\n });\n return attributes;\n },\n /**\n Returns a relationship formatted as a JSON-API \"relationship object\".\n http://jsonapi.org/format/#document-resource-object-relationships\n @method extractRelationship\n @public\n @param {Object} relationshipModelName\n @param {Object} relationshipHash\n @return {Object}\n */\n extractRelationship(relationshipModelName, relationshipHash) {\n if (isNone(relationshipHash)) {\n return null;\n }\n /*\n When `relationshipHash` is an object it usually means that the relationship\n is polymorphic. It could however also be embedded resources that the\n EmbeddedRecordsMixin has be able to process.\n */\n if (typeOf(relationshipHash) === 'object') {\n if (relationshipHash.id) {\n relationshipHash.id = coerceId(relationshipHash.id);\n }\n let modelClass = this.store.modelFor(relationshipModelName);\n if (relationshipHash.type && !modelHasAttributeOrRelationshipNamedType(modelClass)) {\n relationshipHash.type = this.modelNameFromPayloadKey(relationshipHash.type);\n }\n return relationshipHash;\n }\n return {\n id: coerceId(relationshipHash),\n type: relationshipModelName\n };\n },\n /**\n Returns a polymorphic relationship formatted as a JSON-API \"relationship object\".\n http://jsonapi.org/format/#document-resource-object-relationships\n `relationshipOptions` is a hash which contains more information about the\n polymorphic relationship which should be extracted:\n - `resourceHash` complete hash of the resource the relationship should be\n extracted from\n - `relationshipKey` key under which the value for the relationship is\n extracted from the resourceHash\n - `relationshipMeta` meta information about the relationship\n @method extractPolymorphicRelationship\n @public\n @param {Object} relationshipModelName\n @param {Object} relationshipHash\n @param {Object} relationshipOptions\n @return {Object}\n */\n extractPolymorphicRelationship(relationshipModelName, relationshipHash, relationshipOptions) {\n return this.extractRelationship(relationshipModelName, relationshipHash);\n },\n /**\n Returns the resource's relationships formatted as a JSON-API \"relationships object\".\n http://jsonapi.org/format/#document-resource-object-relationships\n @method extractRelationships\n @public\n @param {Object} modelClass\n @param {Object} resourceHash\n @return {Object}\n */\n extractRelationships(modelClass, resourceHash) {\n let relationships = {};\n modelClass.eachRelationship((key, relationshipMeta) => {\n let relationship = null;\n let relationshipKey = this.keyForRelationship(key, relationshipMeta.kind, 'deserialize');\n if (resourceHash[relationshipKey] !== undefined) {\n let data = null;\n let relationshipHash = resourceHash[relationshipKey];\n if (relationshipMeta.kind === 'belongsTo') {\n if (relationshipMeta.options.polymorphic) {\n // extracting a polymorphic belongsTo may need more information\n // than the type and the hash (which might only be an id) for the\n // relationship, hence we pass the key, resource and\n // relationshipMeta too\n data = this.extractPolymorphicRelationship(relationshipMeta.type, relationshipHash, {\n key,\n resourceHash,\n relationshipMeta\n });\n } else {\n data = this.extractRelationship(relationshipMeta.type, relationshipHash);\n }\n } else if (relationshipMeta.kind === 'hasMany') {\n if (!isNone(relationshipHash)) {\n data = new Array(relationshipHash.length);\n if (relationshipMeta.options.polymorphic) {\n for (let i = 0, l = relationshipHash.length; i < l; i++) {\n let item = relationshipHash[i];\n data[i] = this.extractPolymorphicRelationship(relationshipMeta.type, item, {\n key,\n resourceHash,\n relationshipMeta\n });\n }\n } else {\n for (let i = 0, l = relationshipHash.length; i < l; i++) {\n let item = relationshipHash[i];\n data[i] = this.extractRelationship(relationshipMeta.type, item);\n }\n }\n }\n }\n relationship = {\n data\n };\n }\n let linkKey = this.keyForLink(key, relationshipMeta.kind);\n if (resourceHash.links && resourceHash.links[linkKey] !== undefined) {\n let related = resourceHash.links[linkKey];\n relationship = relationship || {};\n relationship.links = {\n related\n };\n }\n if (relationship) {\n relationships[key] = relationship;\n }\n });\n return relationships;\n },\n /**\n Dasherizes the model name in the payload\n @method modelNameFromPayloadKey\n @public\n @param {String} key\n @return {String} the model's modelName\n */\n modelNameFromPayloadKey(key) {\n return normalizeModelName(key);\n },\n /**\n @method normalizeRelationships\n @private\n */\n normalizeRelationships(typeClass, hash) {\n let payloadKey;\n if (this.keyForRelationship) {\n typeClass.eachRelationship((key, relationship) => {\n payloadKey = this.keyForRelationship(key, relationship.kind, 'deserialize');\n if (key === payloadKey) {\n return;\n }\n if (hash[payloadKey] === undefined) {\n return;\n }\n hash[key] = hash[payloadKey];\n delete hash[payloadKey];\n });\n }\n },\n /**\n @method normalizeUsingDeclaredMapping\n @private\n */\n normalizeUsingDeclaredMapping(modelClass, hash) {\n let attrs = get(this, 'attrs');\n let normalizedKey;\n let payloadKey;\n if (attrs) {\n for (let key in attrs) {\n normalizedKey = payloadKey = this._getMappedKey(key, modelClass);\n if (hash[payloadKey] === undefined) {\n continue;\n }\n if (get(modelClass, 'attributes').has(key)) {\n normalizedKey = this.keyForAttribute(key, 'deserialize');\n }\n if (get(modelClass, 'relationshipsByName').has(key)) {\n normalizedKey = this.keyForRelationship(key, modelClass, 'deserialize');\n }\n if (payloadKey !== normalizedKey) {\n hash[normalizedKey] = hash[payloadKey];\n delete hash[payloadKey];\n }\n }\n }\n },\n /**\n Looks up the property key that was set by the custom `attr` mapping\n passed to the serializer.\n @method _getMappedKey\n @private\n @param {String} key\n @return {String} key\n */\n _getMappedKey(key, modelClass) {\n warn('There is no attribute or relationship with the name `' + key + '` on `' + modelClass.modelName + '`. Check your serializers attrs hash.', get(modelClass, 'attributes').has(key) || get(modelClass, 'relationshipsByName').has(key), {\n id: 'ds.serializer.no-mapped-attrs-key'\n });\n let attrs = get(this, 'attrs');\n let mappedKey;\n if (attrs && attrs[key]) {\n mappedKey = attrs[key];\n //We need to account for both the { title: 'post_title' } and\n //{ title: { key: 'post_title' }} forms\n if (mappedKey.key) {\n mappedKey = mappedKey.key;\n }\n if (typeof mappedKey === 'string') {\n key = mappedKey;\n }\n }\n return key;\n },\n /**\n Check attrs.key.serialize property to inform if the `key`\n can be serialized\n @method _canSerialize\n @private\n @param {String} key\n @return {boolean} true if the key can be serialized\n */\n _canSerialize(key) {\n let attrs = get(this, 'attrs');\n return !attrs || !attrs[key] || attrs[key].serialize !== false;\n },\n /**\n When attrs.key.serialize is set to true then\n it takes priority over the other checks and the related\n attribute/relationship will be serialized\n @method _mustSerialize\n @private\n @param {String} key\n @return {boolean} true if the key must be serialized\n */\n _mustSerialize(key) {\n let attrs = get(this, 'attrs');\n return attrs && attrs[key] && attrs[key].serialize === true;\n },\n /**\n Check if the given hasMany relationship should be serialized\n By default only many-to-many and many-to-none relationships are serialized.\n This could be configured per relationship by Serializer's `attrs` object.\n @method shouldSerializeHasMany\n @public\n @param {Snapshot} snapshot\n @param {String} key\n @param {String} relationshipType\n @return {boolean} true if the hasMany relationship should be serialized\n */\n shouldSerializeHasMany(snapshot, key, relationship) {\n const schema = this.store.modelFor(snapshot.modelName);\n let relationshipType = schema.determineRelationshipType(relationship, this.store);\n if (this._mustSerialize(key)) {\n return true;\n }\n return this._canSerialize(key) && (relationshipType === 'manyToNone' || relationshipType === 'manyToMany');\n },\n // SERIALIZE\n /**\n Called when a record is saved in order to convert the\n record into JSON.\n By default, it creates a JSON object with a key for\n each attribute and belongsTo relationship.\n For example, consider this model:\n ```app/models/comment.js\n import Model, { attr, belongsTo } from '@ember-data/model';\n export default class CommentModel extends Model {\n @attr title;\n @attr body;\n @belongsTo('user') author;\n }\n ```\n The default serialization would create a JSON object like:\n ```javascript\n {\n \"title\": \"Rails is unagi\",\n \"body\": \"Rails? Omakase? O_O\",\n \"author\": 12\n }\n ```\n By default, attributes are passed through as-is, unless\n you specified an attribute type (`attr('date')`). If\n you specify a transform, the JavaScript value will be\n serialized when inserted into the JSON hash.\n By default, belongs-to relationships are converted into\n IDs when inserted into the JSON hash.\n ## IDs\n `serialize` takes an options hash with a single option:\n `includeId`. If this option is `true`, `serialize` will,\n by default include the ID in the JSON object it builds.\n The adapter passes in `includeId: true` when serializing\n a record for `createRecord`, but not for `updateRecord`.\n ## Customization\n Your server may expect a different JSON format than the\n built-in serialization format.\n In that case, you can implement `serialize` yourself and\n return a JSON hash of your choosing.\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n export default class PostSerializer extends JSONSerializer {\n serialize(snapshot, options) {\n let json = {\n POST_TTL: snapshot.attr('title'),\n POST_BDY: snapshot.attr('body'),\n POST_CMS: snapshot.hasMany('comments', { ids: true })\n };\n if (options.includeId) {\n json.POST_ID_ = snapshot.id;\n }\n return json;\n }\n }\n ```\n ## Customizing an App-Wide Serializer\n If you want to define a serializer for your entire\n application, you'll probably want to use `eachAttribute`\n and `eachRelationship` on the record.\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { singularize } from 'ember-inflector';\n export default class ApplicationSerializer extends JSONSerializer {\n serialize(snapshot, options) {\n let json = {};\n snapshot.eachAttribute((name) => {\n json[serverAttributeName(name)] = snapshot.attr(name);\n });\n snapshot.eachRelationship((name, relationship) => {\n if (relationship.kind === 'hasMany') {\n json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n }\n });\n if (options.includeId) {\n json.ID_ = snapshot.id;\n }\n return json;\n }\n }\n function serverAttributeName(attribute) {\n return attribute.underscore().toUpperCase();\n }\n function serverHasManyName(name) {\n return serverAttributeName(singularize(name)) + \"_IDS\";\n }\n ```\n This serializer will generate JSON that looks like this:\n ```javascript\n {\n \"TITLE\": \"Rails is omakase\",\n \"BODY\": \"Yep. Omakase.\",\n \"COMMENT_IDS\": [ \"1\", \"2\", \"3\" ]\n }\n ```\n ## Tweaking the Default JSON\n If you just want to do some small tweaks on the default JSON,\n you can call `super.serialize` first and make the tweaks on\n the returned JSON.\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n export default class PostSerializer extends JSONSerializer {\n serialize(snapshot, options) {\n let json = super.serialize(...arguments);\n json.subject = json.title;\n delete json.title;\n return json;\n }\n }\n ```\n @method serialize\n @public\n @param {Snapshot} snapshot\n @param {Object} options\n @return {Object} json\n */\n serialize(snapshot, options) {\n let json = {};\n if (options && options.includeId) {\n const id = snapshot.id;\n if (id) {\n json[get(this, 'primaryKey')] = id;\n }\n }\n snapshot.eachAttribute((key, attribute) => {\n this.serializeAttribute(snapshot, json, key, attribute);\n });\n snapshot.eachRelationship((key, relationship) => {\n if (relationship.kind === 'belongsTo') {\n this.serializeBelongsTo(snapshot, json, relationship);\n } else if (relationship.kind === 'hasMany') {\n this.serializeHasMany(snapshot, json, relationship);\n }\n });\n return json;\n },\n /**\n You can use this method to customize how a serialized record is added to the complete\n JSON hash to be sent to the server. By default the JSON Serializer does not namespace\n the payload and just sends the raw serialized JSON object.\n If your server expects namespaced keys, you should consider using the RESTSerializer.\n Otherwise you can override this method to customize how the record is added to the hash.\n The hash property should be modified by reference.\n For example, your server may expect underscored root objects.\n ```app/serializers/application.js\n import RESTSerializer from '@ember-data/serializer/rest';\n import { decamelize } from '@ember/string';\n export default class ApplicationSerializer extends RESTSerializer {\n serializeIntoHash(data, type, snapshot, options) {\n let root = decamelize(type.modelName);\n data[root] = this.serialize(snapshot, options);\n }\n }\n ```\n @method serializeIntoHash\n @public\n @param {Object} hash\n @param {Model} typeClass\n @param {Snapshot} snapshot\n @param {Object} options\n */\n serializeIntoHash(hash, typeClass, snapshot, options) {\n Object.assign(hash, this.serialize(snapshot, options));\n },\n /**\n `serializeAttribute` can be used to customize how `attr`\n properties are serialized\n For example if you wanted to ensure all your attributes were always\n serialized as properties on an `attributes` object you could\n write:\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n export default class ApplicationSerializer extends JSONSerializer {\n serializeAttribute(snapshot, json, key, attributes) {\n json.attributes = json.attributes || {};\n super.serializeAttribute(snapshot, json.attributes, key, attributes);\n }\n }\n ```\n @method serializeAttribute\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {String} key\n @param {Object} attribute\n */\n serializeAttribute(snapshot, json, key, attribute) {\n if (this._canSerialize(key)) {\n let type = attribute.type;\n let value = snapshot.attr(key);\n if (type) {\n let transform = this.transformFor(type);\n value = transform.serialize(value, attribute.options);\n }\n\n // if provided, use the mapping provided by `attrs` in\n // the serializer\n let schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(key, schema);\n if (payloadKey === key && this.keyForAttribute) {\n payloadKey = this.keyForAttribute(key, 'serialize');\n }\n json[payloadKey] = value;\n }\n },\n /**\n `serializeBelongsTo` can be used to customize how `belongsTo`\n properties are serialized.\n Example\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { isNone } from '@ember/utils';\n export default class PostSerializer extends JSONSerializer {\n serializeBelongsTo(snapshot, json, relationship) {\n let key = relationship.key;\n let belongsTo = snapshot.belongsTo(key);\n key = this.keyForRelationship ? this.keyForRelationship(key, \"belongsTo\", \"serialize\") : key;\n json[key] = isNone(belongsTo) ? belongsTo : belongsTo.record.toJSON();\n }\n }\n ```\n @method serializeBelongsTo\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {Object} relationship\n */\n serializeBelongsTo(snapshot, json, relationship) {\n let key = relationship.key;\n if (this._canSerialize(key)) {\n let belongsToId = snapshot.belongsTo(key, {\n id: true\n });\n\n // if provided, use the mapping provided by `attrs` in\n // the serializer\n let schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(key, schema);\n if (payloadKey === key && this.keyForRelationship) {\n payloadKey = this.keyForRelationship(key, 'belongsTo', 'serialize');\n }\n\n //Need to check whether the id is there for new&async records\n if (isNone(belongsToId)) {\n json[payloadKey] = null;\n } else {\n json[payloadKey] = belongsToId;\n }\n if (relationship.options.polymorphic) {\n this.serializePolymorphicType(snapshot, json, relationship);\n }\n }\n },\n /**\n `serializeHasMany` can be used to customize how `hasMany`\n properties are serialized.\n Example\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n export default class PostSerializer extends JSONSerializer {\n serializeHasMany(snapshot, json, relationship) {\n let key = relationship.key;\n if (key === 'comments') {\n return;\n } else {\n super.serializeHasMany(...arguments);\n }\n }\n }\n ```\n @method serializeHasMany\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {Object} relationship\n */\n serializeHasMany(snapshot, json, relationship) {\n let key = relationship.key;\n if (this.shouldSerializeHasMany(snapshot, key, relationship)) {\n let hasMany = snapshot.hasMany(key, {\n ids: true\n });\n if (hasMany !== undefined) {\n // if provided, use the mapping provided by `attrs` in\n // the serializer\n let schema = this.store.modelFor(snapshot.modelName);\n let payloadKey = this._getMappedKey(key, schema);\n if (payloadKey === key && this.keyForRelationship) {\n payloadKey = this.keyForRelationship(key, 'hasMany', 'serialize');\n }\n json[payloadKey] = hasMany;\n // TODO support for polymorphic manyToNone and manyToMany relationships\n }\n }\n },\n /**\n You can use this method to customize how polymorphic objects are\n serialized. Objects are considered to be polymorphic if\n `{ polymorphic: true }` is pass as the second argument to the\n `belongsTo` function.\n Example\n ```app/serializers/comment.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { isNone } from '@ember/utils';\n export default class CommentSerializer extends JSONSerializer {\n serializePolymorphicType(snapshot, json, relationship) {\n let key = relationship.key;\n let belongsTo = snapshot.belongsTo(key);\n key = this.keyForAttribute ? this.keyForAttribute(key, 'serialize') : key;\n if (isNone(belongsTo)) {\n json[key + '_type'] = null;\n } else {\n json[key + '_type'] = belongsTo.modelName;\n }\n }\n }\n ```\n @method serializePolymorphicType\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {Object} relationship\n */\n serializePolymorphicType() {},\n /**\n `extractMeta` is used to deserialize any meta information in the\n adapter payload. By default Ember Data expects meta information to\n be located on the `meta` property of the payload object.\n Example\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n export default class PostSerializer extends JSONSerializer {\n extractMeta(store, typeClass, payload) {\n if (payload && payload.hasOwnProperty('_pagination')) {\n let meta = payload._pagination;\n delete payload._pagination;\n return meta;\n }\n }\n }\n ```\n @method extractMeta\n @public\n @param {Store} store\n @param {Model} modelClass\n @param {Object} payload\n */\n extractMeta(store, modelClass, payload) {\n if (payload && payload['meta'] !== undefined) {\n let meta = payload.meta;\n delete payload.meta;\n return meta;\n }\n },\n /**\n `extractErrors` is used to extract model errors when a call\n to `Model#save` fails with an `InvalidError`. By default\n Ember Data expects error information to be located on the `errors`\n property of the payload object.\n This serializer expects this `errors` object to be an Array similar\n to the following, compliant with the https://jsonapi.org/format/#errors specification:\n ```js\n {\n \"errors\": [\n {\n \"detail\": \"This username is already taken!\",\n \"source\": {\n \"pointer\": \"data/attributes/username\"\n }\n }, {\n \"detail\": \"Doesn't look like a valid email.\",\n \"source\": {\n \"pointer\": \"data/attributes/email\"\n }\n }\n ]\n }\n ```\n The key `detail` provides a textual description of the problem.\n Alternatively, the key `title` can be used for the same purpose.\n The nested keys `source.pointer` detail which specific element\n of the request data was invalid.\n Note that JSON-API also allows for object-level errors to be placed\n in an object with pointer `data`, signifying that the problem\n cannot be traced to a specific attribute:\n ```javascript\n {\n \"errors\": [\n {\n \"detail\": \"Some generic non property error message\",\n \"source\": {\n \"pointer\": \"data\"\n }\n }\n ]\n }\n ```\n When turn into a `Errors` object, you can read these errors\n through the property `base`:\n ```handlebars\n {{#each @model.errors.base as |error|}}\n
\n {{error.message}}\n
\n {{/each}}\n ```\n Example of alternative implementation, overriding the default\n behavior to deal with a different format of errors:\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n export default class PostSerializer extends JSONSerializer {\n extractErrors(store, typeClass, payload, id) {\n if (payload && typeof payload === 'object' && payload._problems) {\n payload = payload._problems;\n this.normalizeErrors(typeClass, payload);\n }\n return payload;\n }\n }\n ```\n @method extractErrors\n @public\n @param {Store} store\n @param {Model} typeClass\n @param {Object} payload\n @param {(String|Number)} id\n @return {Object} json The deserialized errors\n */\n extractErrors(store, typeClass, payload, id) {\n if (payload && typeof payload === 'object' && payload.errors) {\n payload = errorsArrayToHash(payload.errors);\n this.normalizeUsingDeclaredMapping(typeClass, payload);\n typeClass.eachAttribute(name => {\n let key = this.keyForAttribute(name, 'deserialize');\n if (key !== name && payload[key] !== undefined) {\n payload[name] = payload[key];\n delete payload[key];\n }\n });\n typeClass.eachRelationship(name => {\n let key = this.keyForRelationship(name, 'deserialize');\n if (key !== name && payload[key] !== undefined) {\n payload[name] = payload[key];\n delete payload[key];\n }\n });\n }\n return payload;\n },\n /**\n `keyForAttribute` can be used to define rules for how to convert an\n attribute name in your model to a key in your JSON.\n Example\n ```app/serializers/application.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { underscore } from '@ember/string';\n export default class ApplicationSerializer extends JSONSerializer {\n keyForAttribute(attr, method) {\n return underscore(attr).toUpperCase();\n }\n }\n ```\n @method keyForAttribute\n @public\n @param {String} key\n @param {String} method\n @return {String} normalized key\n */\n keyForAttribute(key, method) {\n return key;\n },\n /**\n `keyForRelationship` can be used to define a custom key when\n serializing and deserializing relationship properties. By default\n `JSONSerializer` does not provide an implementation of this method.\n Example\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { underscore } from '@ember/string';\n export default class PostSerializer extends JSONSerializer {\n keyForRelationship(key, relationship, method) {\n return `rel_${underscore(key)}`;\n }\n }\n ```\n @method keyForRelationship\n @public\n @param {String} key\n @param {String} typeClass\n @param {String} method\n @return {String} normalized key\n */\n keyForRelationship(key, typeClass, method) {\n return key;\n },\n /**\n `keyForLink` can be used to define a custom key when deserializing link\n properties.\n @method keyForLink\n @public\n @param {String} key\n @param {String} kind `belongsTo` or `hasMany`\n @return {String} normalized key\n */\n keyForLink(key, kind) {\n return key;\n },\n // HELPERS\n\n /**\n @method transformFor\n @private\n @param {String} attributeType\n @param {Boolean} skipAssertion\n @return {Transform} transform\n */\n transformFor(attributeType, skipAssertion) {\n let transform = getOwner(this).lookup('transform:' + attributeType);\n assert(`Unable to find the transform for \\`attr('${attributeType}')\\``, skipAssertion || !!transform);\n return transform;\n }\n});\nexport default JSONSerializer;","/**\n * @module @ember-data/serializer/rest\n */\nimport { makeArray } from '@ember/array';\nimport { assert, warn } from '@ember/debug';\nimport { camelize } from '@ember/string';\nimport { isNone, typeOf } from '@ember/utils';\nimport { DEBUG } from '@glimmer/env';\nimport { singularize } from 'ember-inflector';\nimport JSONSerializer from '@ember-data/serializer/json';\nimport { normalizeModelName } from '@ember-data/store';\nimport { coerceId } from '@ember-data/store/-private';\nimport { modelHasAttributeOrRelationshipNamedType } from './-private';\n\n/**\n Normally, applications will use the `RESTSerializer` by implementing\n the `normalize` method.\n\n This allows you to do whatever kind of munging you need and is\n especially useful if your server is inconsistent and you need to\n do munging differently for many different kinds of responses.\n\n See the `normalize` documentation for more information.\n\n ## Across the Board Normalization\n\n There are also a number of hooks that you might find useful to define\n across-the-board rules for your payload. These rules will be useful\n if your server is consistent, or if you're building an adapter for\n an infrastructure service, like Firebase, and want to encode service\n conventions.\n\n For example, if all of your keys are underscored and all-caps, but\n otherwise consistent with the names you use in your models, you\n can implement across-the-board rules for how to convert an attribute\n name in your model to a key in your JSON.\n\n ```app/serializers/application.js\n import RESTSerializer from '@ember-data/serializer/rest';\n import { underscore } from '@ember/string';\n\n export default class ApplicationSerializer extends RESTSerializer {\n keyForAttribute(attr, method) {\n return underscore(attr).toUpperCase();\n }\n }\n ```\n\n You can also implement `keyForRelationship`, which takes the name\n of the relationship as the first parameter, the kind of\n relationship (`hasMany` or `belongsTo`) as the second parameter, and\n the method (`serialize` or `deserialize`) as the third parameter.\n\n @class RESTSerializer\n @main @ember-data/serializer/rest\n @public\n @extends JSONSerializer\n*/\nconst RESTSerializer = JSONSerializer.extend({\n /**\n `keyForPolymorphicType` can be used to define a custom key when\n serializing and deserializing a polymorphic type. By default, the\n returned key is `${key}Type`.\n Example\n ```app/serializers/post.js\n import RESTSerializer from '@ember-data/serializer/rest';\n export default class ApplicationSerializer extends RESTSerializer {\n keyForPolymorphicType(key, relationship) {\n let relationshipKey = this.keyForRelationship(key);\n return 'type-' + relationshipKey;\n }\n }\n ```\n @method keyForPolymorphicType\n @public\n @param {String} key\n @param {String} typeClass\n @param {String} method\n @return {String} normalized key\n */\n keyForPolymorphicType(key, typeClass, method) {\n let relationshipKey = this.keyForRelationship(key);\n return `${relationshipKey}Type`;\n },\n /**\n Normalizes a part of the JSON payload returned by\n the server. You should override this method, munge the hash\n and call super if you have generic normalization to do.\n It takes the type of the record that is being normalized\n (as a Model class), the property where the hash was\n originally found, and the hash to normalize.\n For example, if you have a payload that looks like this:\n ```js\n {\n \"post\": {\n \"id\": 1,\n \"title\": \"Rails is omakase\",\n \"comments\": [ 1, 2 ]\n },\n \"comments\": [{\n \"id\": 1,\n \"body\": \"FIRST\"\n }, {\n \"id\": 2,\n \"body\": \"Rails is unagi\"\n }]\n }\n ```\n The `normalize` method will be called three times:\n * With `App.Post`, `\"posts\"` and `{ id: 1, title: \"Rails is omakase\", ... }`\n * With `App.Comment`, `\"comments\"` and `{ id: 1, body: \"FIRST\" }`\n * With `App.Comment`, `\"comments\"` and `{ id: 2, body: \"Rails is unagi\" }`\n You can use this method, for example, to normalize underscored keys to camelized\n or other general-purpose normalizations. You will only need to implement\n `normalize` and manipulate the payload as desired.\n For example, if the `IDs` under `\"comments\"` are provided as `_id` instead of\n `id`, you can specify how to normalize just the comments:\n ```app/serializers/post.js\n import RESTSerializer from '@ember-data/serializer/rest';\n export default class ApplicationSerializer extends RESTSerializer {\n normalize(model, hash, prop) {\n if (prop === 'comments') {\n hash.id = hash._id;\n delete hash._id;\n }\n return super.normalize(...arguments);\n }\n }\n ```\n On each call to the `normalize` method, the third parameter (`prop`) is always\n one of the keys that were in the original payload or in the result of another\n normalization as `normalizeResponse`.\n @method normalize\n @public\n @param {Model} modelClass\n @param {Object} resourceHash\n @param {String} prop\n @return {Object}\n */\n\n /**\n Normalizes an array of resource payloads and returns a JSON-API Document\n with primary data and, if any, included data as `{ data, included }`.\n @method _normalizeArray\n @param {Store} store\n @param {String} modelName\n @param {Object} arrayHash\n @param {String} prop\n @return {Object}\n @private\n */\n _normalizeArray(store, modelName, arrayHash, prop) {\n let documentHash = {\n data: [],\n included: []\n };\n let modelClass = store.modelFor(modelName);\n let serializer = store.serializerFor(modelName);\n makeArray(arrayHash).forEach(hash => {\n let {\n data,\n included\n } = this._normalizePolymorphicRecord(store, hash, prop, modelClass, serializer);\n documentHash.data.push(data);\n if (included) {\n documentHash.included = documentHash.included.concat(included);\n }\n });\n return documentHash;\n },\n _normalizePolymorphicRecord(store, hash, prop, primaryModelClass, primarySerializer) {\n let serializer = primarySerializer;\n let modelClass = primaryModelClass;\n let primaryHasTypeAttribute = modelHasAttributeOrRelationshipNamedType(primaryModelClass);\n if (!primaryHasTypeAttribute && hash.type) {\n // Support polymorphic records in async relationships\n let modelName = this.modelNameFromPayloadKey(hash.type);\n if (store.getSchemaDefinitionService().doesTypeExist(modelName)) {\n serializer = store.serializerFor(modelName);\n modelClass = store.modelFor(modelName);\n }\n }\n return serializer.normalize(modelClass, hash, prop);\n },\n /**\n @method _normalizeResponse\n @param {Store} store\n @param {Model} primaryModelClass\n @param {Object} payload\n @param {String|Number} id\n @param {String} requestType\n @param {Boolean} isSingle\n @return {Object} JSON-API Document\n @private\n */\n _normalizeResponse(store, primaryModelClass, payload, id, requestType, isSingle) {\n let documentHash = {\n data: null,\n included: []\n };\n let meta = this.extractMeta(store, primaryModelClass, payload);\n if (meta) {\n assert('The `meta` returned from `extractMeta` has to be an object, not \"' + typeOf(meta) + '\".', typeOf(meta) === 'object');\n documentHash.meta = meta;\n }\n let keys = Object.keys(payload);\n for (var i = 0, length = keys.length; i < length; i++) {\n var prop = keys[i];\n var modelName = prop;\n var forcedSecondary = false;\n\n /*\n If you want to provide sideloaded records of the same type that the\n primary data you can do that by prefixing the key with `_`.\n Example\n ```\n {\n users: [\n { id: 1, title: 'Tom', manager: 3 },\n { id: 2, title: 'Yehuda', manager: 3 }\n ],\n _users: [\n { id: 3, title: 'Tomster' }\n ]\n }\n ```\n This forces `_users` to be added to `included` instead of `data`.\n */\n if (prop.charAt(0) === '_') {\n forcedSecondary = true;\n modelName = prop.substr(1);\n }\n var typeName = this.modelNameFromPayloadKey(modelName);\n if (!store.getSchemaDefinitionService().doesTypeExist(typeName)) {\n warn(this.warnMessageNoModelForKey(modelName, typeName), false, {\n id: 'ds.serializer.model-for-key-missing'\n });\n continue;\n }\n var isPrimary = !forcedSecondary && this.isPrimaryType(store, typeName, primaryModelClass);\n var value = payload[prop];\n if (value === null) {\n continue;\n }\n assert('The adapter returned an array for the primary data of a `queryRecord` response. `queryRecord` should return a single record.', !(requestType === 'queryRecord' && isPrimary && Array.isArray(value)));\n\n /*\n Support primary data as an object instead of an array.\n Example\n ```\n {\n user: { id: 1, title: 'Tom', manager: 3 }\n }\n ```\n */\n if (isPrimary && !Array.isArray(value)) {\n let {\n data,\n included\n } = this._normalizePolymorphicRecord(store, value, prop, primaryModelClass, this);\n documentHash.data = data;\n if (included) {\n documentHash.included = documentHash.included.concat(included);\n }\n continue;\n }\n let {\n data,\n included\n } = this._normalizeArray(store, typeName, value, prop);\n if (included) {\n documentHash.included = documentHash.included.concat(included);\n }\n if (isSingle) {\n data.forEach(resource => {\n /*\n Figures out if this is the primary record or not.\n It's either:\n 1. The record with the same ID as the original request\n 2. If it's a newly created record without an ID, the first record\n in the array\n */\n let isUpdatedRecord = isPrimary && coerceId(resource.id) === id;\n let isFirstCreatedRecord = isPrimary && !id && !documentHash.data;\n if (isFirstCreatedRecord || isUpdatedRecord) {\n documentHash.data = resource;\n } else {\n documentHash.included.push(resource);\n }\n });\n } else {\n if (isPrimary) {\n documentHash.data = data;\n } else {\n if (data) {\n documentHash.included = documentHash.included.concat(data);\n }\n }\n }\n }\n return documentHash;\n },\n isPrimaryType(store, modelName, primaryModelClass) {\n return normalizeModelName(modelName) === primaryModelClass.modelName;\n },\n /**\n This method allows you to push a payload containing top-level\n collections of records organized per type.\n ```js\n {\n \"posts\": [{\n \"id\": \"1\",\n \"title\": \"Rails is omakase\",\n \"author\", \"1\",\n \"comments\": [ \"1\" ]\n }],\n \"comments\": [{\n \"id\": \"1\",\n \"body\": \"FIRST\"\n }],\n \"users\": [{\n \"id\": \"1\",\n \"name\": \"@d2h\"\n }]\n }\n ```\n It will first normalize the payload, so you can use this to push\n in data streaming in from your server structured the same way\n that fetches and saves are structured.\n @method pushPayload\n @public\n @param {Store} store\n @param {Object} payload\n */\n pushPayload(store, payload) {\n let documentHash = {\n data: [],\n included: []\n };\n for (var prop in payload) {\n var modelName = this.modelNameFromPayloadKey(prop);\n if (!store.getSchemaDefinitionService().doesTypeExist(modelName)) {\n warn(this.warnMessageNoModelForKey(prop, modelName), false, {\n id: 'ds.serializer.model-for-key-missing'\n });\n continue;\n }\n var type = store.modelFor(modelName);\n var typeSerializer = store.serializerFor(type.modelName);\n makeArray(payload[prop]).forEach(hash => {\n let {\n data,\n included\n } = typeSerializer.normalize(type, hash, prop);\n documentHash.data.push(data);\n if (included) {\n documentHash.included = documentHash.included.concat(included);\n }\n });\n }\n store.push(documentHash);\n },\n /**\n This method is used to convert each JSON root key in the payload\n into a modelName that it can use to look up the appropriate model for\n that part of the payload.\n For example, your server may send a model name that does not correspond with\n the name of the model in your app. Let's take a look at an example model,\n and an example payload:\n ```app/models/post.js\n import Model from '@ember-data/model';\n export default class Post extends Model {}\n ```\n ```javascript\n {\n \"blog/post\": {\n \"id\": \"1\n }\n }\n ```\n Ember Data is going to normalize the payload's root key for the modelName. As a result,\n it will try to look up the \"blog/post\" model. Since we don't have a model called \"blog/post\"\n (or a file called app/models/blog/post.js in ember-cli), Ember Data will throw an error\n because it cannot find the \"blog/post\" model.\n Since we want to remove this namespace, we can define a serializer for the application that will\n remove \"blog/\" from the payload key whenver it's encountered by Ember Data:\n ```app/serializers/application.js\n import RESTSerializer from '@ember-data/serializer/rest';\n export default class ApplicationSerializer extends RESTSerializer {\n modelNameFromPayloadKey(payloadKey) {\n if (payloadKey === 'blog/post') {\n return super.modelNameFromPayloadKey(payloadKey.replace('blog/', ''));\n } else {\n return super.modelNameFromPayloadKey(payloadKey);\n }\n }\n }\n ```\n After refreshing, Ember Data will appropriately look up the \"post\" model.\n By default the modelName for a model is its\n name in dasherized form. This means that a payload key like \"blogPost\" would be\n normalized to \"blog-post\" when Ember Data looks up the model. Usually, Ember Data\n can use the correct inflection to do this for you. Most of the time, you won't\n need to override `modelNameFromPayloadKey` for this purpose.\n @method modelNameFromPayloadKey\n @public\n @param {String} key\n @return {String} the model's modelName\n */\n modelNameFromPayloadKey(key) {\n return singularize(normalizeModelName(key));\n },\n // SERIALIZE\n\n /**\n Called when a record is saved in order to convert the\n record into JSON.\n By default, it creates a JSON object with a key for\n each attribute and belongsTo relationship.\n For example, consider this model:\n ```app/models/comment.js\n import Model, { attr, belongsTo } from '@ember-data/model';\n export default class Comment extends Model {\n @attr title\n @attr body\n @belongsTo('user') author\n }\n ```\n The default serialization would create a JSON object like:\n ```js\n {\n \"title\": \"Rails is unagi\",\n \"body\": \"Rails? Omakase? O_O\",\n \"author\": 12\n }\n ```\n By default, attributes are passed through as-is, unless\n you specified an attribute type (`attr('date')`). If\n you specify a transform, the JavaScript value will be\n serialized when inserted into the JSON hash.\n By default, belongs-to relationships are converted into\n IDs when inserted into the JSON hash.\n ## IDs\n `serialize` takes an options hash with a single option:\n `includeId`. If this option is `true`, `serialize` will,\n by default include the ID in the JSON object it builds.\n The adapter passes in `includeId: true` when serializing\n a record for `createRecord`, but not for `updateRecord`.\n ## Customization\n Your server may expect a different JSON format than the\n built-in serialization format.\n In that case, you can implement `serialize` yourself and\n return a JSON hash of your choosing.\n ```app/serializers/post.js\n import RESTSerializer from '@ember-data/serializer/rest';\n export default class ApplicationSerializer extends RESTSerializer {\n serialize(snapshot, options) {\n let json = {\n POST_TTL: snapshot.attr('title'),\n POST_BDY: snapshot.attr('body'),\n POST_CMS: snapshot.hasMany('comments', { ids: true })\n };\n if (options.includeId) {\n json.POST_ID_ = snapshot.id;\n }\n return json;\n }\n }\n ```\n ## Customizing an App-Wide Serializer\n If you want to define a serializer for your entire\n application, you'll probably want to use `eachAttribute`\n and `eachRelationship` on the record.\n ```app/serializers/application.js\n import RESTSerializer from '@ember-data/serializer/rest';\n import { pluralize } from 'ember-inflector';\n export default class ApplicationSerializer extends RESTSerializer {\n serialize(snapshot, options) {\n let json = {};\n snapshot.eachAttribute(function(name) {\n json[serverAttributeName(name)] = snapshot.attr(name);\n });\n snapshot.eachRelationship(function(name, relationship) {\n if (relationship.kind === 'hasMany') {\n json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n }\n });\n if (options.includeId) {\n json.ID_ = snapshot.id;\n }\n return json;\n }\n }\n function serverAttributeName(attribute) {\n return attribute.underscore().toUpperCase();\n }\n function serverHasManyName(name) {\n return serverAttributeName(singularize(name)) + \"_IDS\";\n }\n ```\n This serializer will generate JSON that looks like this:\n ```js\n {\n \"TITLE\": \"Rails is omakase\",\n \"BODY\": \"Yep. Omakase.\",\n \"COMMENT_IDS\": [ 1, 2, 3 ]\n }\n ```\n ## Tweaking the Default JSON\n If you just want to do some small tweaks on the default JSON,\n you can call super first and make the tweaks on the returned\n JSON.\n ```app/serializers/post.js\n import RESTSerializer from '@ember-data/serializer/rest';\n export default class ApplicationSerializer extends RESTSerializer {\n serialize(snapshot, options) {\n let json = super.serialize(snapshot, options);\n json.subject = json.title;\n delete json.title;\n return json;\n }\n }\n ```\n @method serialize\n @public\n @param {Snapshot} snapshot\n @param {Object} options\n @return {Object} json\n */\n serialize(snapshot, options) {\n return this._super(...arguments);\n },\n /**\n You can use this method to customize the root keys serialized into the JSON.\n The hash property should be modified by reference (possibly using something like _.extend)\n By default the REST Serializer sends the modelName of a model, which is a camelized\n version of the name.\n For example, your server may expect underscored root objects.\n ```app/serializers/application.js\n import RESTSerializer from '@ember-data/serializer/rest';\n import { decamelize } from '@ember/string';\n export default class ApplicationSerializer extends RESTSerializer {\n serializeIntoHash(data, type, record, options) {\n let root = decamelize(type.modelName);\n data[root] = this.serialize(record, options);\n }\n }\n ```\n @method serializeIntoHash\n @public\n @param {Object} hash\n @param {Model} typeClass\n @param {Snapshot} snapshot\n @param {Object} options\n */\n serializeIntoHash(hash, typeClass, snapshot, options) {\n let normalizedRootKey = this.payloadKeyFromModelName(typeClass.modelName);\n hash[normalizedRootKey] = this.serialize(snapshot, options);\n },\n /**\n You can use `payloadKeyFromModelName` to override the root key for an outgoing\n request. By default, the RESTSerializer returns a camelized version of the\n model's name.\n For a model called TacoParty, its `modelName` would be the string `taco-party`. The RESTSerializer\n will send it to the server with `tacoParty` as the root key in the JSON payload:\n ```js\n {\n \"tacoParty\": {\n \"id\": \"1\",\n \"location\": \"Matthew Beale's House\"\n }\n }\n ```\n For example, your server may expect dasherized root objects:\n ```app/serializers/application.js\n import RESTSerializer from '@ember-data/serializer/rest';\n import { dasherize } from '@ember/string';\n export default class ApplicationSerializer extends RESTSerializer {\n payloadKeyFromModelName(modelName) {\n return dasherize(modelName);\n }\n }\n ```\n Given a `TacoParty` model, calling `save` on it would produce an outgoing\n request like:\n ```js\n {\n \"taco-party\": {\n \"id\": \"1\",\n \"location\": \"Matthew Beale's House\"\n }\n }\n ```\n @method payloadKeyFromModelName\n @public\n @param {String} modelName\n @return {String}\n */\n payloadKeyFromModelName(modelName) {\n return camelize(modelName);\n },\n /**\n You can use this method to customize how polymorphic objects are serialized.\n By default the REST Serializer creates the key by appending `Type` to\n the attribute and value from the model's camelcased model name.\n @method serializePolymorphicType\n @public\n @param {Snapshot} snapshot\n @param {Object} json\n @param {Object} relationship\n */\n serializePolymorphicType(snapshot, json, relationship) {\n let key = relationship.key;\n let typeKey = this.keyForPolymorphicType(key, relationship.type, 'serialize');\n let belongsTo = snapshot.belongsTo(key);\n if (isNone(belongsTo)) {\n json[typeKey] = null;\n } else {\n json[typeKey] = camelize(belongsTo.modelName);\n }\n },\n /**\n You can use this method to customize how a polymorphic relationship should\n be extracted.\n @method extractPolymorphicRelationship\n @public\n @param {Object} relationshipType\n @param {Object} relationshipHash\n @param {Object} relationshipOptions\n @return {Object}\n */\n extractPolymorphicRelationship(relationshipType, relationshipHash, relationshipOptions) {\n let {\n key,\n resourceHash,\n relationshipMeta\n } = relationshipOptions;\n\n // A polymorphic belongsTo relationship can be present in the payload\n // either in the form where the `id` and the `type` are given:\n //\n // {\n // message: { id: 1, type: 'post' }\n // }\n //\n // or by the `id` and a `Type` attribute:\n //\n // {\n // message: 1,\n // messageType: 'post'\n // }\n //\n // The next code checks if the latter case is present and returns the\n // corresponding JSON-API representation. The former case is handled within\n // the base class JSONSerializer.\n let isPolymorphic = relationshipMeta.options.polymorphic;\n let typeProperty = this.keyForPolymorphicType(key, relationshipType, 'deserialize');\n if (isPolymorphic && resourceHash[typeProperty] !== undefined && typeof relationshipHash !== 'object') {\n let type = this.modelNameFromPayloadKey(resourceHash[typeProperty]);\n return {\n id: relationshipHash,\n type: type\n };\n }\n return this._super(...arguments);\n }\n});\nif (DEBUG) {\n RESTSerializer.reopen({\n warnMessageNoModelForKey(prop, typeKey) {\n return 'Encountered \"' + prop + '\" in payload, but no model was found for model name \"' + typeKey + '\" (resolved model name using ' + this.constructor.toString() + '.modelNameFromPayloadKey(\"' + prop + '\"))';\n }\n });\n}\nexport { EmbeddedRecordsMixin } from './-private';\nexport default RESTSerializer;","/**\n @module @ember-data/serializer\n*/\nimport { Transform } from './-private';\nexport default Transform;","/**\n @module @ember-data/store\n*/\n\nimport { registerWaiter } from '@ember/test';\nimport { DEBUG } from '@glimmer/env';\nimport Ember from 'ember';\n\n// TODO: expose Ember._Backburner as `import { _Backburner } from '@ember/runloop'` in ember-rfc176-data + emberjs/ember.js\n/*\n syncRelationships is used by the UI to grab updates from the graph\n and update the ManyArrays.\n\n We may be able to remove this once the new relationship layer is\n complete.\n*/\nconst backburner = new Ember._Backburner(['coalesce', 'sync', 'notify']);\nif (DEBUG) {\n registerWaiter(() => {\n return !backburner.currentInstance && !backburner.hasTimers();\n });\n}\nexport default backburner;","/**\n @module @ember-data/store\n*/\n\n// Used by the store to normalize IDs entering the store. Despite the fact\n// that developers may provide IDs as numbers (e.g., `store.findRecord('person', 1)`),\n// it is important that internally we use strings, since IDs may be serialized\n// and lose type information. For example, Ember's router may put a record's\n// ID into the URL, and if we later try to deserialize that URL and find the\n// corresponding record, we will not know if it is a string or a number.\n\nfunction coerceId(id) {\n if (id === null || id === undefined || id === '') {\n return null;\n }\n if (typeof id === 'string') {\n return id;\n }\n if (typeof id === 'symbol') {\n return id.toString();\n }\n return '' + id;\n}\nexport function ensureStringId(id) {\n let normalized = null;\n if (typeof id === 'string') {\n normalized = id.length > 0 ? id : null;\n } else if (typeof id === 'number' && !isNaN(id)) {\n normalized = '' + id;\n }\n if (normalized === null) {\n throw new Error(`Expected id to be a string or number, received ${String(id)}`);\n }\n return normalized;\n}\nexport default coerceId;","import { deprecate } from '@ember/debug';\nimport { get } from '@ember/object';\nimport { DEBUG } from '@glimmer/env';\nimport { resolve } from 'rsvp';\n/**\n @module @ember-data/store\n*/\n\nexport function _bind(fn, ...args) {\n return function () {\n return fn.apply(undefined, args);\n };\n}\nexport function _guard(promise, test) {\n let guarded = promise.finally(() => {\n if (!test()) {\n guarded._subscribers.length = 0;\n }\n });\n return guarded;\n}\nexport function _objectIsAlive(object) {\n return !(get(object, 'isDestroyed') || get(object, 'isDestroying'));\n}\nexport function guardDestroyedStore(promise, store, label) {\n let token;\n if (DEBUG) {\n token = store._trackAsyncRequestStart(label);\n }\n let wrapperPromise = resolve(promise, label).then(_v => {\n if (!_objectIsAlive(store)) {\n if (true /* DEPRECATE_RSVP_PROMISE */) {\n deprecate(`A Promise did not resolve by the time the store was destroyed. This will error in a future release.`, false, {\n id: 'ember-data:rsvp-unresolved-async',\n until: '5.0',\n for: '@ember-data/store',\n since: {\n available: '4.5',\n enabled: '4.5'\n }\n });\n }\n }\n return promise;\n });\n return _guard(wrapperPromise, () => {\n if (DEBUG) {\n store._trackAsyncRequestEnd(token);\n }\n return _objectIsAlive(store);\n });\n}","/**\n @module @ember-data/adapter/error\n*/\n\nconst SOURCE_POINTER_REGEXP = /^\\/?data\\/(attributes|relationships)\\/(.*)/;\nconst SOURCE_POINTER_PRIMARY_REGEXP = /^\\/?data/;\nconst PRIMARY_ATTRIBUTE_KEY = 'base';\nfunction makeArray(value) {\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n Convert an hash of errors into an array with errors in JSON-API format.\n ```javascript\n import DS from 'ember-data';\n\n const { errorsHashToArray } = DS;\n\n let errors = {\n base: 'Invalid attributes on saving this record',\n name: 'Must be present',\n age: ['Must be present', 'Must be a number']\n };\n let errorsArray = errorsHashToArray(errors);\n // [\n // {\n // title: \"Invalid Document\",\n // detail: \"Invalid attributes on saving this record\",\n // source: { pointer: \"/data\" }\n // },\n // {\n // title: \"Invalid Attribute\",\n // detail: \"Must be present\",\n // source: { pointer: \"/data/attributes/name\" }\n // },\n // {\n // title: \"Invalid Attribute\",\n // detail: \"Must be present\",\n // source: { pointer: \"/data/attributes/age\" }\n // },\n // {\n // title: \"Invalid Attribute\",\n // detail: \"Must be a number\",\n // source: { pointer: \"/data/attributes/age\" }\n // }\n // ]\n ```\n @method errorsHashToArray\n @for @ember-data/adapter/error\n @static\n @public\n @param {Object} errors hash with errors as properties\n @return {Array} array of errors in JSON-API format\n*/\nexport function errorsHashToArray(errors) {\n let out = [];\n if (errors) {\n Object.keys(errors).forEach(key => {\n let messages = makeArray(errors[key]);\n for (let i = 0; i < messages.length; i++) {\n let title = 'Invalid Attribute';\n let pointer = `/data/attributes/${key}`;\n if (key === PRIMARY_ATTRIBUTE_KEY) {\n title = 'Invalid Document';\n pointer = `/data`;\n }\n out.push({\n title: title,\n detail: messages[i],\n source: {\n pointer: pointer\n }\n });\n }\n });\n }\n return out;\n}\n\n/**\n Convert an array of errors in JSON-API format into an object.\n\n ```javascript\n import DS from 'ember-data';\n\n const { errorsArrayToHash } = DS;\n\n let errorsArray = [\n {\n title: 'Invalid Attribute',\n detail: 'Must be present',\n source: { pointer: '/data/attributes/name' }\n },\n {\n title: 'Invalid Attribute',\n detail: 'Must be present',\n source: { pointer: '/data/attributes/age' }\n },\n {\n title: 'Invalid Attribute',\n detail: 'Must be a number',\n source: { pointer: '/data/attributes/age' }\n }\n ];\n\n let errors = errorsArrayToHash(errorsArray);\n // {\n // \"name\": [\"Must be present\"],\n // \"age\": [\"Must be present\", \"must be a number\"]\n // }\n ```\n\n @method errorsArrayToHash\n @static\n @for @ember-data/adapter/error\n @public\n @param {Array} errors array of errors in JSON-API format\n @return {Object}\n*/\nexport function errorsArrayToHash(errors) {\n let out = {};\n if (errors) {\n errors.forEach(error => {\n if (error.source && error.source.pointer) {\n let key = error.source.pointer.match(SOURCE_POINTER_REGEXP);\n if (key) {\n key = key[2];\n } else if (error.source.pointer.search(SOURCE_POINTER_PRIMARY_REGEXP) !== -1) {\n key = PRIMARY_ATTRIBUTE_KEY;\n }\n if (key) {\n out[key] = out[key] || [];\n out[key].push(error.detail || error.title);\n }\n }\n });\n }\n return out;\n}","const Touching = Symbol('touching');\nexport const RequestPromise = Symbol('promise');\nfunction hasRecordIdentifier(op) {\n return 'recordIdentifier' in op;\n}\nexport default class RequestCache {\n constructor() {\n this._pending = Object.create(null);\n this._done = Object.create(null);\n this._subscriptions = Object.create(null);\n }\n enqueue(promise, queryRequest) {\n let query = queryRequest.data[0];\n if (hasRecordIdentifier(query)) {\n let lid = query.recordIdentifier.lid;\n let type = query.op === 'saveRecord' ? 'mutation' : 'query';\n if (!this._pending[lid]) {\n this._pending[lid] = [];\n }\n let request = {\n state: 'pending',\n request: queryRequest,\n type\n };\n request[Touching] = [query.recordIdentifier];\n request[RequestPromise] = promise;\n this._pending[lid].push(request);\n this._triggerSubscriptions(request);\n promise.then(result => {\n this._dequeue(lid, request);\n let finalizedRequest = {\n state: 'fulfilled',\n request: queryRequest,\n type,\n response: {\n data: result\n }\n };\n finalizedRequest[Touching] = request[Touching];\n this._addDone(finalizedRequest);\n this._triggerSubscriptions(finalizedRequest);\n }, error => {\n this._dequeue(lid, request);\n let finalizedRequest = {\n state: 'rejected',\n request: queryRequest,\n type,\n response: {\n data: error && error.error\n }\n };\n finalizedRequest[Touching] = request[Touching];\n this._addDone(finalizedRequest);\n this._triggerSubscriptions(finalizedRequest);\n });\n }\n }\n _triggerSubscriptions(req) {\n req[Touching].forEach(identifier => {\n if (this._subscriptions[identifier.lid]) {\n this._subscriptions[identifier.lid].forEach(callback => callback(req));\n }\n });\n }\n _dequeue(lid, request) {\n this._pending[lid] = this._pending[lid].filter(req => req !== request);\n }\n _addDone(request) {\n request[Touching].forEach(identifier => {\n if (!this._done[identifier.lid]) {\n this._done[identifier.lid] = [];\n }\n // TODO add support for multiple\n let requestDataOp = request.request.data[0].op;\n this._done[identifier.lid] = this._done[identifier.lid].filter(req => {\n // TODO add support for multiple\n let data;\n if (req.request.data instanceof Array) {\n data = req.request.data[0];\n } else {\n data = req.request.data;\n }\n return data.op !== requestDataOp;\n });\n this._done[identifier.lid].push(request);\n });\n }\n subscribeForRecord(identifier, callback) {\n if (!this._subscriptions[identifier.lid]) {\n this._subscriptions[identifier.lid] = [];\n }\n this._subscriptions[identifier.lid].push(callback);\n }\n getPendingRequestsForRecord(identifier) {\n if (this._pending[identifier.lid]) {\n return this._pending[identifier.lid];\n }\n return [];\n }\n getLastRequestForRecord(identifier) {\n let requests = this._done[identifier.lid];\n if (requests) {\n return requests[requests.length - 1];\n }\n return null;\n }\n}","import { assert } from '@ember/debug';\nimport { DEBUG } from '@glimmer/env';\n/**\n This is a helper method that validates a JSON API top-level document\n\n The format of a document is described here:\n http://jsonapi.org/format/#document-top-level\n\n @internal\n*/\nfunction validateDocumentStructure(doc) {\n if (DEBUG) {\n let errors = [];\n if (!doc || typeof doc !== 'object') {\n errors.push('Top level of a JSON API document must be an object');\n } else {\n if (!('data' in doc) && !('errors' in doc) && !('meta' in doc)) {\n errors.push('One or more of the following keys must be present: \"data\", \"errors\", \"meta\".');\n } else {\n if ('data' in doc && 'errors' in doc) {\n errors.push('Top level keys \"errors\" and \"data\" cannot both be present in a JSON API document');\n }\n }\n if ('data' in doc) {\n if (!(doc.data === null || Array.isArray(doc.data) || typeof doc.data === 'object')) {\n errors.push('data must be null, an object, or an array');\n }\n }\n if ('meta' in doc) {\n if (typeof doc.meta !== 'object') {\n errors.push('meta must be an object');\n }\n }\n if ('errors' in doc) {\n if (!Array.isArray(doc.errors)) {\n errors.push('errors must be an array');\n }\n }\n if ('links' in doc) {\n if (typeof doc.links !== 'object') {\n errors.push('links must be an object');\n }\n }\n if ('jsonapi' in doc) {\n if (typeof doc.jsonapi !== 'object') {\n errors.push('jsonapi must be an object');\n }\n }\n if ('included' in doc) {\n if (typeof doc.included !== 'object') {\n errors.push('included must be an array');\n }\n }\n }\n assert(`Response must be normalized to a valid JSON API document:\\n\\t* ${errors.join('\\n\\t* ')}`, errors.length === 0);\n }\n}\nexport function normalizeResponseHelper(serializer, store, modelClass, payload, id, requestType) {\n let normalizedResponse = serializer ? serializer.normalizeResponse(store, modelClass, payload, id, requestType) : payload;\n validateDocumentStructure(normalizedResponse);\n return normalizedResponse;\n}","/**\n @module @ember-data/store\n*/\nimport { assert, deprecate } from '@ember/debug';\nimport { get } from '@ember/object';\nimport { importSync } from '@embroider/macros';\nfunction schemaIsDSModel(schema) {\n return schema.isModel === true;\n}\n\n/**\n Snapshot is not directly instantiable.\n Instances are provided to a consuming application's\n adapters and serializers for certain requests.\n\n @class Snapshot\n @public\n*/\nexport default class Snapshot {\n /**\n * @method constructor\n * @constructor\n * @private\n * @param options\n * @param identifier\n * @param _store\n */\n constructor(options, identifier, _store) {\n this.__attributes = null;\n this._belongsToRelationships = Object.create(null);\n this._belongsToIds = Object.create(null);\n this._hasManyRelationships = Object.create(null);\n this._hasManyIds = Object.create(null);\n this._store = _store;\n let internalModel = this._internalModel = _store._instanceCache._internalModelForResource(identifier);\n this.modelName = identifier.type;\n\n /**\n The unique RecordIdentifier associated with this Snapshot.\n @property identifier\n @public\n @type {StableRecordIdentifier}\n */\n this.identifier = identifier;\n\n /*\n If the we do not yet have a record, then we are\n likely a snapshot being provided to a find request, so we\n populate __attributes lazily. Else, to preserve the \"moment\n in time\" in which a snapshot is created, we greedily grab\n the values.\n */\n if (internalModel.hasRecord) {\n this._attributes;\n }\n\n /**\n The id of the snapshot's underlying record\n Example\n ```javascript\n // store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\n postSnapshot.id; // => '1'\n ```\n @property id\n @type {String}\n @public\n */\n this.id = identifier.id;\n\n /**\n A hash of adapter options\n @property adapterOptions\n @type {Object}\n @public\n */\n this.adapterOptions = options.adapterOptions;\n\n /**\n If `include` was passed to the options hash for the request, the value\n would be available here.\n @property include\n @type {String|Array}\n @public\n */\n this.include = options.include;\n\n /**\n The name of the type of the underlying record for this snapshot, as a string.\n @property modelName\n @type {String}\n @public\n */\n this.modelName = identifier.type;\n if (internalModel.hasRecord) {\n this._changedAttributes = this._store._instanceCache.getRecordData(identifier).changedAttributes();\n }\n }\n\n /**\n The underlying record for this snapshot. Can be used to access methods and\n properties defined on the record.\n Example\n ```javascript\n let json = snapshot.record.toJSON();\n ```\n @property record\n @type {Model}\n @public\n */\n get record() {\n return this._store._instanceCache.getRecord(this.identifier);\n }\n get _attributes() {\n if (this.__attributes !== null) {\n return this.__attributes;\n }\n let record = this.record;\n let attributes = this.__attributes = Object.create(null);\n let attrs = Object.keys(this._store.getSchemaDefinitionService().attributesDefinitionFor(this.identifier));\n let recordData = this._store._instanceCache.getRecordData(this.identifier);\n attrs.forEach(keyName => {\n if (schemaIsDSModel(this._internalModel.modelClass)) {\n // if the schema is for a DSModel then the instance is too\n attributes[keyName] = get(record, keyName);\n } else {\n attributes[keyName] = recordData.getAttr(keyName);\n }\n });\n return attributes;\n }\n\n /**\n The type of the underlying record for this snapshot, as a Model.\n @property type\n @public\n @deprecated\n @type {Model}\n */\n\n get isNew() {\n return this._internalModel.isNew();\n }\n\n /**\n Returns the value of an attribute.\n Example\n ```javascript\n // store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\n postSnapshot.attr('author'); // => 'Tomster'\n postSnapshot.attr('title'); // => 'Ember.js rocks'\n ```\n Note: Values are loaded eagerly and cached when the snapshot is created.\n @method attr\n @param {String} keyName\n @return {Object} The attribute value or undefined\n @public\n */\n attr(keyName) {\n if (keyName in this._attributes) {\n return this._attributes[keyName];\n }\n assert(`Model '${this.identifier}' has no attribute named '${keyName}' defined.`, false);\n }\n\n /**\n Returns all attributes and their corresponding values.\n Example\n ```javascript\n // store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\n postSnapshot.attributes(); // => { author: 'Tomster', title: 'Ember.js rocks' }\n ```\n @method attributes\n @return {Object} All attributes of the current snapshot\n @public\n */\n attributes() {\n return {\n ...this._attributes\n };\n }\n\n /**\n Returns all changed attributes and their old and new values.\n Example\n ```javascript\n // store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\n postModel.set('title', 'Ember.js rocks!');\n postSnapshot.changedAttributes(); // => { title: ['Ember.js rocks', 'Ember.js rocks!'] }\n ```\n @method changedAttributes\n @return {Object} All changed attributes of the current snapshot\n @public\n */\n changedAttributes() {\n let changedAttributes = Object.create(null);\n if (!this._changedAttributes) {\n return changedAttributes;\n }\n let changedAttributeKeys = Object.keys(this._changedAttributes);\n for (let i = 0, length = changedAttributeKeys.length; i < length; i++) {\n let key = changedAttributeKeys[i];\n changedAttributes[key] = this._changedAttributes[key].slice();\n }\n return changedAttributes;\n }\n\n /**\n Returns the current value of a belongsTo relationship.\n `belongsTo` takes an optional hash of options as a second parameter,\n currently supported options are:\n - `id`: set to `true` if you only want the ID of the related record to be\n returned.\n Example\n ```javascript\n // store.push('post', { id: 1, title: 'Hello World' });\n // store.createRecord('comment', { body: 'Lorem ipsum', post: post });\n commentSnapshot.belongsTo('post'); // => Snapshot\n commentSnapshot.belongsTo('post', { id: true }); // => '1'\n // store.push('comment', { id: 1, body: 'Lorem ipsum' });\n commentSnapshot.belongsTo('post'); // => undefined\n ```\n Calling `belongsTo` will return a new Snapshot as long as there's any known\n data for the relationship available, such as an ID. If the relationship is\n known but unset, `belongsTo` will return `null`. If the contents of the\n relationship is unknown `belongsTo` will return `undefined`.\n Note: Relationships are loaded lazily and cached upon first access.\n @method belongsTo\n @param {String} keyName\n @param {Object} [options]\n @public\n @return {(Snapshot|String|null|undefined)} A snapshot or ID of a known\n relationship or null if the relationship is known but unset. undefined\n will be returned if the contents of the relationship is unknown.\n */\n belongsTo(keyName, options) {\n let returnModeIsId = !!(options && options.id);\n let inverseInternalModel;\n let result;\n let store = this._internalModel.store;\n if (returnModeIsId === true && keyName in this._belongsToIds) {\n return this._belongsToIds[keyName];\n }\n if (returnModeIsId === false && keyName in this._belongsToRelationships) {\n return this._belongsToRelationships[keyName];\n }\n let relationshipMeta = store.getSchemaDefinitionService().relationshipsDefinitionFor({\n type: this.modelName\n })[keyName];\n assert(`Model '${this.identifier}' has no belongsTo relationship named '${keyName}' defined.`, relationshipMeta && relationshipMeta.kind === 'belongsTo');\n\n // TODO @runspired it seems this code branch would not work with CUSTOM_MODEL_CLASSes\n // this check is not a regression in behavior because relationships don't currently\n // function without access to intimate API contracts between RecordData and InternalModel.\n // This is a requirement we should fix as soon as the relationship layer does not require\n // this intimate API usage.\n if (!true /* HAS_RECORD_DATA_PACKAGE */) {\n assert(`snapshot.belongsTo only supported when using the package @ember-data/record-data`);\n }\n const graphFor = importSync('@ember-data/record-data/-private').graphFor;\n const {\n identifier\n } = this;\n const relationship = graphFor(this._store).get(identifier, keyName);\n assert(`You looked up the ${keyName} belongsTo relationship for { type: ${identifier.type}, id: ${identifier.id}, lid: ${identifier.lid} but no such relationship was found.`, relationship);\n assert(`You looked up the ${keyName} belongsTo relationship for { type: ${identifier.type}, id: ${identifier.id}, lid: ${identifier.lid} but that relationship is a hasMany.`, relationship.definition.kind === 'belongsTo');\n let value = relationship.getData();\n let data = value && value.data;\n inverseInternalModel = data ? store._instanceCache._internalModelForResource(data) : null;\n if (value && value.data !== undefined) {\n if (inverseInternalModel && !inverseInternalModel.isDeleted()) {\n if (returnModeIsId) {\n result = inverseInternalModel.id;\n } else {\n result = store._instanceCache.createSnapshot(inverseInternalModel.identifier);\n }\n } else {\n result = null;\n }\n }\n if (returnModeIsId) {\n this._belongsToIds[keyName] = result;\n } else {\n this._belongsToRelationships[keyName] = result;\n }\n return result;\n }\n\n /**\n Returns the current value of a hasMany relationship.\n `hasMany` takes an optional hash of options as a second parameter,\n currently supported options are:\n - `ids`: set to `true` if you only want the IDs of the related records to be\n returned.\n Example\n ```javascript\n // store.push('post', { id: 1, title: 'Hello World', comments: [2, 3] });\n postSnapshot.hasMany('comments'); // => [Snapshot, Snapshot]\n postSnapshot.hasMany('comments', { ids: true }); // => ['2', '3']\n // store.push('post', { id: 1, title: 'Hello World' });\n postSnapshot.hasMany('comments'); // => undefined\n ```\n Note: Relationships are loaded lazily and cached upon first access.\n @method hasMany\n @param {String} keyName\n @param {Object} [options]\n @public\n @return {(Array|undefined)} An array of snapshots or IDs of a known\n relationship or an empty array if the relationship is known but unset.\n undefined will be returned if the contents of the relationship is unknown.\n */\n hasMany(keyName, options) {\n let returnModeIsIds = !!(options && options.ids);\n let results;\n let cachedIds = this._hasManyIds[keyName];\n let cachedSnapshots = this._hasManyRelationships[keyName];\n if (returnModeIsIds === true && keyName in this._hasManyIds) {\n return cachedIds;\n }\n if (returnModeIsIds === false && keyName in this._hasManyRelationships) {\n return cachedSnapshots;\n }\n let store = this._internalModel.store;\n let relationshipMeta = store.getSchemaDefinitionService().relationshipsDefinitionFor({\n type: this.modelName\n })[keyName];\n assert(`Model '${this.identifier}' has no hasMany relationship named '${keyName}' defined.`, relationshipMeta && relationshipMeta.kind === 'hasMany');\n\n // TODO @runspired it seems this code branch would not work with CUSTOM_MODEL_CLASSes\n // this check is not a regression in behavior because relationships don't currently\n // function without access to intimate API contracts between RecordData and InternalModel.\n // This is a requirement we should fix as soon as the relationship layer does not require\n // this intimate API usage.\n if (!true /* HAS_RECORD_DATA_PACKAGE */) {\n assert(`snapshot.hasMany only supported when using the package @ember-data/record-data`);\n }\n const graphFor = importSync('@ember-data/record-data/-private').graphFor;\n const {\n identifier\n } = this;\n const relationship = graphFor(this._store).get(identifier, keyName);\n assert(`You looked up the ${keyName} hasMany relationship for { type: ${identifier.type}, id: ${identifier.id}, lid: ${identifier.lid} but no such relationship was found.`, relationship);\n assert(`You looked up the ${keyName} hasMany relationship for { type: ${identifier.type}, id: ${identifier.id}, lid: ${identifier.lid} but that relationship is a belongsTo.`, relationship.definition.kind === 'hasMany');\n let value = relationship.getData();\n if (value.data) {\n results = [];\n value.data.forEach(member => {\n let internalModel = store._instanceCache._internalModelForResource(member);\n if (!internalModel.isDeleted()) {\n if (returnModeIsIds) {\n results.push(member.id || null);\n } else {\n results.push(store._instanceCache.createSnapshot(internalModel.identifier));\n }\n }\n });\n }\n\n // we assign even if `undefined` so that we don't reprocess the relationship\n // on next access. This works with the `keyName in` checks above.\n if (returnModeIsIds) {\n this._hasManyIds[keyName] = results;\n } else {\n this._hasManyRelationships[keyName] = results;\n }\n return results;\n }\n\n /**\n Iterates through all the attributes of the model, calling the passed\n function on each attribute.\n Example\n ```javascript\n snapshot.eachAttribute(function(name, meta) {\n // ...\n });\n ```\n @method eachAttribute\n @param {Function} callback the callback to execute\n @param {Object} [binding] the value to which the callback's `this` should be bound\n @public\n */\n eachAttribute(callback, binding) {\n let attrDefs = this._store.getSchemaDefinitionService().attributesDefinitionFor(this.identifier);\n Object.keys(attrDefs).forEach(key => {\n callback.call(binding, key, attrDefs[key]);\n });\n }\n\n /**\n Iterates through all the relationships of the model, calling the passed\n function on each relationship.\n Example\n ```javascript\n snapshot.eachRelationship(function(name, relationship) {\n // ...\n });\n ```\n @method eachRelationship\n @param {Function} callback the callback to execute\n @param {Object} [binding] the value to which the callback's `this` should be bound\n @public\n */\n eachRelationship(callback, binding) {\n let relationshipDefs = this._store.getSchemaDefinitionService().relationshipsDefinitionFor(this.identifier);\n Object.keys(relationshipDefs).forEach(key => {\n callback.call(binding, key, relationshipDefs[key]);\n });\n }\n\n /**\n Serializes the snapshot using the serializer for the model.\n Example\n ```app/adapters/application.js\n import Adapter from '@ember-data/adapter';\n export default Adapter.extend({\n createRecord(store, type, snapshot) {\n let data = snapshot.serialize({ includeId: true });\n let url = `/${type.modelName}`;\n return fetch(url, {\n method: 'POST',\n body: data,\n }).then((response) => response.json())\n }\n });\n ```\n @method serialize\n @param {Object} options\n @return {Object} an object whose values are primitive JSON values only\n @public\n */\n serialize(options) {\n const serializer = this._store.serializerFor(this.modelName);\n assert(`Cannot serialize record, no serializer found`, serializer);\n return serializer.serialize(this, options);\n }\n}\nif (true /* DEPRECATE_SNAPSHOT_MODEL_CLASS_ACCESS */) {\n Object.defineProperty(Snapshot.prototype, 'type', {\n get() {\n deprecate(`Using Snapshot.type to access the ModelClass for a record is deprecated. Use store.modelFor() instead.`, false, {\n id: 'ember-data:deprecate-snapshot-model-class-access',\n until: '5.0',\n for: 'ember-data',\n since: {\n available: '4.5.0',\n enabled: '4.5.0'\n }\n });\n return this._internalModel.modelClass;\n }\n });\n}","// provided for additional debuggability\nexport const DEBUG_CLIENT_ORIGINATED = Symbol('record-originated-on-client');\nexport const DEBUG_IDENTIFIER_BUCKET = Symbol('identifier-bucket');","import { DEBUG } from '@glimmer/env';\nimport { DEBUG_IDENTIFIER_BUCKET } from './identifer-debug-consts';\n\n/*\n DEBUG only fields. Keeping this in a separate interface\n which Typescript then merges with the class definition allow us to\n have a DEBUG only property without paying the cost of that field being\n present and initialized (usually to void 0) in production.\n*/\n\n/**\n * @class WeakCache\n * @extends WeakMap\n * @internal\n */\nclass WeakCache extends WeakMap {\n constructor(_fieldName) {\n super();\n if (DEBUG) {\n this._fieldName = _fieldName;\n this._symbol = Symbol.for(_fieldName);\n }\n }\n\n /**\n * Retrieve the value for a key from the WeakCache with the expectation\n * that the key exists. Throws the error generated by _expectMsg in DEBUG if\n * that key does not exist.\n *\n * @method getWithError\n * @param obj\n * @internal\n */\n getWithError(obj) {\n let v = this.get(obj);\n if (DEBUG && v === undefined) {\n throw new Error(this._expectMsg(obj));\n }\n return v;\n }\n\n /**\n * Retrieve the value for a key from the WeakCache, or generate one\n * using the configured _generator method if no value is yet present.\n *\n * @method lookup\n * @param obj\n * @internal\n */\n lookup(obj) {\n let v = super.get(obj);\n if (v === undefined) {\n v = this._generator(obj);\n super.set(obj, v);\n if (DEBUG) {\n if (obj[DEBUG_IDENTIFIER_BUCKET] && this._fieldName !== 'identifier-proxy-target') {\n const target = obj[Symbol.for('identifier-proxy-target')];\n target[this._symbol] = v;\n } else {\n obj[this._symbol] = v;\n }\n }\n }\n return v;\n }\n}\nclass DebugWeakCache extends WeakCache {\n set(obj, value) {\n if (DEBUG && super.has(obj) && this.get(obj) !== value) {\n throw new Error(`${Object.prototype.toString.call(obj)} was already assigned a value for ${this._fieldName}`);\n }\n if (DEBUG) {\n if (obj[DEBUG_IDENTIFIER_BUCKET] && this._fieldName !== 'identifier-proxy-target') {\n const target = obj[Symbol.for('identifier-proxy-target')];\n target[this._symbol] = value;\n // TODO the Proxy check here is entirely for ember-m3\n // as it's attribute access tests fail since the symbol\n // is an unexpected key received by it's proxies.\n // we should address this upstream.\n } else if (obj.constructor?.toString?.() !== 'MegamorphicModel') {\n try {\n obj[this._symbol] = value;\n } catch {\n // some keys are proxies that can't accept symbol values\n // for instance records from ember-m3\n }\n }\n }\n return super.set(obj, value);\n }\n}\nexport default DEBUG ? DebugWeakCache : WeakCache;","/**\n * @module @ember-data/store\n */\nimport { assert, deprecate, warn } from '@ember/debug';\nimport { _backburner as emberBackburner } from '@ember/runloop';\nimport { DEBUG } from '@glimmer/env';\nimport { default as RSVP, resolve } from 'rsvp';\nimport coerceId from './coerce-id';\nimport { _bind, _guard, _objectIsAlive, guardDestroyedStore } from './common';\nimport { errorsArrayToHash } from './errors-utils';\nimport RequestCache from './request-cache';\nimport { normalizeResponseHelper } from './serializer-response';\nimport Snapshot from './snapshot';\nimport WeakCache from './weak-cache';\nfunction payloadIsNotBlank(adapterPayload) {\n if (Array.isArray(adapterPayload)) {\n return true;\n } else {\n return Object.keys(adapterPayload || {}).length !== 0;\n }\n}\nexport const SaveOp = Symbol('SaveOp');\n/**\n * Manages the state of network requests initiated by the store\n *\n * @class FetchManager\n * @private\n */\nexport default class FetchManager {\n // saves which are pending in the runloop\n\n // fetches pending in the runloop, waiting to be coalesced\n\n constructor(_store) {\n this._store = _store;\n // used to keep track of all the find requests that need to be coalesced\n this._pendingFetch = new Map();\n this._pendingSave = [];\n this.requestCache = new RequestCache();\n this.isDestroyed = false;\n }\n\n /**\n This method is called by `record.save`, and gets passed a\n resolver for the promise that `record.save` returns.\n It schedules saving to happen at the end of the run loop.\n @internal\n */\n scheduleSave(identifier, options) {\n let promiseLabel = 'DS: Model#save ' + this;\n let resolver = RSVP.defer(promiseLabel);\n let query = {\n op: 'saveRecord',\n recordIdentifier: identifier,\n options\n };\n let queryRequest = {\n data: [query]\n };\n let snapshot = new Snapshot(options, identifier, this._store);\n let pendingSaveItem = {\n snapshot: snapshot,\n resolver: resolver,\n identifier,\n options,\n queryRequest\n };\n this._pendingSave.push(pendingSaveItem);\n emberBackburner.scheduleOnce('actions', this, this._flushPendingSaves);\n this.requestCache.enqueue(resolver.promise, pendingSaveItem.queryRequest);\n return resolver.promise;\n }\n _flushPendingSave(pending) {\n let {\n snapshot,\n resolver,\n identifier,\n options\n } = pending;\n let adapter = this._store.adapterFor(identifier.type);\n let operation = options[SaveOp];\n let internalModel = snapshot._internalModel;\n let modelName = snapshot.modelName;\n let store = this._store;\n let modelClass = store.modelFor(modelName);\n assert(`You tried to update a record but you have no adapter (for ${modelName})`, adapter);\n assert(`You tried to update a record but your adapter (for ${modelName}) does not implement '${operation}'`, typeof adapter[operation] === 'function');\n let promise = resolve().then(() => adapter[operation](store, modelClass, snapshot));\n let serializer = store.serializerFor(modelName);\n let label = `DS: Extract and notify about ${operation} completion of ${internalModel}`;\n assert(`Your adapter's '${operation}' method must return a value, but it returned 'undefined'`, promise !== undefined);\n promise = _guard(guardDestroyedStore(promise, store, label), _bind(_objectIsAlive, internalModel)).then(adapterPayload => {\n if (!_objectIsAlive(internalModel)) {\n if (true /* DEPRECATE_RSVP_PROMISE */) {\n deprecate(`A Promise while saving ${modelName} did not resolve by the time your model was destroyed. This will error in a future release.`, false, {\n id: 'ember-data:rsvp-unresolved-async',\n until: '5.0',\n for: '@ember-data/store',\n since: {\n available: '4.5',\n enabled: '4.5'\n }\n });\n }\n }\n if (adapterPayload) {\n return normalizeResponseHelper(serializer, store, modelClass, adapterPayload, snapshot.id, operation);\n }\n }, function (error) {\n if (error && error.isAdapterError === true && error.code === 'InvalidError') {\n let parsedErrors = error.errors;\n\n // TODO deprecate extractErrors being called and/or make it part of the public interface\n if (serializer && typeof serializer.extractErrors === 'function') {\n parsedErrors = serializer.extractErrors(store, modelClass, error, snapshot.id);\n } else {\n parsedErrors = errorsArrayToHash(error.errors);\n }\n throw {\n error,\n parsedErrors\n };\n } else {\n throw {\n error\n };\n }\n }, label);\n resolver.resolve(promise);\n }\n\n /**\n This method is called at the end of the run loop, and\n flushes any records passed into `scheduleSave`\n @method flushPendingSave\n @internal\n */\n _flushPendingSaves() {\n let pending = this._pendingSave.slice();\n this._pendingSave = [];\n for (let i = 0, j = pending.length; i < j; i++) {\n let pendingItem = pending[i];\n this._flushPendingSave(pendingItem);\n }\n }\n scheduleFetch(identifier, options) {\n // TODO Probably the store should pass in the query object\n let shouldTrace = DEBUG && this._store.generateStackTracesForTrackedRequests;\n let query = {\n op: 'findRecord',\n recordIdentifier: identifier,\n options\n };\n let queryRequest = {\n data: [query]\n };\n let pendingFetch = this.getPendingFetch(identifier, options);\n if (pendingFetch) {\n return pendingFetch;\n }\n let id = identifier.id;\n let modelName = identifier.type;\n let resolver = RSVP.defer(`Fetching ${modelName}' with id: ${id}`);\n let pendingFetchItem = {\n identifier,\n resolver,\n options,\n queryRequest\n };\n if (DEBUG) {\n if (shouldTrace) {\n let trace;\n try {\n throw new Error(`Trace Origin for scheduled fetch for ${modelName}:${id}.`);\n } catch (e) {\n trace = e;\n }\n\n // enable folks to discover the origin of this findRecord call when\n // debugging. Ideally we would have a tracked queue for requests with\n // labels or local IDs that could be used to merge this trace with\n // the trace made available when we detect an async leak\n pendingFetchItem.trace = trace;\n }\n }\n let resolverPromise = resolver.promise;\n\n // TODO replace with some form of record state cache\n const store = this._store;\n const internalModel = store._instanceCache.getInternalModel(identifier);\n const isLoading = !internalModel.isLoaded; // we don't use isLoading directly because we are the request\n\n const promise = resolverPromise.then(payload => {\n // ensure that regardless of id returned we assign to the correct record\n if (payload.data && !Array.isArray(payload.data)) {\n payload.data.lid = identifier.lid;\n }\n\n // additional data received in the payload\n // may result in the merging of identifiers (and thus records)\n let potentiallyNewIm = store._push(payload);\n if (potentiallyNewIm && !Array.isArray(potentiallyNewIm)) {\n return potentiallyNewIm;\n }\n return identifier;\n }, error => {\n if (internalModel.isEmpty || isLoading) {\n internalModel.unloadRecord();\n }\n throw error;\n });\n if (this._pendingFetch.size === 0) {\n emberBackburner.schedule('actions', this, this.flushAllPendingFetches);\n }\n let fetches = this._pendingFetch;\n if (!fetches.has(modelName)) {\n fetches.set(modelName, []);\n }\n fetches.get(modelName).push(pendingFetchItem);\n pendingFetchItem.promise = promise;\n this.requestCache.enqueue(resolverPromise, pendingFetchItem.queryRequest);\n return promise;\n }\n _fetchRecord(fetchItem) {\n let identifier = fetchItem.identifier;\n let modelName = identifier.type;\n let adapter = this._store.adapterFor(modelName);\n assert(`You tried to find a record but you have no adapter (for ${modelName})`, adapter);\n assert(`You tried to find a record but your adapter (for ${modelName}) does not implement 'findRecord'`, typeof adapter.findRecord === 'function');\n let snapshot = new Snapshot(fetchItem.options, identifier, this._store);\n let klass = this._store.modelFor(identifier.type);\n let id = identifier.id;\n let label = `DS: Handle Adapter#findRecord of '${modelName}' with id: '${id}'`;\n let promise = guardDestroyedStore(resolve().then(() => {\n return adapter.findRecord(this._store, klass, identifier.id, snapshot);\n }), this._store, label).then(adapterPayload => {\n assert(`You made a 'findRecord' request for a '${modelName}' with id '${id}', but the adapter's response did not have any data`, !!payloadIsNotBlank(adapterPayload));\n let serializer = this._store.serializerFor(modelName);\n let payload = normalizeResponseHelper(serializer, this._store, klass, adapterPayload, id, 'findRecord');\n assert(`Ember Data expected the primary data returned from a 'findRecord' response to be an object but instead it found an array.`, !Array.isArray(payload.data));\n assert(`The 'findRecord' request for ${modelName}:${id} resolved indicating success but contained no primary data. To indicate a 404 not found you should either reject the promise returned by the adapter's findRecord method or throw a NotFoundError.`, 'data' in payload && payload.data !== null && typeof payload.data === 'object');\n warn(`You requested a record of type '${modelName}' with id '${id}' but the adapter returned a payload with primary data having an id of '${payload.data.id}'. Use 'store.findRecord()' when the requested id is the same as the one returned by the adapter. In other cases use 'store.queryRecord()' instead.`, coerceId(payload.data.id) === coerceId(id), {\n id: 'ds.store.findRecord.id-mismatch'\n });\n return payload;\n }, error => {\n throw error;\n }, `DS: Extract payload of '${modelName}'`);\n fetchItem.resolver.resolve(promise);\n }\n\n // TODO should probably refactor expectedSnapshots to be identifiers\n handleFoundRecords(seeking, coalescedPayload, expectedSnapshots) {\n // resolve found records\n let found = Object.create(null);\n let payloads = coalescedPayload.data;\n let coalescedIncluded = coalescedPayload.included || [];\n for (let i = 0, l = payloads.length; i < l; i++) {\n let payload = payloads[i];\n let pair = seeking[payload.id];\n found[payload.id] = payload;\n let included = coalescedIncluded.concat(payloads);\n\n // TODO remove original data from included\n if (pair) {\n let resolver = pair.resolver;\n resolver.resolve({\n data: payload,\n included\n });\n }\n }\n\n // reject missing records\n\n // TODO NOW clean this up to refer to payloads\n let missingSnapshots = [];\n for (let i = 0, l = expectedSnapshots.length; i < l; i++) {\n let snapshot = expectedSnapshots[i];\n assertIsString(snapshot.id);\n\n // We know id is a string because you can't fetch\n // without one.\n if (!found[snapshot.id]) {\n missingSnapshots.push(snapshot);\n }\n }\n if (missingSnapshots.length) {\n warn('Ember Data expected to find records with the following ids in the adapter response but they were missing: [ \"' + missingSnapshots.map(r => r.id).join('\", \"') + '\" ]', false, {\n id: 'ds.store.missing-records-from-adapter'\n });\n this.rejectFetchedItems(seeking, missingSnapshots);\n }\n }\n rejectFetchedItems(seeking, snapshots, error) {\n for (let i = 0, l = snapshots.length; i < l; i++) {\n let snapshot = snapshots[i];\n assertIsString(snapshot.id);\n // TODO refactor to identifier.lid to avoid this cast to string\n // we can do this case because you can only fetch an identifier\n // that has an ID\n let pair = seeking[snapshot.id];\n if (pair) {\n pair.resolver.reject(error || new Error(`Expected: '<${snapshot.modelName}:${snapshot.id}>' to be present in the adapter provided payload, but it was not found.`));\n }\n }\n }\n _findMany(adapter, store, modelName, snapshots, identifiers, optionsMap) {\n let modelClass = store.modelFor(modelName); // `adapter.findMany` gets the modelClass still\n let ids = snapshots.map(s => s.id);\n let promise = adapter.findMany(store, modelClass, ids, snapshots);\n let label = `DS: Handle Adapter#findMany of '${modelName}'`;\n if (promise === undefined) {\n throw new Error('adapter.findMany returned undefined, this was very likely a mistake');\n }\n promise = guardDestroyedStore(promise, store, label);\n return promise.then(adapterPayload => {\n assert(`You made a 'findMany' request for '${modelName}' records with ids '[${ids}]', but the adapter's response did not have any data`, !!payloadIsNotBlank(adapterPayload));\n let serializer = store.serializerFor(modelName);\n let payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, null, 'findMany');\n return payload;\n }, null, `DS: Extract payload of ${modelName}`);\n }\n _processCoalescedGroup(seeking, group, adapter, optionsMap, modelName) {\n //TODO check what happened with identifiers here\n let totalInGroup = group.length;\n let ids = new Array(totalInGroup);\n let groupedSnapshots = new Array(totalInGroup);\n for (let j = 0; j < totalInGroup; j++) {\n groupedSnapshots[j] = group[j];\n ids[j] = groupedSnapshots[j].id;\n }\n let store = this._store;\n if (totalInGroup > 1) {\n this._findMany(adapter, store, modelName, group, groupedSnapshots, optionsMap).then(payloads => {\n this.handleFoundRecords(seeking, payloads, groupedSnapshots);\n }).catch(error => {\n this.rejectFetchedItems(seeking, groupedSnapshots, error);\n });\n } else if (ids.length === 1) {\n let pair = seeking[groupedSnapshots[0].id];\n this._fetchRecord(pair);\n } else {\n assert(\"You cannot return an empty array from adapter's method groupRecordsForFindMany\", false);\n }\n }\n _flushPendingFetchForType(pendingFetchItems, modelName) {\n let adapter = this._store.adapterFor(modelName);\n let shouldCoalesce = !!adapter.findMany && adapter.coalesceFindRequests;\n let totalItems = pendingFetchItems.length;\n let identifiers = new Array(totalItems);\n let seeking = Object.create(null);\n let optionsMap = new WeakCache(DEBUG ? 'fetch-options' : '');\n for (let i = 0; i < totalItems; i++) {\n let pendingItem = pendingFetchItems[i];\n let identifier = pendingItem.identifier;\n identifiers[i] = identifier;\n optionsMap.set(identifier, pendingItem.options);\n seeking[identifier.id] = pendingItem;\n }\n if (shouldCoalesce) {\n // TODO: Improve records => snapshots => records => snapshots\n //\n // We want to provide records to all store methods and snapshots to all\n // adapter methods. To make sure we're doing that we're providing an array\n // of snapshots to adapter.groupRecordsForFindMany(), which in turn will\n // return grouped snapshots instead of grouped records.\n //\n // But since the _findMany() finder is a store method we need to get the\n // records from the grouped snapshots even though the _findMany() finder\n // will once again convert the records to snapshots for adapter.findMany()\n let snapshots = new Array(totalItems);\n for (let i = 0; i < totalItems; i++) {\n // we know options is in the map due to having just set it above\n // but TS doesn't know so we cast it\n let options = optionsMap.get(identifiers[i]);\n snapshots[i] = new Snapshot(options, identifiers[i], this._store);\n }\n let groups;\n if (adapter.groupRecordsForFindMany) {\n groups = adapter.groupRecordsForFindMany(this._store, snapshots);\n } else {\n groups = [snapshots];\n }\n for (let i = 0, l = groups.length; i < l; i++) {\n this._processCoalescedGroup(seeking, groups[i], adapter, optionsMap, modelName);\n }\n } else {\n for (let i = 0; i < totalItems; i++) {\n this._fetchRecord(pendingFetchItems[i]);\n }\n }\n }\n getPendingFetch(identifier, options) {\n let pendingFetches = this._pendingFetch.get(identifier.type);\n\n // We already have a pending fetch for this\n if (pendingFetches) {\n let matchingPendingFetch = pendingFetches.find(fetch => fetch.identifier === identifier);\n if (matchingPendingFetch && isSameRequest(options, matchingPendingFetch.options)) {\n return matchingPendingFetch.promise;\n }\n }\n }\n flushAllPendingFetches() {\n if (this.isDestroyed) {\n return;\n }\n this._pendingFetch.forEach(this._flushPendingFetchForType, this);\n this._pendingFetch.clear();\n }\n destroy() {\n this.isDestroyed = true;\n }\n}\nfunction assertIsString(id) {\n if (DEBUG) {\n if (typeof id !== 'string') {\n throw new Error(`Cannot fetch record without an id`);\n }\n }\n}\n\n// this function helps resolve whether we have a pending request that we should use instead\n// TODO @runspired @needsTest removing this did not cause any test failures\nfunction isSameRequest(options = {}, reqOptions = {}) {\n return options.include === reqOptions.include;\n}","import { assert } from '@ember/debug';\nimport { Promise } from 'rsvp';\nimport { guardDestroyedStore } from './common';\nimport { normalizeResponseHelper } from './serializer-response';\n\n/**\n @module @ember-data/store\n*/\n\nfunction payloadIsNotBlank(adapterPayload) {\n if (Array.isArray(adapterPayload)) {\n return true;\n } else {\n return Object.keys(adapterPayload || {}).length;\n }\n}\nexport function _findAll(adapter, store, modelName, options) {\n let modelClass = store.modelFor(modelName); // adapter.findAll depends on the class\n let recordArray = store.peekAll(modelName);\n let snapshotArray = recordArray._createSnapshot(options);\n let promise = Promise.resolve().then(() => adapter.findAll(store, modelClass, null, snapshotArray));\n let label = 'DS: Handle Adapter#findAll of ' + modelClass;\n promise = guardDestroyedStore(promise, store, label);\n return promise.then(adapterPayload => {\n assert(`You made a 'findAll' request for '${modelName}' records, but the adapter's response did not have any data`, payloadIsNotBlank(adapterPayload));\n let serializer = store.serializerFor(modelName);\n let payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, null, 'findAll');\n store._push(payload);\n store.recordArrayManager._didUpdateAll(modelName);\n return recordArray;\n }, null, 'DS: Extract payload of findAll ${modelName}');\n}\nexport function _query(adapter, store, modelName, query, recordArray, options) {\n let modelClass = store.modelFor(modelName); // adapter.query needs the class\n\n recordArray = recordArray || store.recordArrayManager.createAdapterPopulatedRecordArray(modelName, query);\n let promise = Promise.resolve().then(() => adapter.query(store, modelClass, query, recordArray, options));\n let label = `DS: Handle Adapter#query of ${modelName}`;\n promise = guardDestroyedStore(promise, store, label);\n return promise.then(adapterPayload => {\n let serializer = store.serializerFor(modelName);\n let payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, null, 'query');\n let identifiers = store._push(payload);\n assert('The response to store.query is expected to be an array but it was a single record. Please wrap your response in an array or use `store.queryRecord` to query for a single record.', Array.isArray(identifiers));\n if (recordArray) {\n recordArray._setIdentifiers(identifiers, payload);\n } else {\n recordArray = store.recordArrayManager.createAdapterPopulatedRecordArray(modelName, query, identifiers, payload);\n }\n return recordArray;\n }, null, `DS: Extract payload of query ${modelName}`);\n}\nexport function _queryRecord(adapter, store, modelName, query, options) {\n let modelClass = store.modelFor(modelName); // adapter.queryRecord needs the class\n let promise = Promise.resolve().then(() => adapter.queryRecord(store, modelClass, query, options));\n let label = `DS: Handle Adapter#queryRecord of ${modelName}`;\n promise = guardDestroyedStore(promise, store, label);\n return promise.then(adapterPayload => {\n let serializer = store.serializerFor(modelName);\n let payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, null, 'queryRecord');\n assert(`Expected the primary data returned by the serializer for a 'queryRecord' response to be a single object or null but instead it was an array.`, !Array.isArray(payload.data));\n return store._push(payload);\n }, null, `DS: Extract payload of queryRecord ${modelName}`);\n}","import { dasherize } from '@ember/string';\n\n/**\n @module @ember-data/store\n*/\n\n// All modelNames are dasherized internally. Changing this function may\n// require changes to other normalization hooks (such as typeForRoot).\n\n/**\n This method normalizes a modelName into the format Ember Data uses\n internally by dasherizing it.\n\n @method normalizeModelName\n @static\n @public\n @for @ember-data/store\n @param {String} modelName\n @return {String} normalizedModelName\n*/\nexport default function normalizeModelName(modelName) {\n return dasherize(modelName);\n}","export default function isNonEmptyString(str) {\n return typeof str === 'string' && str.length > 0;\n}","/**\n @module @ember-data/store\n*/\nimport { assert, warn } from '@ember/debug';\nimport { DEBUG } from '@glimmer/env';\nimport { getOwnConfig, macroCondition } from '@embroider/macros';\nimport coerceId from './coerce-id';\nimport { DEBUG_CLIENT_ORIGINATED, DEBUG_IDENTIFIER_BUCKET } from './identifer-debug-consts';\nimport normalizeModelName from './normalize-model-name';\nimport isNonEmptyString from './utils/is-non-empty-string';\nimport installPolyfill from './utils/uuid-polyfill';\nimport WeakCache from './weak-cache';\nconst IDENTIFIERS = new WeakSet();\nexport function isStableIdentifier(identifier) {\n return IDENTIFIERS.has(identifier);\n}\nconst isFastBoot = typeof FastBoot !== 'undefined';\nconst _crypto = isFastBoot ? FastBoot.require('crypto') : window.crypto;\nif (macroCondition(getOwnConfig().polyfillUUID)) {\n installPolyfill();\n}\nfunction uuidv4() {\n return _crypto.randomUUID();\n}\nfunction freeze(obj) {\n if (typeof Object.freeze === 'function') {\n return Object.freeze(obj);\n }\n return obj;\n}\nlet configuredForgetMethod;\nlet configuredGenerationMethod;\nlet configuredResetMethod;\nlet configuredUpdateMethod;\nexport function setIdentifierGenerationMethod(method) {\n configuredGenerationMethod = method;\n}\nexport function setIdentifierUpdateMethod(method) {\n configuredUpdateMethod = method;\n}\nexport function setIdentifierForgetMethod(method) {\n configuredForgetMethod = method;\n}\nexport function setIdentifierResetMethod(method) {\n configuredResetMethod = method;\n}\nfunction defaultGenerationMethod(data, bucket) {\n if ('lid' in data && isNonEmptyString(data.lid)) {\n return data.lid;\n }\n if ('id' in data) {\n let {\n type,\n id\n } = data;\n // TODO: add test for id not a string\n if (isNonEmptyString(coerceId(id))) {\n return `@lid:${normalizeModelName(type)}-${id}`;\n }\n }\n return uuidv4();\n}\nfunction defaultEmptyCallback(...args) {}\nlet DEBUG_MAP;\nif (DEBUG) {\n DEBUG_MAP = new WeakCache('identifier-proxy-target');\n}\n\n/**\n * Each instance of {Store} receives a unique instance of a IdentifierCache.\n *\n * This cache is responsible for assigning or retrieving the unique identify\n * for arbitrary resource data encountered by the store. Data representing\n * a unique resource or record should always be represented by the same\n * identifier.\n *\n * It can be configured by consuming applications.\n *\n * @class IdentifierCache\n @public\n */\nexport class IdentifierCache {\n constructor() {\n // Typescript still leaks private properties in the final\n // compiled class, so we may want to move these from _underscore\n // to a WeakMap to avoid leaking\n // currently we leak this for test purposes\n this._cache = {\n lids: Object.create(null),\n types: Object.create(null)\n };\n this._generate = void 0;\n this._update = void 0;\n this._forget = void 0;\n this._reset = void 0;\n this._merge = void 0;\n // we cache the user configuredGenerationMethod at init because it must\n // be configured prior and is not allowed to be changed\n this._generate = configuredGenerationMethod || defaultGenerationMethod;\n this._update = configuredUpdateMethod || defaultEmptyCallback;\n this._forget = configuredForgetMethod || defaultEmptyCallback;\n this._reset = configuredResetMethod || defaultEmptyCallback;\n this._merge = defaultEmptyCallback;\n }\n\n /**\n * Internal hook to allow management of merge conflicts with identifiers.\n *\n * we allow late binding of this private internal merge so that `internalModelFactory`\n * can insert itself here to handle elimination of duplicates\n *\n * @method __configureMerge\n * @private\n */\n __configureMerge(method) {\n this._merge = method || defaultEmptyCallback;\n }\n\n /**\n * @method _getRecordIdentifier\n * @private\n */\n\n _getRecordIdentifier(resource, shouldGenerate = false) {\n // short circuit if we're already the stable version\n if (isStableIdentifier(resource)) {\n if (DEBUG) {\n // TODO should we instead just treat this case as a new generation skipping the short circuit?\n if (!(resource.lid in this._cache.lids) || this._cache.lids[resource.lid] !== resource) {\n throw new Error(`The supplied identifier ${resource} does not belong to this store instance`);\n }\n }\n return resource;\n }\n let lid = coerceId(resource.lid);\n let identifier = lid !== null ? this._cache.lids[lid] : undefined;\n if (identifier !== undefined) {\n return identifier;\n }\n if (shouldGenerate === false) {\n if (!('type' in resource) || !('id' in resource) || !resource.type || !resource.id) {\n return;\n }\n }\n\n // `type` must always be present\n assert('resource.type needs to be a string', 'type' in resource && isNonEmptyString(resource.type));\n let type = resource.type && normalizeModelName(resource.type);\n let id = coerceId(resource.id);\n let keyOptions = getTypeIndex(this._cache.types, type);\n\n // go straight for the stable RecordIdentifier key'd to `lid`\n if (lid !== null) {\n identifier = keyOptions.lid[lid];\n }\n\n // we may have not seen this resource before\n // but just in case we check our own secondary lookup (`id`)\n if (identifier === undefined && id !== null) {\n identifier = keyOptions.id[id];\n }\n if (identifier === undefined) {\n // we have definitely not seen this resource before\n // so we allow the user configured `GenerationMethod` to tell us\n let newLid = this._generate(resource, 'record');\n\n // we do this _even_ when `lid` is present because secondary lookups\n // may need to be populated, but we enforce not giving us something\n // different than expected\n if (lid !== null && newLid !== lid) {\n throw new Error(`You should not change the of a RecordIdentifier`);\n } else if (lid === null) {\n // allow configuration to tell us that we have\n // seen this `lid` before. E.g. a secondary lookup\n // connects this resource to a previously seen\n // resource.\n identifier = keyOptions.lid[newLid];\n }\n if (shouldGenerate === true) {\n if (identifier === undefined) {\n // if we still don't have an identifier, time to generate one\n identifier = makeStableRecordIdentifier(id, type, newLid, 'record', false);\n\n // populate our unique table\n if (DEBUG) {\n // realistically if you hit this it means you changed `type` :/\n // TODO consider how to handle type change assertions more gracefully\n if (identifier.lid in this._cache.lids) {\n throw new Error(`You should not change the of a RecordIdentifier`);\n }\n }\n this._cache.lids[identifier.lid] = identifier;\n\n // populate our primary lookup table\n // TODO consider having the `lid` cache be\n // one level up\n keyOptions.lid[identifier.lid] = identifier;\n // TODO exists temporarily to support `peekAll`\n // but likely to move\n keyOptions._allIdentifiers.push(identifier);\n }\n\n // populate our own secondary lookup table\n // even for the \"successful\" secondary lookup\n // by `_generate()`, since we missed the cache\n // previously\n // we use identifier.id instead of id here\n // because they may not match and we prefer\n // what we've set via resource data\n if (identifier.id !== null) {\n keyOptions.id[identifier.id] = identifier;\n\n // TODO allow filling out of `id` here\n // for the `username` non-client created\n // case.\n }\n }\n }\n return identifier;\n }\n\n /**\n * allows us to peek without generating when needed\n * useful for the \"create\" case when we need to see if\n * we are accidentally overwritting something\n *\n * @method peekRecordIdentifier\n * @param resource\n * @returns {StableRecordIdentifier | undefined}\n * @private\n */\n peekRecordIdentifier(resource) {\n return this._getRecordIdentifier(resource, false);\n }\n\n /**\n Returns the Identifier for the given Resource, creates one if it does not yet exist.\n Specifically this means that we:\n - validate the `id` `type` and `lid` combo against known identifiers\n - return an object with an `lid` that is stable (repeated calls with the same\n `id` + `type` or `lid` will return the same `lid` value)\n - this referential stability of the object itself is guaranteed\n @method getOrCreateRecordIdentifier\n @param resource\n @returns {StableRecordIdentifier}\n @public\n */\n getOrCreateRecordIdentifier(resource) {\n return this._getRecordIdentifier(resource, true);\n }\n\n /**\n Returns a new Identifier for the supplied data. Call this method to generate\n an identifier when a new resource is being created local to the client and\n potentially does not have an `id`.\n Delegates generation to the user supplied `GenerateMethod` if one has been provided\n with the signature `generateMethod({ type }, 'record')`.\n @method createIdentifierForNewRecord\n @param data\n @returns {StableRecordIdentifier}\n @public\n */\n createIdentifierForNewRecord(data) {\n let newLid = this._generate(data, 'record');\n let identifier = makeStableRecordIdentifier(data.id || null, data.type, newLid, 'record', true);\n let keyOptions = getTypeIndex(this._cache.types, data.type);\n\n // populate our unique table\n if (DEBUG) {\n if (identifier.lid in this._cache.lids) {\n throw new Error(`The lid generated for the new record is not unique as it matches an existing identifier`);\n }\n }\n this._cache.lids[identifier.lid] = identifier;\n\n // populate the type+lid cache\n keyOptions.lid[newLid] = identifier;\n // ensure a peekAll sees our new identifier too\n // TODO move this outta here?\n keyOptions._allIdentifiers.push(identifier);\n return identifier;\n }\n\n /**\n Provides the opportunity to update secondary lookup tables for existing identifiers\n Called after an identifier created with `createIdentifierForNewRecord` has been\n committed.\n Assigned `id` to an `Identifier` if `id` has not previously existed; however,\n attempting to change the `id` or calling update without providing an `id` when\n one is missing will throw an error.\n - sets `id` (if `id` was previously `null`)\n - `lid` and `type` MUST NOT be altered post creation\n If a merge occurs, it is possible the returned identifier does not match the originally\n provided identifier. In this case the abandoned identifier will go through the usual\n `forgetRecordIdentifier` codepaths.\n @method updateRecordIdentifier\n @param identifierObject\n @param data\n @returns {StableRecordIdentifier}\n @public\n */\n updateRecordIdentifier(identifierObject, data) {\n let identifier = this.getOrCreateRecordIdentifier(identifierObject);\n let newId = 'id' in data ? coerceId(data.id) : null;\n let existingIdentifier = detectMerge(this._cache.types, identifier, data, newId, this._cache.lids);\n if (!existingIdentifier) {\n // If the incoming type does not match the identifier type, we need to create an identifier for the incoming\n // data so we can merge the incoming data with the existing identifier, see #7325 and #7363\n if ('type' in data && data.type && identifier.type !== normalizeModelName(data.type)) {\n let incomingDataResource = {\n ...data\n };\n // Need to strip the lid from the incomingData in order force a new identifier creation\n delete incomingDataResource.lid;\n existingIdentifier = this.getOrCreateRecordIdentifier(incomingDataResource);\n }\n }\n if (existingIdentifier) {\n let keyOptions = getTypeIndex(this._cache.types, identifier.type);\n identifier = this._mergeRecordIdentifiers(keyOptions, identifier, existingIdentifier, data, newId);\n }\n let id = identifier.id;\n performRecordIdentifierUpdate(identifier, data, this._update);\n newId = identifier.id;\n\n // add to our own secondary lookup table\n if (id !== newId && newId !== null) {\n let keyOptions = getTypeIndex(this._cache.types, identifier.type);\n keyOptions.id[newId] = identifier;\n if (id !== null) {\n delete keyOptions.id[id];\n }\n }\n return identifier;\n }\n\n /**\n * @method _mergeRecordIdentifiers\n * @private\n */\n _mergeRecordIdentifiers(keyOptions, identifier, existingIdentifier, data, newId) {\n // delegate determining which identifier to keep to the configured MergeMethod\n let kept = this._merge(identifier, existingIdentifier, data);\n let abandoned = kept === identifier ? existingIdentifier : identifier;\n\n // cleanup the identifier we no longer need\n this.forgetRecordIdentifier(abandoned);\n\n // ensure a secondary cache entry for this id for the identifier we do keep\n keyOptions.id[newId] = kept;\n // ensure a secondary cache entry for this id for the abandoned identifier's type we do keep\n let baseKeyOptions = getTypeIndex(this._cache.types, existingIdentifier.type);\n baseKeyOptions.id[newId] = kept;\n\n // make sure that the `lid` on the data we are processing matches the lid we kept\n data.lid = kept.lid;\n return kept;\n }\n\n /**\n Provides the opportunity to eliminate an identifier from secondary lookup tables\n as well as eliminates it from ember-data's own lookup tables and book keeping.\n Useful when a record has been deleted and the deletion has been persisted and\n we do not care about the record anymore. Especially useful when an `id` of a\n deleted record might be reused later for a new record.\n @method forgetRecordIdentifier\n @param identifierObject\n @public\n */\n forgetRecordIdentifier(identifierObject) {\n let identifier = this.getOrCreateRecordIdentifier(identifierObject);\n let keyOptions = getTypeIndex(this._cache.types, identifier.type);\n if (identifier.id !== null) {\n delete keyOptions.id[identifier.id];\n }\n delete this._cache.lids[identifier.lid];\n delete keyOptions.lid[identifier.lid];\n let index = keyOptions._allIdentifiers.indexOf(identifier);\n keyOptions._allIdentifiers.splice(index, 1);\n IDENTIFIERS.delete(identifierObject);\n this._forget(identifier, 'record');\n }\n destroy() {\n this._reset();\n }\n}\nfunction getTypeIndex(typeMap, type) {\n let typeIndex = typeMap[type];\n if (typeIndex === undefined) {\n typeIndex = {\n lid: Object.create(null),\n id: Object.create(null),\n _allIdentifiers: []\n };\n typeMap[type] = typeIndex;\n }\n return typeIndex;\n}\nfunction makeStableRecordIdentifier(id, type, lid, bucket, clientOriginated = false) {\n let recordIdentifier = {\n lid,\n id,\n type\n };\n IDENTIFIERS.add(recordIdentifier);\n if (DEBUG) {\n // we enforce immutability in dev\n // but preserve our ability to do controlled updates to the reference\n let wrapper = {\n get lid() {\n return recordIdentifier.lid;\n },\n get id() {\n return recordIdentifier.id;\n },\n get type() {\n return recordIdentifier.type;\n },\n toString() {\n let {\n type,\n id,\n lid\n } = recordIdentifier;\n return `${clientOriginated ? '[CLIENT_ORIGINATED] ' : ''}${type}:${id} (${lid})`;\n }\n };\n wrapper[DEBUG_CLIENT_ORIGINATED] = clientOriginated;\n wrapper[DEBUG_IDENTIFIER_BUCKET] = bucket;\n IDENTIFIERS.add(wrapper);\n DEBUG_MAP.set(wrapper, recordIdentifier);\n wrapper = freeze(wrapper);\n return wrapper;\n }\n return recordIdentifier;\n}\nfunction performRecordIdentifierUpdate(identifier, data, updateFn) {\n if (DEBUG) {\n let {\n lid\n } = data;\n let id = 'id' in data ? data.id : undefined;\n let type = 'type' in data && data.type && normalizeModelName(data.type);\n\n // get the mutable instance behind our proxy wrapper\n let wrapper = identifier;\n identifier = DEBUG_MAP.get(wrapper);\n if (lid !== undefined) {\n let newLid = coerceId(lid);\n if (newLid !== identifier.lid) {\n throw new Error(`The 'lid' for a RecordIdentifier cannot be updated once it has been created. Attempted to set lid for '${wrapper}' to '${lid}'.`);\n }\n }\n if (id !== undefined) {\n let newId = coerceId(id);\n if (identifier.id !== null && identifier.id !== newId) {\n // here we warn and ignore, as this may be a mistake, but we allow the user\n // to have multiple cache-keys pointing at a single lid so we cannot error\n warn(`The 'id' for a RecordIdentifier should not be updated once it has been set. Attempted to set id for '${wrapper}' to '${newId}'.`, false, {\n id: 'ember-data:multiple-ids-for-identifier'\n });\n }\n }\n\n // TODO consider just ignoring here to allow flexible polymorphic support\n if (type && type !== identifier.type) {\n throw new Error(`The 'type' for a RecordIdentifier cannot be updated once it has been set. Attempted to set type for '${wrapper}' to '${type}'.`);\n }\n updateFn(wrapper, data, 'record');\n } else {\n updateFn(identifier, data, 'record');\n }\n\n // upgrade the ID, this is a \"one time only\" ability\n // for the multiple-cache-key scenario we \"could\"\n // use a heuristic to guess the best id for display\n // (usually when `data.id` is available and `data.attributes` is not)\n if ('id' in data && data.id !== undefined) {\n identifier.id = coerceId(data.id);\n }\n}\nfunction detectMerge(typesCache, identifier, data, newId, lids) {\n const {\n id,\n type,\n lid\n } = identifier;\n if (id !== null && id !== newId && newId !== null) {\n let keyOptions = getTypeIndex(typesCache, identifier.type);\n let existingIdentifier = keyOptions.id[newId];\n return existingIdentifier !== undefined ? existingIdentifier : false;\n } else {\n let newType = 'type' in data && data.type && normalizeModelName(data.type);\n\n // If the ids and type are the same but lid is not the same, we should trigger a merge of the identifiers\n if (id !== null && id === newId && newType === type && data.lid && data.lid !== lid) {\n let existingIdentifier = lids[data.lid];\n return existingIdentifier !== undefined ? existingIdentifier : false;\n // If the lids are the same, and ids are the same, but types are different we should trigger a merge of the identifiers\n } else if (id !== null && id === newId && newType && newType !== type && data.lid && data.lid === lid) {\n let keyOptions = getTypeIndex(typesCache, newType);\n let existingIdentifier = keyOptions.id[id];\n return existingIdentifier !== undefined ? existingIdentifier : false;\n }\n }\n return false;\n}","import { assert } from '@ember/debug';\nimport { _backburner as emberBackburner, cancel, run } from '@ember/runloop';\nimport { DEBUG } from '@glimmer/env';\nimport { errorsHashToArray } from '../errors-utils';\nimport { internalModelFactoryFor } from '../internal-model-factory';\n\n/**\n @module @ember-data/store\n*/\n\nfunction isDSModel(record) {\n return true /* HAS_MODEL_PACKAGE */ && !!record && 'constructor' in record && 'isModel' in record.constructor && record.constructor.isModel === true;\n}\nexport default class InternalModel {\n // Not typed yet\n\n constructor(store, identifier) {\n this.store = store;\n this.identifier = identifier;\n this._id = identifier.id;\n this._isUpdatingId = false;\n this.modelName = identifier.type;\n this.clientId = identifier.lid;\n this.hasRecord = false;\n this.hasRecordData = false;\n this._isDestroyed = false;\n this._doNotDestroy = false;\n this.isError = false;\n this._pendingRecordArrayManagerFlush = false; // used by the recordArrayManager\n\n // During dematerialization we don't want to rematerialize the record. The\n // reason this might happen is that dematerialization removes records from\n // record arrays, and Ember arrays will always `objectAt(0)` and\n // `objectAt(len - 1)` to test whether or not `firstObject` or `lastObject`\n // have changed.\n this._isDematerializing = false;\n this._scheduledDestroy = null;\n this.error = null;\n\n // caches for lazy getters\n this._modelClass = null;\n this.__recordArrays = null;\n this.error = null;\n }\n get id() {\n return this.identifier.id;\n }\n set id(value) {\n if (value !== this._id) {\n let newIdentifier = {\n type: this.identifier.type,\n lid: this.identifier.lid,\n id: value\n };\n // TODO potentially this needs to handle merged result\n this.store.identifierCache.updateRecordIdentifier(this.identifier, newIdentifier);\n this.notifyPropertyChange('id');\n }\n }\n get modelClass() {\n if (this.store.modelFor) {\n return this._modelClass || (this._modelClass = this.store.modelFor(this.modelName));\n }\n }\n get _recordData() {\n return this.store._instanceCache.getRecordData(this.identifier);\n }\n isHiddenFromRecordArrays() {\n // During dematerialization we don't want to rematerialize the record.\n // recordWasDeleted can cause other records to rematerialize because it\n // removes the internal model from the array and Ember arrays will always\n // `objectAt(0)` and `objectAt(len -1)` to check whether `firstObject` or\n // `lastObject` have changed. When this happens we don't want those\n // models to rematerialize their records.\n\n // eager checks to avoid instantiating record data if we are empty or loading\n if (this.isEmpty) {\n return true;\n }\n if (this.isLoading) {\n return false;\n }\n let isRecordFullyDeleted = this._isRecordFullyDeleted();\n return this._isDematerializing || this.hasScheduledDestroy() || this.isDestroyed || isRecordFullyDeleted;\n }\n _isRecordFullyDeleted() {\n if (this._recordData.isDeletionCommitted && this._recordData.isDeletionCommitted()) {\n return true;\n } else if (this._recordData.isNew && this._recordData.isDeleted && this._recordData.isNew() && this._recordData.isDeleted()) {\n return true;\n } else {\n return false;\n }\n }\n isDeleted() {\n if (this._recordData.isDeleted) {\n return this._recordData.isDeleted();\n } else {\n return false;\n }\n }\n isNew() {\n if (this.hasRecordData && this._recordData.isNew) {\n return this._recordData.isNew();\n } else {\n return false;\n }\n }\n get isEmpty() {\n return !this.hasRecordData || (!this.isNew() || this.isDeleted()) && this._recordData.isEmpty?.() || false;\n }\n get isLoading() {\n const req = this.store.getRequestStateService();\n const {\n identifier\n } = this;\n // const fulfilled = req.getLastRequestForRecord(identifier);\n\n return !this.isLoaded &&\n // fulfilled === null &&\n req.getPendingRequestsForRecord(identifier).some(req => req.type === 'query');\n }\n get isLoaded() {\n // if we are new we must consider ourselves loaded\n if (this.isNew()) {\n return true;\n }\n // even if we have a past request, if we are now empty we are not loaded\n // typically this is true after an unloadRecord call\n\n // if we are not empty, not new && we have a fulfilled request then we are loaded\n // we should consider allowing for something to be loaded that is simply \"not empty\".\n // which is how RecordState currently handles this case; however, RecordState is buggy\n // in that it does not account for unloading.\n return !this.isEmpty;\n }\n dematerializeRecord() {\n this._isDematerializing = true;\n\n // TODO IGOR add a test that fails when this is missing, something that involves canceling a destroy\n // and the destroy not happening, and then later on trying to destroy\n this._doNotDestroy = false;\n // this has to occur before the internal model is removed\n // for legacy compat.\n const {\n identifier\n } = this;\n this.store._instanceCache.removeRecord(identifier);\n\n // move to an empty never-loaded state\n // ensure any record notifications happen prior to us\n // unseting the record but after we've triggered\n // destroy\n this.store._backburner.join(() => {\n this._recordData.unloadRecord();\n });\n this.hasRecord = false; // this must occur after relationship removal\n this.error = null;\n this.store.recordArrayManager.recordDidChange(this.identifier);\n }\n deleteRecord() {\n run(() => {\n const backburner = this.store._backburner;\n backburner.run(() => {\n if (this._recordData.setIsDeleted) {\n this._recordData.setIsDeleted(true);\n }\n if (this.isNew()) {\n // destroyRecord follows up deleteRecord with save(). This prevents an unecessary save for a new record\n this._deletedRecordWasNew = true;\n this.unloadRecord();\n }\n });\n });\n }\n\n /*\n Unload the record for this internal model. This will cause the record to be\n destroyed and freed up for garbage collection. It will also do a check\n for cleaning up internal models.\n This check is performed by first computing the set of related internal\n models. If all records in this set are unloaded, then the entire set is\n destroyed. Otherwise, nothing in the set is destroyed.\n This means that this internal model will be freed up for garbage collection\n once all models that refer to it via some relationship are also unloaded.\n */\n unloadRecord() {\n if (this.isDestroyed) {\n return;\n }\n if (DEBUG) {\n const requests = this.store.getRequestStateService().getPendingRequestsForRecord(this.identifier);\n if (requests.some(req => {\n return req.type === 'mutation';\n })) {\n assert('You can only unload a record which is not inFlight. `' + this + '`');\n }\n }\n this.dematerializeRecord();\n if (this._scheduledDestroy === null) {\n this._scheduledDestroy = emberBackburner.schedule('destroy', this, '_checkForOrphanedInternalModels');\n }\n }\n hasScheduledDestroy() {\n return !!this._scheduledDestroy;\n }\n cancelDestroy() {\n assert(`You cannot cancel the destruction of an InternalModel once it has already been destroyed`, !this.isDestroyed);\n this._doNotDestroy = true;\n this._isDematerializing = false;\n cancel(this._scheduledDestroy);\n this._scheduledDestroy = null;\n }\n\n // typically, we prefer to async destroy this lets us batch cleanup work.\n // Unfortunately, some scenarios where that is not possible. Such as:\n //\n // ```js\n // const record = store.findRecord(‘record’, 1);\n // record.unloadRecord();\n // store.createRecord(‘record’, 1);\n // ```\n //\n // In those scenarios, we make that model's cleanup work, sync.\n //\n destroySync() {\n if (this._isDematerializing) {\n this.cancelDestroy();\n }\n this._checkForOrphanedInternalModels();\n if (this.isDestroyed || this.isDestroying) {\n return;\n }\n\n // just in-case we are not one of the orphaned, we should still\n // still destroy ourselves\n this.destroy();\n }\n _checkForOrphanedInternalModels() {\n this._isDematerializing = false;\n this._scheduledDestroy = null;\n if (this.isDestroyed) {\n return;\n }\n }\n destroyFromRecordData() {\n if (this._doNotDestroy) {\n this._doNotDestroy = false;\n return;\n }\n this.destroy();\n }\n destroy() {\n let record = this.store._instanceCache.peek({\n identifier: this.identifier,\n bucket: 'record'\n });\n assert('Cannot destroy an internalModel while its record is materialized', !record || record.isDestroyed || record.isDestroying);\n this.isDestroying = true;\n internalModelFactoryFor(this.store).remove(this);\n this._isDestroyed = true;\n }\n setupData(data) {\n if (this.isNew()) {\n this.store._notificationManager.notify(this.identifier, 'identity');\n }\n this._recordData.pushData(data, this.hasRecord);\n }\n notifyAttributes(keys) {\n if (this.hasRecord) {\n let manager = this.store._notificationManager;\n let {\n identifier\n } = this;\n if (!keys || !keys.length) {\n manager.notify(identifier, 'attributes');\n } else {\n for (let i = 0; i < keys.length; i++) {\n manager.notify(identifier, 'attributes', keys[i]);\n }\n }\n }\n }\n get isDestroyed() {\n return this._isDestroyed;\n }\n hasChangedAttributes() {\n if (!this.hasRecordData) {\n // no need to calculate changed attributes when calling `findRecord`\n return false;\n }\n return this._recordData.hasChangedAttributes();\n }\n changedAttributes() {\n if (!this.hasRecordData) {\n // no need to calculate changed attributes when calling `findRecord`\n return {};\n }\n return this._recordData.changedAttributes();\n }\n adapterWillCommit() {\n this._recordData.willCommit();\n let record = this.store._instanceCache.peek({\n identifier: this.identifier,\n bucket: 'record'\n });\n if (record && isDSModel(record)) {\n record.errors.clear();\n }\n }\n notifyHasManyChange(key) {\n if (this.hasRecord) {\n this.store._notificationManager.notify(this.identifier, 'relationships', key);\n }\n }\n notifyBelongsToChange(key) {\n if (this.hasRecord) {\n this.store._notificationManager.notify(this.identifier, 'relationships', key);\n }\n }\n notifyPropertyChange(key) {\n if (this.hasRecord) {\n // TODO this should likely *mostly* be the `attributes` bucket\n // but it seems for local mutations we rely on computed updating\n // iteself when set. As we design our own thing we may need to change\n // that.\n this.store._notificationManager.notify(this.identifier, 'property', key);\n }\n }\n notifyStateChange(key) {\n if (this.hasRecord) {\n this.store._notificationManager.notify(this.identifier, 'state');\n }\n if (!key || key === 'isDeletionCommitted') {\n this.store.recordArrayManager.recordDidChange(this.identifier);\n }\n }\n rollbackAttributes() {\n this.store._backburner.join(() => {\n let dirtyKeys = this._recordData.rollbackAttributes();\n let record = this.store._instanceCache.peek({\n identifier: this.identifier,\n bucket: 'record'\n });\n if (record && isDSModel(record)) {\n record.errors.clear();\n }\n if (this.hasRecord && dirtyKeys && dirtyKeys.length > 0) {\n this.notifyAttributes(dirtyKeys);\n }\n });\n }\n removeFromInverseRelationships() {\n if (this.hasRecordData) {\n this.store._backburner.join(() => {\n this._recordData.removeFromInverseRelationships();\n });\n }\n }\n\n /*\n When a find request is triggered on the store, the user can optionally pass in\n attributes and relationships to be preloaded. These are meant to behave as if they\n came back from the server, except the user obtained them out of band and is informing\n the store of their existence. The most common use case is for supporting client side\n nested URLs, such as `/posts/1/comments/2` so the user can do\n `store.findRecord('comment', 2, { preload: { post: 1 } })` without having to fetch the post.\n Preloaded data can be attributes and relationships passed in either as IDs or as actual\n models.\n */\n preloadData(preload) {\n let jsonPayload = {};\n //TODO(Igor) consider the polymorphic case\n Object.keys(preload).forEach(key => {\n let preloadValue = preload[key];\n let relationshipMeta = this.modelClass.metaForProperty(key);\n if (relationshipMeta.isRelationship) {\n if (!jsonPayload.relationships) {\n jsonPayload.relationships = {};\n }\n jsonPayload.relationships[key] = this._preloadRelationship(key, preloadValue);\n } else {\n if (!jsonPayload.attributes) {\n jsonPayload.attributes = {};\n }\n jsonPayload.attributes[key] = preloadValue;\n }\n });\n this._recordData.pushData(jsonPayload);\n }\n _preloadRelationship(key, preloadValue) {\n let relationshipMeta = this.modelClass.metaForProperty(key);\n let modelClass = relationshipMeta.type;\n let data;\n if (relationshipMeta.kind === 'hasMany') {\n assert('You need to pass in an array to set a hasMany property on a record', Array.isArray(preloadValue));\n data = preloadValue.map(value => this._convertPreloadRelationshipToJSON(value, modelClass));\n } else {\n data = this._convertPreloadRelationshipToJSON(preloadValue, modelClass);\n }\n return {\n data\n };\n }\n _convertPreloadRelationshipToJSON(value, modelClass) {\n if (typeof value === 'string' || typeof value === 'number') {\n return {\n type: modelClass,\n id: value\n };\n }\n let internalModel;\n if (value._internalModel) {\n internalModel = value._internalModel;\n } else {\n internalModel = value;\n }\n // TODO IGOR DAVID assert if no id is present\n return {\n type: internalModel.modelName,\n id: internalModel.id\n };\n }\n\n /*\n * calling `InstanceCache.setRecordId` is necessary to update\n * the cache index for this record if we have changed.\n *\n * However, since the store is not aware of whether the update\n * is from us (via user set) or from a push of new data\n * it will also call us so that we can notify and update state.\n *\n * When it does so it calls with `fromCache` so that we can\n * short-circuit instead of cycling back.\n *\n * This differs from the short-circuit in the `_isUpdatingId`\n * case in that the the cache can originate the call to setId,\n * so on first entry we will still need to do our own update.\n */\n setId(id, fromCache = false) {\n if (this._isUpdatingId === true) {\n return;\n }\n this._isUpdatingId = true;\n let didChange = id !== this._id;\n this._id = id;\n if (didChange && id !== null) {\n if (!fromCache) {\n this.store._instanceCache.setRecordId(this.modelName, id, this.clientId);\n }\n // internal set of ID to get it to RecordData from DS.Model\n // if we are within create we may not have a recordData yet.\n if (this.hasRecordData && this._recordData.__setId) {\n this._recordData.__setId(id);\n }\n }\n if (didChange && this.hasRecord) {\n this.store._notificationManager.notify(this.identifier, 'identity');\n }\n this._isUpdatingId = false;\n }\n didError() {}\n\n /*\n If the adapter did not return a hash in response to a commit,\n merge the changed attributes and relationships into the existing\n saved data.\n */\n adapterDidCommit(data) {\n this._recordData.didCommit(data);\n this.store.recordArrayManager.recordDidChange(this.identifier);\n }\n hasErrors() {\n // TODO add assertion forcing consuming RecordData's to implement getErrors\n if (this._recordData.getErrors) {\n return this._recordData.getErrors(this.identifier).length > 0;\n } else {\n let record = this.store._instanceCache.peek({\n identifier: this.identifier,\n bucket: 'record'\n });\n // we can't have errors if we never tried loading\n if (!record) {\n return false;\n }\n let errors = record.errors;\n return errors.length > 0;\n }\n }\n\n // FOR USE DURING COMMIT PROCESS\n adapterDidInvalidate(parsedErrors, error) {\n // TODO @runspired this should be handled by RecordState\n // and errors should be dirtied but lazily fetch if at\n // all possible. We should only notify errors here.\n let attribute;\n if (error && parsedErrors) {\n // TODO add assertion forcing consuming RecordData's to implement getErrors\n if (!this._recordData.getErrors) {\n let record = this.store._instanceCache.getRecord(this.identifier);\n let errors = record.errors;\n for (attribute in parsedErrors) {\n if (Object.prototype.hasOwnProperty.call(parsedErrors, attribute)) {\n errors.add(attribute, parsedErrors[attribute]);\n }\n }\n }\n let jsonApiErrors = errorsHashToArray(parsedErrors);\n if (jsonApiErrors.length === 0) {\n jsonApiErrors = [{\n title: 'Invalid Error',\n detail: '',\n source: {\n pointer: '/data'\n }\n }];\n }\n this._recordData.commitWasRejected(this.identifier, jsonApiErrors);\n } else {\n this._recordData.commitWasRejected(this.identifier);\n }\n }\n notifyErrorsChange() {\n this.store._notificationManager.notify(this.identifier, 'errors');\n }\n adapterDidError() {\n this._recordData.commitWasRejected();\n }\n toString() {\n return `<${this.modelName}:${this.id}>`;\n }\n}","import { assert } from '@ember/debug';\nimport InternalModel from './model/internal-model';\n\n/**\n @module @ember-data/store\n*/\n\n/**\n `InternalModelMap` is a custom storage map for internalModels of a given modelName\n used by `IdentityMap`.\n\n It was extracted from an implicit pojo based \"internalModel map\" and preserves\n that interface while we work towards a more official API.\n\n @class InternalModelMap\n @internal\n */\nexport default class InternalModelMap {\n constructor(modelName) {\n this._idToModel = Object.create(null);\n this._models = [];\n this.modelName = void 0;\n this.modelName = modelName;\n }\n get(id) {\n return this._idToModel[id] || null;\n }\n has(id) {\n return !!this._idToModel[id];\n }\n get length() {\n return this._models.length;\n }\n get recordIdentifiers() {\n return this._models.map(m => m.identifier);\n }\n set(id, internalModel) {\n assert(`You cannot index an internalModel by an empty id'`, typeof id === 'string' && id.length > 0);\n assert(`You cannot set an index for an internalModel to something other than an internalModel`, internalModel instanceof InternalModel);\n assert(`You cannot set an index for an internalModel that is not in the InternalModelMap`, this.contains(internalModel));\n assert(`You cannot update the id index of an InternalModel once set. Attempted to update ${id}.`, !this.has(id) || this.get(id) === internalModel);\n this._idToModel[id] = internalModel;\n }\n add(internalModel, id) {\n assert(`You cannot re-add an already present InternalModel to the InternalModelMap.`, !this.contains(internalModel));\n if (id) {\n assert(`Duplicate InternalModel for ${this.modelName}:${id} detected.`, !this.has(id) || this.get(id) === internalModel);\n this._idToModel[id] = internalModel;\n }\n this._models.push(internalModel);\n }\n remove(internalModel, id) {\n delete this._idToModel[id];\n let loc = this._models.indexOf(internalModel);\n if (loc !== -1) {\n this._models.splice(loc, 1);\n }\n }\n contains(internalModel) {\n return this._models.indexOf(internalModel) !== -1;\n }\n\n /**\n An array of all models of this modelName\n @property models\n @internal\n @type Array\n */\n get models() {\n return this._models;\n }\n\n /**\n Destroy all models in the map\n @internal\n */\n clear() {\n let internalModels = this._models;\n this._models = [];\n for (let i = 0; i < internalModels.length; i++) {\n let internalModel = internalModels[i];\n internalModel.unloadRecord();\n }\n }\n}","import InternalModelMap from './internal-model-map';\n\n/**\n @module @ember-data/store\n*/\n\n/**\n `IdentityMap` is a custom storage map for records by modelName\n used by `Store`.\n\n @class IdentityMap\n @internal\n */\nexport default class IdentityMap {\n constructor() {\n this._map = Object.create(null);\n }\n /**\n Retrieves the `InternalModelMap` for a given modelName,\n creating one if one did not already exist. This is\n similar to `getWithDefault` or `get` on a `MapWithDefault`\n @method retrieve\n @internal\n @param modelName a previously normalized modelName\n @return {InternalModelMap} the InternalModelMap for the given modelName\n */\n retrieve(modelName) {\n let map = this._map[modelName];\n if (map === undefined) {\n map = this._map[modelName] = new InternalModelMap(modelName);\n }\n return map;\n }\n\n /**\n Clears the contents of all known `RecordMaps`, but does\n not remove the InternalModelMap instances.\n @internal\n */\n clear() {\n let map = this._map;\n let keys = Object.keys(map);\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n map[key].clear();\n }\n }\n}","import { assert } from '@ember/debug';\nimport coerceId from '../coerce-id';\nimport { isStableIdentifier } from '../identifier-cache';\nimport isNonEmptyString from './is-non-empty-string';\nfunction constructResource(type, id, lid) {\n if (typeof type === 'object' && type !== null) {\n let resource = type;\n if (isStableIdentifier(resource)) {\n return resource;\n }\n if ('id' in resource) {\n resource.id = coerceId(resource.id);\n }\n assert('Expected either id or lid to be a valid string', 'id' in resource && isNonEmptyString(resource.id) || isNonEmptyString(resource.lid));\n assert('if id is present, the type must be a string', !('id' in resource) || typeof resource.type === 'string');\n return resource;\n } else {\n const trueId = coerceId(id);\n if (!isNonEmptyString(trueId)) {\n if (isNonEmptyString(lid)) {\n return {\n lid\n };\n }\n throw new Error('Expected either id or lid to be a valid string');\n }\n assert('type must be a string', typeof type === 'string');\n if (isNonEmptyString(lid)) {\n return {\n type,\n id: trueId,\n lid\n };\n }\n return {\n type,\n id: trueId\n };\n }\n}\nexport default constructResource;","import { assert, warn } from '@ember/debug';\nimport { DEBUG } from '@glimmer/env';\nimport IdentityMap from './identity-map';\nimport InternalModel from './model/internal-model';\nimport constructResource from './utils/construct-resource';\nimport WeakCache from './weak-cache';\n\n/**\n @module @ember-data/store\n*/\nconst FactoryCache = new WeakCache(DEBUG ? 'internal-model-factory' : '');\nFactoryCache._generator = store => {\n return new InternalModelFactory(store);\n};\nconst RecordCache = new WeakCache(DEBUG ? 'identifier' : '');\nif (DEBUG) {\n RecordCache._expectMsg = key => `${String(key)} is not a record instantiated by @ember-data/store`;\n}\nexport function peekRecordIdentifier(record) {\n return RecordCache.get(record);\n}\n\n/**\n Retrieves the unique referentially-stable [RecordIdentifier](/ember-data/release/classes/StableRecordIdentifier)\n assigned to the given record instance.\n\n ```js\n import { recordIdentifierFor } from \"@ember-data/store\";\n\n // ... gain access to a record, for instance with peekRecord or findRecord\n const record = store.peekRecord(\"user\", \"1\");\n\n // get the identifier for the record (see docs for StableRecordIdentifier)\n const identifier = recordIdentifierFor(record);\n\n // access the identifier's properties.\n const { id, type, lid } = identifier;\n ```\n\n @method recordIdentifierFor\n @public\n @static\n @for @ember-data/store\n @param {Object} record a record instance previously obstained from the store.\n @returns {StableRecordIdentifier}\n */\nexport function recordIdentifierFor(record) {\n return RecordCache.getWithError(record);\n}\nexport function setRecordIdentifier(record, identifier) {\n if (DEBUG && RecordCache.has(record) && RecordCache.get(record) !== identifier) {\n throw new Error(`${record} was already assigned an identifier`);\n }\n\n /*\n It would be nice to do a reverse check here that an identifier has not\n previously been assigned a record; however, unload + rematerialization\n prevents us from having a great way of doing so when CustomRecordClasses\n don't necessarily give us access to a `isDestroyed` for dematerialized\n instance.\n */\n\n RecordCache.set(record, identifier);\n}\nexport function internalModelFactoryFor(store) {\n return FactoryCache.lookup(store);\n}\n\n/**\n * The InternalModelFactory handles the lifecyle of\n * instantiating, caching, and destroying InternalModel\n * instances.\n *\n * @class InternalModelFactory\n * @internal\n */\nexport default class InternalModelFactory {\n constructor(store) {\n this.store = store;\n this.identifierCache = store.identifierCache;\n this.identifierCache.__configureMerge((identifier, matchedIdentifier, resourceData) => {\n let intendedIdentifier = identifier;\n if (identifier.id !== matchedIdentifier.id) {\n intendedIdentifier = 'id' in resourceData && identifier.id === resourceData.id ? identifier : matchedIdentifier;\n } else if (identifier.type !== matchedIdentifier.type) {\n intendedIdentifier = 'type' in resourceData && identifier.type === resourceData.type ? identifier : matchedIdentifier;\n }\n let altIdentifier = identifier === intendedIdentifier ? matchedIdentifier : identifier;\n\n // check for duplicate InternalModel's\n const map = this.modelMapFor(identifier.type);\n let im = map.get(intendedIdentifier.lid);\n let otherIm = map.get(altIdentifier.lid);\n\n // we cannot merge internalModels when both have records\n // (this may not be strictly true, we could probably swap the internalModel the record points at)\n if (im && otherIm && im.hasRecord && otherIm.hasRecord) {\n // TODO we probably don't need to throw these errors anymore\n // once InternalModel is fully removed, as we can just \"swap\"\n // what data source the abandoned record points at so long as\n // it itself is not retained by the store in any way.\n if ('id' in resourceData) {\n throw new Error(`Failed to update the 'id' for the RecordIdentifier '${identifier.type}:${identifier.id} (${identifier.lid})' to '${resourceData.id}', because that id is already in use by '${matchedIdentifier.type}:${matchedIdentifier.id} (${matchedIdentifier.lid})'`);\n }\n // TODO @runspired determine when this is even possible\n assert(`Failed to update the RecordIdentifier '${identifier.type}:${identifier.id} (${identifier.lid})' to merge with the detected duplicate identifier '${matchedIdentifier.type}:${matchedIdentifier.id} (${matchedIdentifier.lid})'`);\n }\n\n // remove otherIm from cache\n if (otherIm) {\n map.remove(otherIm, altIdentifier.lid);\n }\n if (im === null && otherIm === null) {\n // nothing more to do\n return intendedIdentifier;\n\n // only the other has an InternalModel\n // OR only the other has a Record\n } else if (im === null && otherIm !== null || im && !im.hasRecord && otherIm && otherIm.hasRecord) {\n if (im) {\n // TODO check if we are retained in any async relationships\n map.remove(im, intendedIdentifier.lid);\n // im.destroy();\n }\n im = otherIm;\n // TODO do we need to notify the id change?\n im._id = intendedIdentifier.id;\n im.identifier = intendedIdentifier;\n map.add(im, intendedIdentifier.lid);\n\n // just use im\n } else {\n // otherIm.destroy();\n }\n\n /*\n TODO @runspired consider adding this to make polymorphism even nicer\n if (HAS_RECORD_DATA_PACKAGE) {\n if (identifier.type !== matchedIdentifier.type) {\n const graphFor = importSync('@ember-data/record-data/-private').graphFor;\n graphFor(this).registerPolymorphicType(identifier.type, matchedIdentifier.type);\n }\n }\n */\n\n return intendedIdentifier;\n });\n this._identityMap = new IdentityMap();\n }\n\n /**\n * Retrieve the InternalModel for a given { type, id, lid }.\n *\n * If an InternalModel does not exist, it instantiates one.\n *\n * If an InternalModel does exist bus has a scheduled destroy,\n * the scheduled destroy will be cancelled.\n *\n * @method lookup\n * @private\n */\n lookup(resource, data) {\n if (data !== undefined) {\n // if we've been given data associated with this lookup\n // we must first give secondary-caches for LIDs the\n // opportunity to populate based on it\n this.identifierCache.getOrCreateRecordIdentifier(data);\n }\n const identifier = this.identifierCache.getOrCreateRecordIdentifier(resource);\n const internalModel = this.peek(identifier);\n if (internalModel) {\n // unloadRecord is async, if one attempts to unload + then sync push,\n // we must ensure the unload is canceled before continuing\n // The createRecord path will take _existingInternalModelForId()\n // which will call `destroySync` instead for this unload + then\n // sync createRecord scenario. Once we have true client-side\n // delete signaling, we should never call destroySync\n if (internalModel.hasScheduledDestroy()) {\n internalModel.cancelDestroy();\n }\n return internalModel;\n }\n return this._build(identifier, false);\n }\n\n /**\n * Peek the InternalModel for a given { type, id, lid }.\n *\n * If an InternalModel does not exist, return `null`.\n *\n * @method peek\n * @private\n */\n peek(identifier) {\n return this.modelMapFor(identifier.type).get(identifier.lid);\n }\n getByResource(resource) {\n const normalizedResource = constructResource(resource);\n return this.lookup(normalizedResource);\n }\n setRecordId(type, id, lid) {\n const resource = {\n type,\n id: null,\n lid\n };\n const identifier = this.identifierCache.getOrCreateRecordIdentifier(resource);\n const internalModel = this.peek(identifier);\n if (internalModel === null) {\n throw new Error(`Cannot set the id ${id} on the record ${type}:${lid} as there is no such record in the cache.`);\n }\n let oldId = internalModel.id;\n let modelName = internalModel.modelName;\n\n // ID absolutely can't be missing if the oldID is empty (missing Id in response for a new record)\n assert(`'${modelName}' was saved to the server, but the response does not have an id and your record does not either.`, !(id === null && oldId === null));\n\n // ID absolutely can't be different than oldID if oldID is not null\n // TODO this assertion and restriction may not strictly be needed in the identifiers world\n assert(`Cannot update the id for '${modelName}:${lid}' from '${oldId}' to '${id}'.`, !(oldId !== null && id !== oldId));\n\n // ID can be null if oldID is not null (altered ID in response for a record)\n // however, this is more than likely a developer error.\n if (oldId !== null && id === null) {\n warn(`Your ${modelName} record was saved to the server, but the response does not have an id.`, !(oldId !== null && id === null));\n return;\n }\n let existingInternalModel = this.peekById(modelName, id);\n assert(`'${modelName}' was saved to the server, but the response returned the new id '${id}', which has already been used with another record.'`, !existingInternalModel || existingInternalModel === internalModel);\n if (identifier.id === null) {\n // TODO potentially this needs to handle merged result\n this.identifierCache.updateRecordIdentifier(identifier, {\n type,\n id\n });\n }\n internalModel.setId(id, true);\n }\n peekById(type, id) {\n const identifier = this.identifierCache.peekRecordIdentifier({\n type,\n id\n });\n let internalModel = identifier ? this.modelMapFor(type).get(identifier.lid) : null;\n if (internalModel && internalModel.hasScheduledDestroy()) {\n // unloadRecord is async, if one attempts to unload + then sync create,\n // we must ensure the unload is complete before starting the create\n // The push path will take this.lookup()\n // which will call `cancelDestroy` instead for this unload + then\n // sync push scenario. Once we have true client-side\n // delete signaling, we should never call destroySync\n internalModel.destroySync();\n internalModel = null;\n }\n return internalModel;\n }\n build(newResourceInfo) {\n return this._build(newResourceInfo, true);\n }\n _build(resource, isCreate = false) {\n if (isCreate === true && resource.id) {\n let existingInternalModel = this.peekById(resource.type, resource.id);\n assert(`The id ${resource.id} has already been used with another '${resource.type}' record.`, !existingInternalModel);\n }\n const {\n identifierCache\n } = this;\n let identifier;\n if (isCreate === true) {\n identifier = identifierCache.createIdentifierForNewRecord(resource);\n } else {\n identifier = resource;\n }\n\n // lookupFactory should really return an object that creates\n // instances with the injections applied\n let internalModel = new InternalModel(this.store, identifier);\n this.modelMapFor(resource.type).add(internalModel, identifier.lid);\n return internalModel;\n }\n remove(internalModel) {\n let recordMap = this.modelMapFor(internalModel.modelName);\n let clientId = internalModel.identifier.lid;\n recordMap.remove(internalModel, clientId);\n const {\n identifier\n } = internalModel;\n this.identifierCache.forgetRecordIdentifier(identifier);\n }\n modelMapFor(type) {\n return this._identityMap.retrieve(type);\n }\n clear(type) {\n if (type === undefined) {\n this._identityMap.clear();\n } else {\n this.modelMapFor(type).clear();\n }\n }\n}","import { DEBUG } from '@glimmer/env';\nimport WeakCache from './weak-cache';\nconst Cache = new WeakCache(DEBUG ? 'subscribers' : '');\nCache._generator = () => new Map();\nconst Tokens = new WeakCache(DEBUG ? 'identifier' : '');\n\n// 'property' is an internal EmberData only transition period concept.\n\nexport function unsubscribe(token) {\n let identifier = Tokens.get(token);\n if (!identifier) {\n throw new Error('Passed unknown unsubscribe token to unsubscribe');\n }\n Tokens.delete(token);\n const map = Cache.get(identifier);\n map?.delete(token);\n}\n/*\n Currently only support a single callback per identifier\n*/\nexport default class NotificationManager {\n constructor(store) {\n this.store = store;\n }\n subscribe(identifier, callback) {\n let stableIdentifier = this.store.identifierCache.getOrCreateRecordIdentifier(identifier);\n let map = Cache.lookup(stableIdentifier);\n let unsubToken = {};\n map.set(unsubToken, callback);\n Tokens.set(unsubToken, stableIdentifier);\n return unsubToken;\n }\n unsubscribe(token) {\n unsubscribe(token);\n }\n notify(identifier, value, key) {\n let stableIdentifier = this.store.identifierCache.getOrCreateRecordIdentifier(identifier);\n let callbackMap = Cache.get(stableIdentifier);\n if (!callbackMap || !callbackMap.size) {\n return false;\n }\n callbackMap.forEach(cb => {\n cb(stableIdentifier, value, key);\n });\n return true;\n }\n}","var _class, _descriptor, _token, _identifier;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classPrivateFieldLooseBase(e, t) { if (!{}.hasOwnProperty.call(e, t)) throw new TypeError(\"attempted to use private field on non-instance\"); return e; }\nvar id = 0;\nfunction _classPrivateFieldLooseKey(e) { return \"__private_\" + id++ + \"_\" + e; }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport { assert } from '@ember/debug';\nimport { tracked } from '@glimmer/tracking';\n\n/**\n @module @ember-data/store\n*/\nimport { resolve } from 'rsvp';\nimport { unsubscribe } from '../record-notification-manager';\n\n/**\n @module @ember-data/store\n*/\n\n/**\n A `RecordReference` is a low-level API that allows users and\n addon authors to perform meta-operations on a record.\n\n @class RecordReference\n @public\n @extends Reference\n*/\nlet RecordReference = (_class = (_token = /*#__PURE__*/_classPrivateFieldLooseKey(\"token\"), _identifier = /*#__PURE__*/_classPrivateFieldLooseKey(\"identifier\"), class RecordReference {\n constructor(store, identifier) {\n // unsubscribe token given to us by the notification manager\n Object.defineProperty(this, _token, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _identifier, {\n writable: true,\n value: void 0\n });\n _initializerDefineProperty(this, \"_ref\", _descriptor, this);\n this.store = store;\n _classPrivateFieldLooseBase(this, _identifier)[_identifier] = identifier;\n _classPrivateFieldLooseBase(this, _token)[_token] = store._notificationManager.subscribe(identifier, (_, bucket, notifiedKey) => {\n if (bucket === 'identity' || (bucket === 'attributes' || bucket === 'property') && notifiedKey === 'id') {\n this._ref++;\n }\n });\n }\n destroy() {\n unsubscribe(_classPrivateFieldLooseBase(this, _token)[_token]);\n }\n get type() {\n return this.identifier().type;\n }\n\n /**\n The `id` of the record that this reference refers to.\n Together, the `type` and `id` properties form a composite key for\n the identity map.\n Example\n ```javascript\n let userRef = store.getReference('user', 1);\n userRef.id(); // '1'\n ```\n @method id\n @public\n @return {String} The id of the record.\n */\n id() {\n this._ref; // consume the tracked prop\n return _classPrivateFieldLooseBase(this, _identifier)[_identifier].id;\n }\n\n /**\n The `identifier` of the record that this reference refers to.\n Together, the `type` and `id` properties form a composite key for\n the identity map.\n Example\n ```javascript\n let userRef = store.getReference('user', 1);\n userRef.identifier(); // '1'\n ```\n @method identifier\n @public\n @return {String} The identifier of the record.\n */\n identifier() {\n return _classPrivateFieldLooseBase(this, _identifier)[_identifier];\n }\n\n /**\n How the reference will be looked up when it is loaded. Currently\n this always returns `identity` to signify that a record will be\n loaded by its `type` and `id`.\n Example\n ```javascript\n const userRef = store.getReference('user', 1);\n userRef.remoteType(); // 'identity'\n ```\n @method remoteType\n @public\n @return {String} 'identity'\n */\n remoteType() {\n return 'identity';\n }\n\n /**\n This API allows you to provide a reference with new data. The\n simplest usage of this API is similar to `store.push`: you provide a\n normalized hash of data and the object represented by the reference\n will update.\n If you pass a promise to `push`, Ember Data will not ask the adapter\n for the data if another attempt to fetch it is made in the\n interim. When the promise resolves, the underlying object is updated\n with the new data, and the promise returned by *this function* is resolved\n with that object.\n For example, `recordReference.push(promise)` will be resolved with a\n record.\n Example\n ```javascript\n let userRef = store.getReference('user', 1);\n // provide data for reference\n userRef.push({\n data: {\n id: \"1\",\n type: \"user\",\n attributes: {\n username: \"@user\"\n }\n }\n }).then(function(user) {\n userRef.value() === user;\n });\n ```\n @method push\n @public\n @param objectOrPromise a JSON:API ResourceDocument or a promise resolving to one\n @return a promise for the value (record or relationship)\n */\n push(objectOrPromise) {\n // TODO @deprecate pushing unresolved payloads\n return resolve(objectOrPromise).then(data => {\n return this.store.push(data);\n });\n }\n\n /**\n If the entity referred to by the reference is already loaded, it is\n present as `reference.value`. Otherwise the value returned by this function\n is `null`.\n Example\n ```javascript\n let userRef = store.getReference('user', 1);\n userRef.value(); // user\n ```\n @method value\n @public\n @return {Model} the record for this RecordReference\n */\n value() {\n return this.store.peekRecord(_classPrivateFieldLooseBase(this, _identifier)[_identifier]);\n }\n\n /**\n Triggers a fetch for the backing entity based on its `remoteType`\n (see `remoteType` definitions per reference type).\n Example\n ```javascript\n let userRef = store.getReference('user', 1);\n // load user (via store.find)\n userRef.load().then(...)\n ```\n @method load\n @public\n @return {Promise} the record for this RecordReference\n */\n load() {\n const id = this.id();\n if (id !== null) {\n return this.store.findRecord(this.type, id);\n }\n assert(`Unable to fetch record of type ${this.type} without an id`);\n }\n\n /**\n Reloads the record if it is already loaded. If the record is not\n loaded it will load the record via `store.findRecord`\n Example\n ```javascript\n let userRef = store.getReference('user', 1);\n // or trigger a reload\n userRef.reload().then(...)\n ```\n @method reload\n @public\n @return {Promise} the record for this RecordReference\n */\n reload() {\n const id = this.id();\n if (id !== null) {\n return this.store.findRecord(this.type, id, {\n reload: true\n });\n }\n assert(`Unable to fetch record of type ${this.type} without an id`);\n }\n}), _descriptor = _applyDecoratedDescriptor(_class.prototype, \"_ref\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return 0;\n }\n}), _class);\nexport { RecordReference as default };","import { assert } from '@ember/debug';\nimport { DEBUG } from '@glimmer/env';\nimport WeakCache from './weak-cache';\n\n/*\n * Returns the RecordData instance associated with a given\n * Model or Identifier\n */\n\nconst RecordDataForIdentifierCache = new WeakCache(DEBUG ? 'recordData' : '');\nexport function setRecordDataFor(identifier, recordData) {\n assert(`Illegal set of identifier`, !RecordDataForIdentifierCache.has(identifier) || RecordDataForIdentifierCache.get(identifier) === recordData);\n RecordDataForIdentifierCache.set(identifier, recordData);\n}\nexport function removeRecordDataFor(identifier) {\n RecordDataForIdentifierCache.delete(identifier);\n}\nexport default function recordDataFor(instance) {\n if (RecordDataForIdentifierCache.has(instance)) {\n return RecordDataForIdentifierCache.get(instance);\n }\n return null;\n}","import { importSync } from '@embroider/macros';\nimport { internalModelFactoryFor } from './internal-model-factory';\nimport constructResource from './utils/construct-resource';\n\n/**\n @module @ember-data/store\n*/\n\nfunction metaIsRelationshipDefinition(meta) {\n return typeof meta._inverseKey === 'function';\n}\nlet peekGraph;\nif (true /* HAS_RECORD_DATA_PACKAGE */) {\n let _peekGraph;\n peekGraph = wrapper => {\n _peekGraph = _peekGraph || importSync('@ember-data/record-data/-private').peekGraph;\n return _peekGraph(wrapper);\n };\n}\nexport default class RecordDataStoreWrapper {\n constructor(_store) {\n this._store = _store;\n this._willNotify = false;\n this._pendingNotifies = new Map();\n }\n get identifierCache() {\n return this._store.identifierCache;\n }\n _scheduleNotification(identifier, key, kind) {\n let pending = this._pendingNotifies.get(identifier);\n if (!pending) {\n pending = new Map();\n this._pendingNotifies.set(identifier, pending);\n }\n pending.set(key, kind);\n if (this._willNotify === true) {\n return;\n }\n this._willNotify = true;\n let backburner = this._store._backburner;\n backburner.schedule('notify', this, this._flushNotifications);\n }\n notifyErrorsChange(type, id, lid) {\n const resource = constructResource(type, id, lid);\n const identifier = this.identifierCache.getOrCreateRecordIdentifier(resource);\n let internalModel = internalModelFactoryFor(this._store).peek(identifier);\n if (internalModel) {\n internalModel.notifyErrorsChange();\n }\n }\n _flushNotifications() {\n if (this._willNotify === false) {\n return;\n }\n let pending = this._pendingNotifies;\n this._pendingNotifies = new Map();\n this._willNotify = false;\n const factory = internalModelFactoryFor(this._store);\n pending.forEach((map, identifier) => {\n const internalModel = factory.peek(identifier);\n if (internalModel) {\n map.forEach((kind, key) => {\n if (kind === 'belongsTo') {\n internalModel.notifyBelongsToChange(key);\n } else {\n internalModel.notifyHasManyChange(key);\n }\n });\n }\n });\n }\n attributesDefinitionFor(type) {\n return this._store.getSchemaDefinitionService().attributesDefinitionFor({\n type\n });\n }\n relationshipsDefinitionFor(type) {\n return this._store.getSchemaDefinitionService().relationshipsDefinitionFor({\n type\n });\n }\n inverseForRelationship(type, key) {\n const modelClass = this._store.modelFor(type);\n const definition = this.relationshipsDefinitionFor(type)[key];\n if (!definition) {\n return null;\n }\n if (metaIsRelationshipDefinition(definition)) {\n return definition._inverseKey(this._store, modelClass);\n } else if (definition.options && definition.options.inverse !== undefined) {\n return definition.options.inverse;\n } else {\n return null;\n }\n }\n inverseIsAsyncForRelationship(type, key) {\n const modelClass = this._store.modelFor(type);\n const definition = this.relationshipsDefinitionFor(type)[key];\n if (!definition) {\n return false;\n }\n if (definition.options && definition.options.inverse === null) {\n return false;\n }\n if (definition.inverseIsAsync !== undefined) {\n // TODO do we need to amend the RFC for this prop?\n // else we should add it to the TS interface and document.\n return !!definition.inverseIsAsync;\n } else if (metaIsRelationshipDefinition(definition)) {\n return definition._inverseIsAsync(this._store, modelClass);\n } else {\n return false;\n }\n }\n notifyPropertyChange(type, id, lid, key) {\n const resource = constructResource(type, id, lid);\n const identifier = this.identifierCache.getOrCreateRecordIdentifier(resource);\n let internalModel = internalModelFactoryFor(this._store).peek(identifier);\n if (internalModel) {\n internalModel.notifyAttributes(key ? [key] : []);\n }\n }\n notifyHasManyChange(type, id, lid, key) {\n const resource = constructResource(type, id, lid);\n const identifier = this.identifierCache.getOrCreateRecordIdentifier(resource);\n this._scheduleNotification(identifier, key, 'hasMany');\n }\n notifyBelongsToChange(type, id, lid, key) {\n const resource = constructResource(type, id, lid);\n const identifier = this.identifierCache.getOrCreateRecordIdentifier(resource);\n this._scheduleNotification(identifier, key, 'belongsTo');\n }\n notifyStateChange(type, id, lid, key) {\n const resource = constructResource(type, id, lid);\n const identifier = this.identifierCache.getOrCreateRecordIdentifier(resource);\n let internalModel = internalModelFactoryFor(this._store).peek(identifier);\n if (internalModel) {\n internalModel.notifyStateChange(key);\n }\n }\n recordDataFor(type, id, lid) {\n let identifier;\n let isCreate = false;\n if (!id && !lid) {\n isCreate = true;\n identifier = {\n type\n };\n } else {\n const resource = constructResource(type, id, lid);\n identifier = this.identifierCache.getOrCreateRecordIdentifier(resource);\n }\n return this._store._instanceCache.recordDataFor(identifier, isCreate);\n }\n setRecordId(type, id, lid) {\n this._store._instanceCache.setRecordId(type, id, lid);\n }\n isRecordInUse(type, id, lid) {\n const resource = constructResource(type, id, lid);\n const identifier = this.identifierCache.getOrCreateRecordIdentifier(resource);\n const record = this._store._instanceCache.peek({\n identifier,\n bucket: 'record'\n });\n return record ? !(record.isDestroyed || record.isDestroying) : false;\n }\n disconnectRecord(type, id, lid) {\n const resource = constructResource(type, id, lid);\n const identifier = this.identifierCache.getOrCreateRecordIdentifier(resource);\n if (true /* HAS_RECORD_DATA_PACKAGE */) {\n let graph = peekGraph(this);\n if (graph) {\n graph.remove(identifier);\n }\n }\n let internalModel = internalModelFactoryFor(this._store).peek(identifier);\n if (internalModel) {\n internalModel.destroyFromRecordData();\n }\n }\n}","function _classPrivateFieldLooseBase(e, t) { if (!{}.hasOwnProperty.call(e, t)) throw new TypeError(\"attempted to use private field on non-instance\"); return e; }\nvar id = 0;\nfunction _classPrivateFieldLooseKey(e) { return \"__private_\" + id++ + \"_\" + e; }\nimport { A, default as EmberArray } from '@ember/array';\nimport { assert } from '@ember/debug';\nimport { DEBUG } from '@glimmer/env';\nimport { resolve } from 'rsvp';\nimport coerceId, { ensureStringId } from './coerce-id';\nimport { assertIdentifierHasId } from './core-store';\nimport { internalModelFactoryFor, setRecordIdentifier } from './internal-model-factory';\nimport RecordReference from './model/record-reference';\nimport normalizeModelName from './normalize-model-name';\nimport recordDataFor, { setRecordDataFor } from './record-data-for';\nimport RecordDataStoreWrapper from './record-data-store-wrapper';\nimport Snapshot from './snapshot';\nimport constructResource from './utils/construct-resource';\nimport WeakCache from './weak-cache';\nconst RECORD_REFERENCES = new WeakCache(DEBUG ? 'reference' : '');\nexport const StoreMap = new WeakCache(DEBUG ? 'store' : '');\nexport function storeFor(record) {\n const store = StoreMap.get(record);\n assert(`A record in a disconnected state cannot utilize the store. This typically means the record has been destroyed, most commonly by unloading it.`, store);\n return store;\n}\nvar _instances = /*#__PURE__*/_classPrivateFieldLooseKey(\"instances\");\nexport class InstanceCache {\n constructor(store) {\n Object.defineProperty(this, _instances, {\n writable: true,\n value: {\n record: new WeakMap(),\n recordData: new WeakMap()\n }\n });\n this.store = store;\n this._storeWrapper = new RecordDataStoreWrapper(this.store);\n this.__recordDataFor = this.__recordDataFor.bind(this);\n RECORD_REFERENCES._generator = identifier => {\n return new RecordReference(this.store, identifier);\n };\n }\n peek({\n identifier,\n bucket\n }) {\n return _classPrivateFieldLooseBase(this, _instances)[_instances][bucket]?.get(identifier);\n }\n set({\n identifier,\n bucket,\n value\n }) {\n _classPrivateFieldLooseBase(this, _instances)[_instances][bucket].set(identifier, value);\n }\n getRecord(identifier, properties) {\n let record = this.peek({\n identifier,\n bucket: 'record'\n });\n if (!record) {\n // TODO store this state somewhere better\n const internalModel = this.getInternalModel(identifier);\n if (internalModel._isDematerializing) {\n // TODO this should be an assertion, this likely means\n // we have a bug to find wherein our own store is calling this\n // with an identifier that should have already been disconnected.\n // the destroy + fetch again case is likely either preserving the\n // identifier for re-use or failing to unload it.\n return null;\n }\n\n // TODO store this state somewhere better\n internalModel.hasRecord = true;\n if (properties && 'id' in properties) {\n assert(`expected id to be a string or null`, properties.id !== undefined);\n internalModel.setId(properties.id);\n }\n record = this._instantiateRecord(this.getRecordData(identifier), identifier, properties);\n this.set({\n identifier,\n bucket: 'record',\n value: record\n });\n }\n return record;\n }\n getReference(identifier) {\n return RECORD_REFERENCES.lookup(identifier);\n }\n _fetchDataIfNeededForIdentifier(identifier, options = {}) {\n const internalModel = this.getInternalModel(identifier);\n\n // pre-loading will change the isEmpty value\n // TODO stpre this state somewhere other than InternalModel\n const {\n isEmpty,\n isLoading\n } = internalModel;\n if (options.preload) {\n this.store._backburner.join(() => {\n internalModel.preloadData(options.preload);\n });\n }\n let promise;\n if (isEmpty) {\n assertIdentifierHasId(identifier);\n promise = this.store._fetchManager.scheduleFetch(identifier, options);\n } else if (isLoading) {\n promise = this.store._fetchManager.getPendingFetch(identifier, options);\n assert(`Expected to find a pending request for a record in the loading state, but found none`, promise);\n } else {\n promise = resolve(identifier);\n }\n return promise;\n }\n _instantiateRecord(recordData, identifier, properties) {\n // assert here\n if (properties !== undefined) {\n assert(`You passed '${typeof properties}' as properties for record creation instead of an object.`, typeof properties === 'object' && properties !== null);\n const {\n type\n } = identifier;\n\n // convert relationship Records to RecordDatas before passing to RecordData\n let defs = this.store.getSchemaDefinitionService().relationshipsDefinitionFor({\n type\n });\n if (defs !== null) {\n let keys = Object.keys(properties);\n let relationshipValue;\n for (let i = 0; i < keys.length; i++) {\n let prop = keys[i];\n let def = defs[prop];\n if (def !== undefined) {\n if (def.kind === 'hasMany') {\n if (DEBUG) {\n assertRecordsPassedToHasMany(properties[prop]);\n }\n relationshipValue = extractRecordDatasFromRecords(properties[prop]);\n } else {\n relationshipValue = extractRecordDataFromRecord(properties[prop]);\n }\n properties[prop] = relationshipValue;\n }\n }\n }\n }\n\n // TODO guard against initRecordOptions no being there\n let createOptions = recordData._initRecordCreateOptions(properties);\n //TODO Igor pass a wrapper instead of RD\n let record = this.store.instantiateRecord(identifier, createOptions,\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.__recordDataFor, this.store._notificationManager);\n setRecordIdentifier(record, identifier);\n setRecordDataFor(record, recordData);\n StoreMap.set(record, this.store);\n return record;\n }\n _teardownRecord(record) {\n StoreMap.delete(record);\n // TODO remove identifier:record cache link\n this.store.teardownRecord(record);\n }\n removeRecord(identifier) {\n let record = this.peek({\n identifier,\n bucket: 'record'\n });\n if (record) {\n _classPrivateFieldLooseBase(this, _instances)[_instances].record.delete(identifier);\n this._teardownRecord(record);\n }\n return !!record;\n }\n\n // TODO move RecordData Cache into InstanceCache\n getRecordData(identifier) {\n let recordData = this.peek({\n identifier,\n bucket: 'recordData'\n });\n if (!recordData) {\n recordData = this._createRecordData(identifier);\n _classPrivateFieldLooseBase(this, _instances)[_instances].recordData.set(identifier, recordData);\n this.getInternalModel(identifier).hasRecordData = true;\n }\n return recordData;\n }\n\n // TODO move InternalModel cache into InstanceCache\n getInternalModel(identifier) {\n return this._internalModelForResource(identifier);\n }\n createSnapshot(identifier, options = {}) {\n return new Snapshot(options, identifier, this.store);\n }\n __recordDataFor(resource) {\n const identifier = this.store.identifierCache.getOrCreateRecordIdentifier(resource);\n return this.recordDataFor(identifier, false);\n }\n\n // TODO move this to InstanceCache\n _createRecordData(identifier) {\n const recordData = this.store.createRecordDataFor(identifier.type, identifier.id, identifier.lid, this._storeWrapper);\n setRecordDataFor(identifier, recordData);\n // TODO this is invalid for v2 recordData but required\n // for v1 recordData. Remember to remove this once the\n // RecordData manager handles converting recordData to identifier\n setRecordIdentifier(recordData, identifier);\n return recordData;\n }\n\n // TODO string candidate for early elimination\n _internalModelForResource(resource) {\n return internalModelFactoryFor(this.store).getByResource(resource);\n }\n setRecordId(modelName, newId, clientId) {\n internalModelFactoryFor(this.store).setRecordId(modelName, newId, clientId);\n }\n _load(data) {\n // TODO type should be pulled from the identifier for debug\n let modelName = data.type;\n assert(`You must include an 'id' for ${modelName} in an object passed to 'push'`, data.id !== null && data.id !== undefined && data.id !== '');\n assert(`You tried to push data with a type '${modelName}' but no model could be found with that name.`, this.store.getSchemaDefinitionService().doesTypeExist(modelName));\n\n // TODO this should determine identifier via the cache before making assumptions\n const resource = constructResource(normalizeModelName(data.type), ensureStringId(data.id), coerceId(data.lid));\n const maybeIdentifier = this.store.identifierCache.peekRecordIdentifier(resource);\n let internalModel = internalModelFactoryFor(this.store).lookup(resource, data);\n\n // store.push will be from empty\n // findRecord will be from root.loading\n // this cannot be loading state if we do not already have an identifier\n // all else will be updates\n const isLoading = internalModel.isLoading || !internalModel.isLoaded && maybeIdentifier;\n const isUpdate = internalModel.isEmpty === false && !isLoading;\n\n // exclude store.push (root.empty) case\n let identifier = internalModel.identifier;\n if (isUpdate || isLoading) {\n let updatedIdentifier = this.store.identifierCache.updateRecordIdentifier(identifier, data);\n if (updatedIdentifier !== identifier) {\n // we encountered a merge of identifiers in which\n // two identifiers (and likely two internalModels)\n // existed for the same resource. Now that we have\n // determined the correct identifier to use, make sure\n // that we also use the correct internalModel.\n identifier = updatedIdentifier;\n internalModel = internalModelFactoryFor(this.store).lookup(identifier);\n }\n }\n internalModel.setupData(data);\n if (!isUpdate) {\n this.store.recordArrayManager.recordDidChange(identifier);\n }\n return identifier;\n }\n recordDataFor(identifier, isCreate) {\n let recordData;\n if (isCreate === true) {\n // TODO remove once InternalModel is no longer essential to internal state\n // and just build a new identifier directly\n let internalModel = internalModelFactoryFor(this.store).build({\n type: identifier.type,\n id: null\n });\n let stableIdentifier = internalModel.identifier;\n recordData = this.getRecordData(stableIdentifier);\n recordData.clientDidCreate();\n this.store.recordArrayManager.recordDidChange(stableIdentifier);\n } else {\n // TODO remove once InternalModel is no longer essential to internal state\n internalModelFactoryFor(this.store).lookup(identifier);\n recordData = this.getRecordData(identifier);\n }\n return recordData;\n }\n}\nfunction assertRecordsPassedToHasMany(records) {\n assert(`You must pass an array of records to set a hasMany relationship`,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\n Array.isArray(records) || EmberArray.detect(records));\n assert(`All elements of a hasMany relationship must be instances of Model, you passed ${records.map(r => `${typeof r}`).join(', ')}`, function () {\n return A(records).every(record => Object.prototype.hasOwnProperty.call(record, '_internalModel') === true);\n }());\n}\nfunction extractRecordDatasFromRecords(records) {\n return records.map(extractRecordDataFromRecord);\n}\nfunction extractRecordDataFromRecord(recordOrPromiseRecord) {\n if (!recordOrPromiseRecord) {\n return null;\n }\n if (isPromiseRecord(recordOrPromiseRecord)) {\n let content = recordOrPromiseRecord.get && recordOrPromiseRecord.get('content');\n assert('You passed in a promise that did not originate from an EmberData relationship. You can only pass promises that come from a belongsTo or hasMany relationship to the get call.', content !== undefined);\n return content ? recordDataFor(content) : null;\n }\n return recordDataFor(recordOrPromiseRecord);\n}\nfunction isPromiseRecord(record) {\n return !!record.then;\n}","import { DEBUG } from '@glimmer/env';\nimport WeakCache from '../weak-cache';\nconst AvailableShims = new WeakCache(DEBUG ? 'schema-shims' : '');\nAvailableShims._generator = () => {\n return Object.create(null);\n};\nexport function getShimClass(store, modelName) {\n let shims = AvailableShims.lookup(store);\n let shim = shims[modelName];\n if (shim === undefined) {\n shim = shims[modelName] = new ShimModelClass(store, modelName);\n }\n return shim;\n}\nfunction mapFromHash(hash) {\n let map = new Map();\n for (let i in hash) {\n if (Object.prototype.hasOwnProperty.call(hash, i)) {\n map.set(i, hash[i]);\n }\n }\n return map;\n}\n\n// Mimics the static apis of DSModel\nexport default class ShimModelClass {\n // TODO Maybe expose the class here?\n constructor(__store, modelName) {\n this.__store = __store;\n this.modelName = modelName;\n }\n get fields() {\n let attrs = this.__store.getSchemaDefinitionService().attributesDefinitionFor({\n type: this.modelName\n });\n let relationships = this.__store.getSchemaDefinitionService().relationshipsDefinitionFor({\n type: this.modelName\n });\n let fields = new Map();\n Object.keys(attrs).forEach(key => fields.set(key, 'attribute'));\n Object.keys(relationships).forEach(key => fields.set(key, relationships[key].kind));\n return fields;\n }\n get attributes() {\n let attrs = this.__store.getSchemaDefinitionService().attributesDefinitionFor({\n type: this.modelName\n });\n return mapFromHash(attrs);\n }\n get relationshipsByName() {\n let relationships = this.__store.getSchemaDefinitionService().relationshipsDefinitionFor({\n type: this.modelName\n });\n return mapFromHash(relationships);\n }\n eachAttribute(callback, binding) {\n let attrDefs = this.__store.getSchemaDefinitionService().attributesDefinitionFor({\n type: this.modelName\n });\n Object.keys(attrDefs).forEach(key => {\n callback.call(binding, key, attrDefs[key]);\n });\n }\n eachRelationship(callback, binding) {\n let relationshipDefs = this.__store.getSchemaDefinitionService().relationshipsDefinitionFor({\n type: this.modelName\n });\n Object.keys(relationshipDefs).forEach(key => {\n callback.call(binding, key, relationshipDefs[key]);\n });\n }\n eachTransformedAttribute(callback, binding) {\n let relationshipDefs = this.__store.getSchemaDefinitionService().relationshipsDefinitionFor({\n type: this.modelName\n });\n Object.keys(relationshipDefs).forEach(key => {\n if (relationshipDefs[key].type) {\n callback.call(binding, key, relationshipDefs[key]);\n }\n });\n }\n}","import ArrayProxy from '@ember/array/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\nimport ObjectProxy from '@ember/object/proxy';\nexport const PromiseArrayProxy = ArrayProxy.extend(PromiseProxyMixin);\nexport const PromiseObjectProxy = ObjectProxy.extend(PromiseProxyMixin);","var _dec, _class, _descriptor;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport { deprecate } from '@ember/debug';\nimport { reads } from '@ember/object/computed';\nimport { resolve } from 'rsvp';\nimport { PromiseArrayProxy, PromiseObjectProxy } from './promise-proxy-base';\n\n/**\n @module @ember-data/store\n*/\n\n/**\n A `PromiseArray` is an object that acts like both an `Ember.Array`\n and a promise. When the promise is resolved the resulting value\n will be set to the `PromiseArray`'s `content` property. This makes\n it easy to create data bindings with the `PromiseArray` that will be\n updated when the promise resolves.\n\n This class should not be imported and instantiated directly.\n\n For more information see the [Ember.PromiseProxyMixin\n documentation](/ember/release/classes/PromiseProxyMixin).\n\n Example\n\n ```javascript\n let promiseArray = PromiseArray.create({\n promise: $.getJSON('/some/remote/data.json')\n });\n\n promiseArray.get('length'); // 0\n\n promiseArray.then(function() {\n promiseArray.get('length'); // 100\n });\n ```\n\n @class PromiseArray\n @public\n @extends Ember.ArrayProxy\n @uses Ember.PromiseProxyMixin\n*/\n\nexport let PromiseArray = (_dec = reads('content.meta'), _class = class PromiseArray extends PromiseArrayProxy {\n constructor(...args) {\n super(...args);\n _initializerDefineProperty(this, \"meta\", _descriptor, this);\n }\n}, _descriptor = _applyDecoratedDescriptor(_class.prototype, \"meta\", [_dec], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _class);\n\n/**\n A `PromiseObject` is an object that acts like both an `EmberObject`\n and a promise. When the promise is resolved, then the resulting value\n will be set to the `PromiseObject`'s `content` property. This makes\n it easy to create data bindings with the `PromiseObject` that will\n be updated when the promise resolves.\n\n This class should not be imported and instantiated directly.\n\n For more information see the [Ember.PromiseProxyMixin\n documentation](/ember/release/classes/PromiseProxyMixin.html).\n\n Example\n\n ```javascript\n let promiseObject = PromiseObject.create({\n promise: $.getJSON('/some/remote/data.json')\n });\n\n promiseObject.get('name'); // null\n\n promiseObject.then(function() {\n promiseObject.get('name'); // 'Tomster'\n });\n ```\n\n @class PromiseObject\n @public\n @extends Ember.ObjectProxy\n @uses Ember.PromiseProxyMixin\n*/\nexport { PromiseObjectProxy as PromiseObject };\nexport function promiseObject(promise, label) {\n return PromiseObjectProxy.create({\n promise: resolve(promise, label)\n });\n}\nexport function promiseArray(promise, label) {\n return PromiseArray.create({\n promise: resolve(promise, label)\n });\n}\n\n// constructor is accessed in some internals but not including it in the copyright for the deprecation\nconst ALLOWABLE_METHODS = ['constructor', 'then', 'catch', 'finally'];\nexport function deprecatedPromiseObject(promise) {\n const promiseObjectProxy = promiseObject(promise);\n const handler = {\n get(target, prop, receiver) {\n if (!ALLOWABLE_METHODS.includes(prop)) {\n deprecate(`Accessing ${prop} is deprecated. The return type is being changed fomr PromiseObjectProxy to a Promise. The only available methods to access on this promise are .then, .catch and .finally`, false, {\n id: 'ember-data:model-save-promise',\n until: '5.0',\n for: '@ember-data/store',\n since: {\n available: '4.4',\n enabled: '4.4'\n }\n });\n }\n const value = Reflect.get(target, prop, receiver);\n if (value && typeof value === 'function' && typeof value.bind === 'function') {\n return value.bind(target);\n }\n return value;\n }\n };\n return new Proxy(promiseObjectProxy, handler);\n}","/**\n @module @ember-data/store\n*/\n\nimport { deprecate } from '@ember/debug';\n/**\n SnapshotRecordArray is not directly instantiable.\n Instances are provided to consuming application's\n adapters for certain requests.\n\n @class SnapshotRecordArray\n @public\n*/\nexport default class SnapshotRecordArray {\n /**\n SnapshotRecordArray is not directly instantiable.\n Instances are provided to consuming application's\n adapters and serializers for certain requests.\n @method constructor\n @private\n @constructor\n @param {RecordArray} recordArray\n @param {Object} meta\n @param options\n */\n constructor(recordArray, meta, options = {}) {\n /**\n An array of snapshots\n @private\n @property _snapshots\n @type {Array}\n */\n this._snapshots = null;\n\n /**\n An array of records\n @private\n @property _recordArray\n @type {Array}\n */\n this._recordArray = recordArray;\n\n /**\n Number of records in the array\n Example\n ```app/adapters/post.js\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n export default class PostAdapter extends JSONAPIAdapter {\n shouldReloadAll(store, snapshotRecordArray) {\n return !snapshotRecordArray.length;\n }\n });\n ```\n @property length\n @public\n @type {Number}\n */\n this.length = recordArray.get('length');\n\n /**\n Meta objects for the record array.\n Example\n ```app/adapters/post.js\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n export default class PostAdapter extends JSONAPIAdapter {\n shouldReloadAll(store, snapshotRecordArray) {\n let lastRequestTime = snapshotRecordArray.meta.lastRequestTime;\n let twentyMinutes = 20 * 60 * 1000;\n return Date.now() > lastRequestTime + twentyMinutes;\n }\n });\n ```\n @property meta\n @public\n @type {Object}\n */\n this.meta = meta;\n\n /**\n A hash of adapter options passed into the store method for this request.\n Example\n ```app/adapters/post.js\n import MyCustomAdapter from './custom-adapter';\n export default class PostAdapter extends MyCustomAdapter {\n findAll(store, type, sinceToken, snapshotRecordArray) {\n if (snapshotRecordArray.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n }\n ```\n @property adapterOptions\n @public\n @type {Object}\n */\n this.adapterOptions = options.adapterOptions;\n\n /**\n The relationships to include for this request.\n Example\n ```app/adapters/application.js\n import Adapter from '@ember-data/adapter';\n export default class ApplicationAdapter extends Adapter {\n findAll(store, type, snapshotRecordArray) {\n let url = `/${type.modelName}?include=${encodeURIComponent(snapshotRecordArray.include)}`;\n return fetch(url).then((response) => response.json())\n }\n }\n ```\n @property include\n @public\n @type {String|Array}\n */\n this.include = options.include;\n }\n\n /**\n The type of the underlying records for the snapshots in the array, as a Model\n @property type\n @deprecated\n @public\n @type {Model}\n */\n\n /**\n The modelName of the underlying records for the snapshots in the array, as a Model\n @property modelName\n @public\n @type {Model}\n */\n get modelName() {\n return this._recordArray.modelName;\n }\n\n /**\n Get snapshots of the underlying record array\n Example\n ```app/adapters/post.js\n import JSONAPIAdapter from '@ember-data/adapter/json-api';\n export default class PostAdapter extends JSONAPIAdapter {\n shouldReloadAll(store, snapshotArray) {\n let snapshots = snapshotArray.snapshots();\n return snapshots.any(function(ticketSnapshot) {\n let timeDiff = moment().diff(ticketSnapshot.attr('lastAccessedAt'), 'minutes');\n if (timeDiff > 20) {\n return true;\n } else {\n return false;\n }\n });\n }\n }\n ```\n @method snapshots\n @public\n @return {Array} Array of snapshots\n */\n snapshots() {\n if (this._snapshots !== null) {\n return this._snapshots;\n }\n this._snapshots = this._recordArray._takeSnapshot();\n return this._snapshots;\n }\n}\nif (true /* DEPRECATE_SNAPSHOT_MODEL_CLASS_ACCESS */) {\n Object.defineProperty(SnapshotRecordArray.prototype, 'type', {\n get() {\n deprecate(`Using SnapshotRecordArray.type to access the ModelClass for a record is deprecated. Use store.modelFor() instead.`, false, {\n id: 'ember-data:deprecate-snapshot-model-class-access',\n until: '5.0',\n for: 'ember-data',\n since: {\n available: '4.5.0',\n enabled: '4.5.0'\n }\n });\n return this._recordArray.get('type');\n }\n });\n}","var _class, _descriptor;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n/**\n @module @ember-data/store\n*/\n\nimport ArrayProxy from '@ember/array/proxy';\nimport { assert, deprecate } from '@ember/debug';\nimport { get, set } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\nimport { Promise } from 'rsvp';\nimport { promiseArray } from '../promise-proxies';\nimport SnapshotRecordArray from '../snapshot-record-array';\nfunction recordForIdentifier(store, identifier) {\n return store._instanceCache.getRecord(identifier);\n}\n/**\n A record array is an array that contains records of a certain modelName. The record\n array materializes records as needed when they are retrieved for the first\n time. You should not create record arrays yourself. Instead, an instance of\n `RecordArray` or its subclasses will be returned by your application's store\n in response to queries.\n\n This class should not be imported and instantiated by consuming applications.\n\n @class RecordArray\n @public\n @extends Ember.ArrayProxy\n*/\nlet RecordArray = (_class = class RecordArray extends ArrayProxy {\n constructor(...args) {\n super(...args);\n /**\n The array of client ids backing the record array. When a\n record is requested from the record array, the record\n for the client id at the same index is materialized, if\n necessary, by the store.\n @property content\n @private\n @type Ember.Array\n */\n /**\n The flag to signal a `RecordArray` is finished loading data.\n Example\n ```javascript\n let people = store.peekAll('person');\n people.get('isLoaded'); // true\n ```\n @property isLoaded\n @public\n @type Boolean\n */\n /**\n The store that created this record array.\n @property store\n @private\n @type Store\n */\n /**\n The flag to signal a `RecordArray` is currently loading data.\n Example\n ```javascript\n let people = store.peekAll('person');\n people.get('isUpdating'); // false\n people.update();\n people.get('isUpdating'); // true\n ```\n @property isUpdating\n @public\n @type Boolean\n */\n _initializerDefineProperty(this, \"isUpdating\", _descriptor, this);\n }\n init(props) {\n assert(`Cannot initialize RecordArray with isUpdating`, !props || !('isUpdating' in props));\n assert(`Cannot initialize RecordArray with isUpdating`, !props || !('_updatingPromise' in props));\n super.init();\n\n // TODO can we get rid of this?\n this.set('content', this.content || null);\n this._updatingPromise = null;\n }\n replace() {\n throw new Error(`The result of a server query (for all ${this.modelName} types) is immutable. To modify contents, use toArray()`);\n }\n\n /**\n The modelClass represented by this record array.\n @property type\n @public\n @deprecated\n @type {subclass of Model}\n */\n\n /**\n Retrieves an object from the content by index.\n @method objectAtContent\n @private\n @param {Number} index\n @return {Model} record\n */\n objectAtContent(index) {\n let identifier = get(this, 'content').objectAt(index);\n return identifier ? recordForIdentifier(this.store, identifier) : undefined;\n }\n\n /**\n Used to get the latest version of all of the records in this array\n from the adapter.\n Example\n ```javascript\n let people = store.peekAll('person');\n people.get('isUpdating'); // false\n people.update().then(function() {\n people.get('isUpdating'); // false\n });\n people.get('isUpdating'); // true\n ```\n @method update\n @public\n */\n update() {\n if (this.isUpdating) {\n return this._updatingPromise;\n }\n this.isUpdating = true;\n let updatingPromise = this._update();\n updatingPromise.finally(() => {\n this._updatingPromise = null;\n if (this.isDestroying || this.isDestroyed) {\n return;\n }\n this.isUpdating = false;\n });\n this._updatingPromise = updatingPromise;\n return updatingPromise;\n }\n\n /*\n Update this RecordArray and return a promise which resolves once the update\n is finished.\n */\n _update() {\n return this.store.findAll(this.modelName, {\n reload: true\n });\n }\n\n /**\n Saves all of the records in the `RecordArray`.\n Example\n ```javascript\n let messages = store.peekAll('message');\n messages.forEach(function(message) {\n message.set('hasBeenSeen', true);\n });\n messages.save();\n ```\n @method save\n @public\n @return {PromiseArray} promise\n */\n save() {\n let promiseLabel = `DS: RecordArray#save ${this.modelName}`;\n let promise = Promise.all(this.invoke('save'), promiseLabel).then(() => this, null, 'DS: RecordArray#save return RecordArray');\n return promiseArray(promise);\n }\n\n /**\n @method _unregisterFromManager\n @internal\n */\n _unregisterFromManager() {\n this.manager.unregisterRecordArray(this);\n }\n willDestroy() {\n this._unregisterFromManager();\n this._dissociateFromOwnRecords();\n // TODO: we should not do work during destroy:\n // * when objects are destroyed, they should simply be left to do\n // * if logic errors do to this, that logic needs to be more careful during\n // teardown (ember provides isDestroying/isDestroyed) for this reason\n // * the exception being: if an dominator has a reference to this object,\n // and must be informed to release e.g. e.g. removing itself from th\n // recordArrayMananger\n set(this, 'content', null);\n set(this, 'length', 0);\n super.willDestroy();\n }\n\n /**\n @method _createSnapshot\n @private\n */\n _createSnapshot(options) {\n // this is private for users, but public for ember-data internals\n // meta will only be present for an AdapterPopulatedRecordArray\n return new SnapshotRecordArray(this, null, options);\n }\n\n /**\n @method _dissociateFromOwnRecords\n @internal\n */\n _dissociateFromOwnRecords() {\n this.content.forEach(identifier => {\n let recordArrays = this.manager.getRecordArraysForIdentifier(identifier);\n if (recordArrays) {\n recordArrays.delete(this);\n }\n });\n }\n\n /**\n Adds identifiers to the `RecordArray` without duplicates\n @method _pushIdentifiers\n @internal\n @param {StableRecordIdentifier[]} identifiers\n */\n _pushIdentifiers(identifiers) {\n this.content.pushObjects(identifiers);\n }\n\n /**\n Removes identifiers from the `RecordArray`.\n @method _removeIdentifiers\n @internal\n @param {StableRecordIdentifier[]} identifiers\n */\n _removeIdentifiers(identifiers) {\n this.content.removeObjects(identifiers);\n }\n\n /**\n @method _takeSnapshot\n @internal\n */\n _takeSnapshot() {\n return this.content.map(identifier => this.store._instanceCache.createSnapshot(identifier));\n }\n}, _descriptor = _applyDecoratedDescriptor(_class.prototype, \"isUpdating\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return false;\n }\n}), _class);\nexport { RecordArray as default };\nif (true /* DEPRECATE_SNAPSHOT_MODEL_CLASS_ACCESS */) {\n Object.defineProperty(RecordArray.prototype, 'type', {\n get() {\n deprecate(`Using RecordArray.type to access the ModelClass for a record is deprecated. Use store.modelFor() instead.`, false, {\n id: 'ember-data:deprecate-snapshot-model-class-access',\n until: '5.0',\n for: 'ember-data',\n since: {\n available: '4.5.0',\n enabled: '4.5.0'\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!this.modelName) {\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\n return this.store.modelFor(this.modelName);\n }\n });\n}","import { assert } from '@ember/debug';\nimport { promiseArray } from '../promise-proxies';\nimport SnapshotRecordArray from '../snapshot-record-array';\nimport RecordArray from './record-array';\n/**\n @module @ember-data/store\n*/\n\n/**\n Represents an ordered list of records whose order and membership is\n determined by the adapter. For example, a query sent to the adapter\n may trigger a search on the server, whose results would be loaded\n into an instance of the `AdapterPopulatedRecordArray`.\n\n This class should not be imported and instantiated by consuming applications.\n\n ---\n\n If you want to update the array and get the latest records from the\n adapter, you can invoke [`update()`](AdapterPopulatedRecordArray/methods/update?anchor=update):\n\n Example\n\n ```javascript\n // GET /users?isAdmin=true\n store.query('user', { isAdmin: true }).then(function(admins) {\n\n admins.then(function() {\n console.log(admins.get(\"length\")); // 42\n });\n\n // somewhere later in the app code, when new admins have been created\n // in the meantime\n //\n // GET /users?isAdmin=true\n admins.update().then(function() {\n admins.get('isUpdating'); // false\n console.log(admins.get(\"length\")); // 123\n });\n\n admins.get('isUpdating'); // true\n }\n ```\n\n @class AdapterPopulatedRecordArray\n @public\n @extends RecordArray\n*/\nexport default class AdapterPopulatedRecordArray extends RecordArray {\n init(props) {\n assert(`Cannot initialize AdapterPopulatedRecordArray with isUpdating`, !props || !('isUpdating' in props));\n super.init();\n this.query = this.query || null;\n this.links = this.links || null;\n this.meta = this.meta || null;\n }\n replace() {\n throw new Error(`The result of a server query (on ${this.modelName}) is immutable.`);\n }\n _update() {\n const {\n store,\n query\n } = this;\n\n // TODO save options from initial request?\n return promiseArray(store.query(this.modelName, query, {\n _recordArray: this\n }));\n }\n _setObjects(identifiers, payload) {\n // TODO: initial load should not cause change events at all, only\n // subsequent. This requires changing the public api of adapter.query, but\n // hopefully we can do that soon.\n this.content.setObjects(identifiers);\n this.setProperties({\n isLoaded: true,\n isUpdating: false,\n // TODO this assign kills the root reference but a deep-copy would be required\n // for both meta and links to actually not be by-ref. We whould likely change\n // this to a dev-only deep-freeze.\n meta: Object.assign({}, payload.meta),\n links: Object.assign({}, payload.links)\n });\n this.manager._associateWithRecordArray(identifiers, this);\n }\n _createSnapshot(options) {\n // this is private for users, but public for ember-data internals\n // meta will only be present for an AdapterPopulatedRecordArray\n return new SnapshotRecordArray(this, this.meta, options);\n }\n\n /**\n @method _setIdentifiers\n @param {StableRecordIdentifier[]} identifiers\n @param {Object} payload normalized payload\n @private\n */\n _setIdentifiers(identifiers, payload) {\n this._setObjects(identifiers, payload);\n }\n}","/**\n @module @ember-data/store\n*/\n\nimport { A } from '@ember/array';\nimport { assert } from '@ember/debug';\nimport { set } from '@ember/object';\nimport { _backburner as emberBackburner } from '@ember/runloop';\nimport { DEBUG } from '@glimmer/env';\n\n// import isStableIdentifier from '../identifiers/is-stable-identifier';\n\nimport { internalModelFactoryFor } from './internal-model-factory';\nimport AdapterPopulatedRecordArray from './record-arrays/adapter-populated-record-array';\nimport RecordArray from './record-arrays/record-array';\nimport WeakCache from './weak-cache';\nconst RecordArraysCache = new WeakCache(DEBUG ? 'record-arrays' : '');\nRecordArraysCache._generator = () => new Set();\nexport function recordArraysForIdentifier(identifier) {\n return RecordArraysCache.lookup(identifier);\n}\nconst pendingForIdentifier = new Set([]);\nfunction getIdentifier(identifier) {\n // during dematerialization we will get an identifier that\n // has already been removed from the identifiers cache\n // so it will not behave as if stable. This is a bug we should fix.\n // if (!isStableIdentifier(identifierOrInternalModel)) {\n // console.log({ unstable: i });\n // }\n\n return identifier;\n}\nfunction shouldIncludeInRecordArrays(store, identifier) {\n const cache = internalModelFactoryFor(store);\n const internalModel = cache.peek(identifier);\n if (internalModel === null) {\n return false;\n }\n return !internalModel.isHiddenFromRecordArrays();\n}\n\n/**\n @class RecordArrayManager\n @internal\n*/\nclass RecordArrayManager {\n constructor(options) {\n this.store = options.store;\n this.isDestroying = false;\n this.isDestroyed = false;\n this._liveRecordArrays = Object.create(null);\n this._pendingIdentifiers = Object.create(null);\n this._adapterPopulatedRecordArrays = [];\n }\n\n /**\n * @method getRecordArraysForIdentifier\n * @internal\n * @param {StableIdentifier} param\n * @return {RecordArray} array\n */\n getRecordArraysForIdentifier(identifier) {\n return recordArraysForIdentifier(identifier);\n }\n _flushPendingIdentifiersForModelName(modelName, identifiers) {\n if (this.isDestroying || this.isDestroyed) {\n return;\n }\n let identifiersToRemove = [];\n for (let j = 0; j < identifiers.length; j++) {\n let i = identifiers[j];\n // mark identifiers, so they can once again be processed by the\n // recordArrayManager\n pendingForIdentifier.delete(i);\n // build up a set of models to ensure we have purged correctly;\n let isIncluded = shouldIncludeInRecordArrays(this.store, i);\n if (!isIncluded) {\n identifiersToRemove.push(i);\n }\n }\n let array = this._liveRecordArrays[modelName];\n if (array) {\n // TODO: skip if it only changed\n // process liveRecordArrays\n updateLiveRecordArray(this.store, array, identifiers);\n }\n\n // process adapterPopulatedRecordArrays\n if (identifiersToRemove.length > 0) {\n removeFromAdapterPopulatedRecordArrays(this.store, identifiersToRemove);\n }\n }\n _flush() {\n let pending = this._pendingIdentifiers;\n this._pendingIdentifiers = Object.create(null);\n for (let modelName in pending) {\n this._flushPendingIdentifiersForModelName(modelName, pending[modelName]);\n }\n }\n _syncLiveRecordArray(array, modelName) {\n assert(`recordArrayManger.syncLiveRecordArray expects modelName not modelClass as the second param`, typeof modelName === 'string');\n let pending = this._pendingIdentifiers[modelName];\n if (!Array.isArray(pending)) {\n return;\n }\n let hasNoPotentialDeletions = pending.length === 0;\n let map = internalModelFactoryFor(this.store).modelMapFor(modelName);\n let hasNoInsertionsOrRemovals = map.length === array.length;\n\n /*\n Ideally the recordArrayManager has knowledge of the changes to be applied to\n liveRecordArrays, and is capable of strategically flushing those changes and applying\n small diffs if desired. However, until we've refactored recordArrayManager, this dirty\n check prevents us from unnecessarily wiping out live record arrays returned by peekAll.\n */\n if (hasNoPotentialDeletions && hasNoInsertionsOrRemovals) {\n return;\n }\n this._flushPendingIdentifiersForModelName(modelName, pending);\n delete this._pendingIdentifiers[modelName];\n let identifiers = this._visibleIdentifiersByType(modelName);\n let identifiersToAdd = [];\n for (let i = 0; i < identifiers.length; i++) {\n let identifier = identifiers[i];\n let recordArrays = recordArraysForIdentifier(identifier);\n if (recordArrays.has(array) === false) {\n recordArrays.add(array);\n identifiersToAdd.push(identifier);\n }\n }\n if (identifiersToAdd.length) {\n array._pushIdentifiers(identifiersToAdd);\n }\n }\n _didUpdateAll(modelName) {\n let recordArray = this._liveRecordArrays[modelName];\n if (recordArray) {\n set(recordArray, 'isUpdating', false);\n // TODO potentially we should sync here, currently\n // this occurs as a side-effect of individual records updating\n // this._syncLiveRecordArray(recordArray, modelName);\n }\n }\n\n /**\n Get the `RecordArray` for a modelName, which contains all loaded records of\n given modelName.\n @method liveRecordArrayFor\n @internal\n @param {String} modelName\n @return {RecordArray}\n */\n liveRecordArrayFor(modelName) {\n assert(`recordArrayManger.liveRecordArrayFor expects modelName not modelClass as the param`, typeof modelName === 'string');\n let array = this._liveRecordArrays[modelName];\n if (array) {\n // if the array already exists, synchronize\n this._syncLiveRecordArray(array, modelName);\n } else {\n // if the array is being newly created merely create it with its initial\n // content already set. This prevents unneeded change events.\n let identifiers = this._visibleIdentifiersByType(modelName);\n array = this.createRecordArray(modelName, identifiers);\n this._liveRecordArrays[modelName] = array;\n }\n return array;\n }\n _visibleIdentifiersByType(modelName) {\n let all = internalModelFactoryFor(this.store).modelMapFor(modelName).recordIdentifiers;\n let visible = [];\n for (let i = 0; i < all.length; i++) {\n let identifier = all[i];\n let shouldInclude = shouldIncludeInRecordArrays(this.store, identifier);\n if (shouldInclude) {\n visible.push(identifier);\n }\n }\n return visible;\n }\n\n /**\n Create a `RecordArray` for a modelName.\n @method createRecordArray\n @internal\n @param {String} modelName\n @param {Array} [identifiers]\n @return {RecordArray}\n */\n createRecordArray(modelName, identifiers = []) {\n assert(`recordArrayManger.createRecordArray expects modelName not modelClass as the param`, typeof modelName === 'string');\n let array = RecordArray.create({\n modelName,\n content: A(identifiers || []),\n store: this.store,\n isLoaded: true,\n manager: this\n });\n if (Array.isArray(identifiers)) {\n this._associateWithRecordArray(identifiers, array);\n }\n return array;\n }\n\n /**\n Create a `AdapterPopulatedRecordArray` for a modelName with given query.\n @method createAdapterPopulatedRecordArray\n @internal\n @param {String} modelName\n @param {Object} query\n @return {AdapterPopulatedRecordArray}\n */\n createAdapterPopulatedRecordArray(modelName, query, identifiers, payload) {\n assert(`recordArrayManger.createAdapterPopulatedRecordArray expects modelName not modelClass as the first param, received ${modelName}`, typeof modelName === 'string');\n let array;\n if (Array.isArray(identifiers)) {\n array = AdapterPopulatedRecordArray.create({\n modelName,\n query: query,\n content: A(identifiers),\n store: this.store,\n manager: this,\n isLoaded: true,\n isUpdating: false,\n // TODO this assign kills the root reference but a deep-copy would be required\n // for both meta and links to actually not be by-ref. We whould likely change\n // this to a dev-only deep-freeze.\n meta: Object.assign({}, payload?.meta),\n links: Object.assign({}, payload?.links)\n });\n this._associateWithRecordArray(identifiers, array);\n } else {\n array = AdapterPopulatedRecordArray.create({\n modelName,\n query: query,\n content: A(),\n isLoaded: false,\n store: this.store,\n manager: this\n });\n }\n this._adapterPopulatedRecordArrays.push(array);\n return array;\n }\n\n /**\n Unregister a RecordArray.\n So manager will not update this array.\n @method unregisterRecordArray\n @internal\n @param {RecordArray} array\n */\n unregisterRecordArray(array) {\n let modelName = array.modelName;\n\n // remove from adapter populated record array\n let removedFromAdapterPopulated = removeFromArray(this._adapterPopulatedRecordArrays, array);\n if (!removedFromAdapterPopulated) {\n let liveRecordArrayForType = this._liveRecordArrays[modelName];\n // unregister live record array\n if (liveRecordArrayForType) {\n if (array === liveRecordArrayForType) {\n delete this._liveRecordArrays[modelName];\n }\n }\n }\n }\n\n /**\n * @method _associateWithRecordArray\n * @internal\n * @param {StableIdentifier} identifiers\n * @param {RecordArray} array\n */\n _associateWithRecordArray(identifiers, array) {\n for (let i = 0, l = identifiers.length; i < l; i++) {\n let identifier = identifiers[i];\n identifier = getIdentifier(identifier);\n let recordArrays = this.getRecordArraysForIdentifier(identifier);\n recordArrays.add(array);\n }\n }\n\n /**\n @method recordDidChange\n @internal\n */\n recordDidChange(identifier) {\n if (this.isDestroying || this.isDestroyed) {\n return;\n }\n let modelName = identifier.type;\n identifier = getIdentifier(identifier);\n if (pendingForIdentifier.has(identifier)) {\n return;\n }\n pendingForIdentifier.add(identifier);\n let pending = this._pendingIdentifiers;\n let models = pending[modelName] = pending[modelName] || [];\n if (models.push(identifier) !== 1) {\n return;\n }\n\n // TODO do we still need this schedule?\n // eslint-disable-next-line @typescript-eslint/unbound-method\n emberBackburner.schedule('actions', this, this._flush);\n }\n willDestroy() {\n Object.keys(this._liveRecordArrays).forEach(modelName => this._liveRecordArrays[modelName].destroy());\n this._adapterPopulatedRecordArrays.forEach(entry => entry.destroy());\n this.isDestroyed = true;\n }\n destroy() {\n this.isDestroying = true;\n // TODO do we still need this schedule?\n // eslint-disable-next-line @typescript-eslint/unbound-method\n emberBackburner.schedule('actions', this, this.willDestroy);\n }\n}\nfunction removeFromArray(array, item) {\n let index = array.indexOf(item);\n if (index !== -1) {\n array.splice(index, 1);\n return true;\n }\n return false;\n}\nfunction updateLiveRecordArray(store, recordArray, identifiers) {\n let identifiersToAdd = [];\n let identifiersToRemove = [];\n for (let i = 0; i < identifiers.length; i++) {\n let identifier = identifiers[i];\n let shouldInclude = shouldIncludeInRecordArrays(store, identifier);\n let recordArrays = recordArraysForIdentifier(identifier);\n if (shouldInclude) {\n if (!recordArrays.has(recordArray)) {\n identifiersToAdd.push(identifier);\n recordArrays.add(recordArray);\n }\n }\n if (!shouldInclude) {\n identifiersToRemove.push(identifier);\n recordArrays.delete(recordArray);\n }\n }\n if (identifiersToAdd.length > 0) {\n recordArray._pushIdentifiers(identifiersToAdd);\n }\n if (identifiersToRemove.length > 0) {\n recordArray._removeIdentifiers(identifiersToRemove);\n }\n}\nfunction removeFromAdapterPopulatedRecordArrays(store, identifiers) {\n for (let i = 0; i < identifiers.length; i++) {\n removeFromAll(store, identifiers[i]);\n }\n}\nfunction removeFromAll(store, identifier) {\n identifier = getIdentifier(identifier);\n const recordArrays = recordArraysForIdentifier(identifier);\n recordArrays.forEach(function (recordArray) {\n recordArray._removeIdentifiers([identifier]);\n });\n recordArrays.clear();\n}\nexport default RecordArrayManager;","import { getOwner } from '@ember/application';\nimport { deprecate } from '@ember/debug';\nimport { get } from '@ember/object';\nimport { importSync } from '@embroider/macros';\nimport normalizeModelName from './normalize-model-name';\nlet _modelForMixin;\nif (true /* HAS_MODEL_PACKAGE */) {\n let _found;\n _modelForMixin = function () {\n if (!_found) {\n _found = importSync('@ember-data/model/-private')._modelForMixin;\n }\n return _found(...arguments);\n };\n}\nexport class DSModelSchemaDefinitionService {\n constructor(store) {\n this._relationshipsDefCache = Object.create(null);\n this._attributesDefCache = Object.create(null);\n this.store = store;\n }\n\n // Following the existing RD implementation\n attributesDefinitionFor(identifier) {\n let modelName, attributes;\n if (true /* DEPRECATE_STRING_ARG_SCHEMAS */ && typeof identifier === 'string') {\n deprecate(`attributesDefinitionFor expects either a record identifier or an argument of shape { type: string }, received a string.`, false, {\n id: 'ember-data:deprecate-string-arg-schemas',\n for: 'ember-data',\n until: '5.0',\n since: {\n enabled: '4.5',\n available: '4.5'\n }\n });\n modelName = identifier;\n } else {\n modelName = identifier.type;\n }\n attributes = this._attributesDefCache[modelName];\n if (attributes === undefined) {\n let modelClass = this.store.modelFor(modelName);\n let attributeMap = get(modelClass, 'attributes');\n attributes = Object.create(null);\n attributeMap.forEach((meta, name) => attributes[name] = meta);\n this._attributesDefCache[modelName] = attributes;\n }\n return attributes;\n }\n\n // Following the existing RD implementation\n relationshipsDefinitionFor(identifier) {\n let modelName, relationships;\n if (true /* DEPRECATE_STRING_ARG_SCHEMAS */ && typeof identifier === 'string') {\n deprecate(`relationshipsDefinitionFor expects either a record identifier or an argument of shape { type: string }, received a string.`, false, {\n id: 'ember-data:deprecate-string-arg-schemas',\n for: 'ember-data',\n until: '5.0',\n since: {\n enabled: '4.5',\n available: '4.5'\n }\n });\n modelName = identifier;\n } else {\n modelName = identifier.type;\n }\n relationships = this._relationshipsDefCache[modelName];\n if (relationships === undefined) {\n let modelClass = this.store.modelFor(modelName);\n relationships = get(modelClass, 'relationshipsObject') || null;\n this._relationshipsDefCache[modelName] = relationships;\n }\n return relationships;\n }\n doesTypeExist(modelName) {\n let normalizedModelName = normalizeModelName(modelName);\n let factory = getModelFactory(this.store, this.store._modelFactoryCache, normalizedModelName);\n return factory !== null;\n }\n}\nexport function getModelFactory(store, cache, normalizedModelName) {\n let factory = cache[normalizedModelName];\n if (!factory) {\n let owner = getOwner(store);\n factory = owner.factoryFor(`model:${normalizedModelName}`);\n if (!factory && true /* HAS_MODEL_PACKAGE */) {\n //Support looking up mixins as base types for polymorphic relationships\n factory = _modelForMixin(store, normalizedModelName);\n }\n if (!factory) {\n // we don't cache misses in case someone wants to register a missing model\n return null;\n }\n let klass = factory.class;\n if (klass.isModel) {\n let hasOwnModelNameSet = klass.modelName && Object.prototype.hasOwnProperty.call(klass, 'modelName');\n if (!hasOwnModelNameSet) {\n Object.defineProperty(klass, 'modelName', {\n value: normalizedModelName\n });\n }\n }\n cache[normalizedModelName] = factory;\n }\n return factory;\n}","/**\n @module @ember-data/store\n */\nimport { getOwner, setOwner } from '@ember/application';\nimport { assert, deprecate } from '@ember/debug';\nimport { _backburner as emberBackburner } from '@ember/runloop';\nimport Service from '@ember/service';\nimport { registerWaiter, unregisterWaiter } from '@ember/test';\nimport { DEBUG } from '@glimmer/env';\nimport { importSync } from '@embroider/macros';\nimport { reject, resolve } from 'rsvp';\nimport edBackburner from './backburner';\nimport coerceId, { ensureStringId } from './coerce-id';\nimport FetchManager, { SaveOp } from './fetch-manager';\nimport { _findAll, _query, _queryRecord } from './finders';\nimport { IdentifierCache } from './identifier-cache';\nimport { InstanceCache, storeFor, StoreMap } from './instance-cache';\nimport { internalModelFactoryFor, peekRecordIdentifier, recordIdentifierFor, setRecordIdentifier } from './internal-model-factory';\nimport { getShimClass } from './model/shim-model-class';\nimport normalizeModelName from './normalize-model-name';\nimport { promiseArray, promiseObject } from './promise-proxies';\nimport RecordArrayManager from './record-array-manager';\nimport { setRecordDataFor } from './record-data-for';\nimport NotificationManager from './record-notification-manager';\nimport { DSModelSchemaDefinitionService, getModelFactory } from './schema-definition-service';\nimport constructResource from './utils/construct-resource';\nimport promiseRecord from './utils/promise-record';\nexport { storeFor };\nlet _RecordData;\nfunction freeze(obj) {\n if (typeof Object.freeze === 'function') {\n return Object.freeze(obj);\n }\n return obj;\n}\n/**\n The store contains all of the data for records loaded from the server.\n It is also responsible for creating instances of `Model` that wrap\n the individual data for a record, so that they can be bound to in your\n Handlebars templates.\n\n Define your application's store like this:\n\n ```app/services/store.js\n import Store from '@ember-data/store';\n\n export default class MyStore extends Store {}\n ```\n\n Most Ember.js applications will only have a single `Store` that is\n automatically created by their `Ember.Application`.\n\n You can retrieve models from the store in several ways. To retrieve a record\n for a specific id, use `Store`'s `findRecord()` method:\n\n ```javascript\n store.findRecord('person', 123).then(function (person) {\n });\n ```\n\n By default, the store will talk to your backend using a standard\n REST mechanism. You can customize how the store talks to your\n backend by specifying a custom adapter:\n\n ```app/adapters/application.js\n import Adapter from '@ember-data/adapter';\n\n export default class ApplicationAdapter extends Adapter {\n }\n ```\n\n You can learn more about writing a custom adapter by reading the `Adapter`\n documentation.\n\n ### Store createRecord() vs. push() vs. pushPayload()\n\n The store provides multiple ways to create new record objects. They have\n some subtle differences in their use which are detailed below:\n\n [createRecord](../methods/createRecord?anchor=createRecord) is used for creating new\n records on the client side. This will return a new record in the\n `created.uncommitted` state. In order to persist this record to the\n backend, you will need to call `record.save()`.\n\n [push](../methods/push?anchor=push) is used to notify Ember Data's store of new or\n updated records that exist in the backend. This will return a record\n in the `loaded.saved` state. The primary use-case for `store#push` is\n to notify Ember Data about record updates (full or partial) that happen\n outside of the normal adapter methods (for example\n [SSE](http://dev.w3.org/html5/eventsource/) or [Web\n Sockets](http://www.w3.org/TR/2009/WD-websockets-20091222/)).\n\n [pushPayload](../methods/pushPayload?anchor=pushPayload) is a convenience wrapper for\n `store#push` that will deserialize payloads if the\n Serializer implements a `pushPayload` method.\n\n Note: When creating a new record using any of the above methods\n Ember Data will update `RecordArray`s such as those returned by\n `store#peekAll()` or `store#findAll()`. This means any\n data bindings or computed properties that depend on the RecordArray\n will automatically be synced to include the new or updated record\n values.\n\n @main @ember-data/store\n @class Store\n @public\n @extends Ember.Service\n*/\n\nclass Store extends Service {\n /**\n * Ember Data uses several specialized micro-queues for organizing\n and coalescing similar async work.\n These queues are currently controlled by a flush scheduled into\n ember-data's custom backburner instance.\n *\n * EmberData specific backburner instance\n * @property _backburner\n * @private\n */\n\n // DEBUG-only properties\n\n /**\n @method init\n @private\n */\n constructor() {\n super(...arguments);\n\n /**\n * Provides access to the IdentifierCache instance\n * for this store.\n *\n * The IdentifierCache can be used to generate or\n * retrieve a stable unique identifier for any resource.\n *\n * @property {IdentifierCache} identifierCache\n * @public\n */\n this.identifierCache = new IdentifierCache();\n\n // private but maybe useful to be here, somewhat intimate\n this.recordArrayManager = new RecordArrayManager({\n store: this\n });\n\n // private, TODO consider taking public as the instance is public to instantiateRecord anyway\n this._notificationManager = new NotificationManager(this);\n\n // private\n this._fetchManager = new FetchManager(this);\n this._instanceCache = new InstanceCache(this);\n this._adapterCache = Object.create(null);\n this._serializerCache = Object.create(null);\n this._modelFactoryCache = Object.create(null);\n\n // private\n // TODO we should find a path to something simpler than backburner\n this._backburner = edBackburner;\n if (DEBUG) {\n if (this.generateStackTracesForTrackedRequests === undefined) {\n this.generateStackTracesForTrackedRequests = false;\n }\n this._trackedAsyncRequests = [];\n this._trackAsyncRequestStart = label => {\n let trace = 'set `store.generateStackTracesForTrackedRequests = true;` to get a detailed trace for where this request originated';\n if (this.generateStackTracesForTrackedRequests) {\n try {\n throw new Error(`EmberData TrackedRequest: ${label}`);\n } catch (e) {\n trace = e;\n }\n }\n let token = freeze({\n label,\n trace\n });\n this._trackedAsyncRequests.push(token);\n return token;\n };\n this._trackAsyncRequestEnd = token => {\n let index = this._trackedAsyncRequests.indexOf(token);\n if (index === -1) {\n throw new Error(`Attempted to end tracking for the following request but it was not being tracked:\\n${token}`);\n }\n this._trackedAsyncRequests.splice(index, 1);\n };\n this.__asyncWaiter = () => {\n let tracked = this._trackedAsyncRequests;\n return tracked.length === 0;\n };\n registerWaiter(this.__asyncWaiter);\n }\n }\n getRequestStateService() {\n return this._fetchManager.requestCache;\n }\n instantiateRecord(identifier, createRecordArgs, recordDataFor, notificationManager) {\n if (true /* HAS_MODEL_PACKAGE */) {\n let modelName = identifier.type;\n let store = this;\n let internalModel = this._instanceCache._internalModelForResource(identifier);\n let createOptions = {\n _internalModel: internalModel,\n // TODO deprecate allowing unknown args setting\n _createProps: createRecordArgs,\n // TODO @deprecate consider deprecating accessing record properties during init which the below is necessary for\n _secretInit: record => {\n setRecordIdentifier(record, identifier);\n StoreMap.set(record, store);\n setRecordDataFor(record, internalModel._recordData);\n },\n container: null // necessary hack for setOwner?\n };\n\n // ensure that `getOwner(this)` works inside a model instance\n setOwner(createOptions, getOwner(this));\n delete createOptions.container;\n // TODO this needs to not use the private property here to get modelFactoryCache so as to not break interop\n return getModelFactory(this, this._modelFactoryCache, modelName).create(createOptions);\n }\n assert(`You must implement the store's instantiateRecord hook for your custom model class.`);\n }\n teardownRecord(record) {\n if (true /* HAS_MODEL_PACKAGE */) {\n assert(`expected to receive an instance of DSModel. If using a custom model make sure you implement teardownRecord`, 'destroy' in record);\n record.destroy();\n } else {\n assert(`You must implement the store's teardownRecord hook for your custom models`);\n }\n }\n getSchemaDefinitionService() {\n if (true /* HAS_MODEL_PACKAGE */ && !this._schemaDefinitionService) {\n this._schemaDefinitionService = new DSModelSchemaDefinitionService(this);\n }\n assert(`You must registerSchemaDefinitionService with the store to use custom model classes`, this._schemaDefinitionService);\n return this._schemaDefinitionService;\n }\n registerSchemaDefinitionService(schema) {\n this._schemaDefinitionService = schema;\n }\n\n /**\n Returns the schema for a particular `modelName`.\n When used with Model from @ember-data/model the return is the model class,\n but this is not guaranteed.\n The class of a model might be useful if you want to get a list of all the\n relationship names of the model, see\n [`relationshipNames`](/ember-data/release/classes/Model?anchor=relationshipNames)\n for example.\n @method modelFor\n @public\n @param {String} modelName\n @return {subclass of Model | ShimModelClass}\n */\n // TODO @deprecate in favor of schema APIs, requires adapter/serializer overhaul or replacement\n modelFor(modelName) {\n if (DEBUG) {\n assertDestroyedStoreOnly(this, 'modelFor');\n }\n assert(`You need to pass a model name to the store's modelFor method`, modelName);\n assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string');\n if (true /* HAS_MODEL_PACKAGE */) {\n let normalizedModelName = normalizeModelName(modelName);\n // TODO this is safe only because\n // apps would be horribly broken if the schema service were using DS_MODEL but not using DS_MODEL's schema service.\n // it is potentially a mistake for the RFC to have not enabled chaining these services, though highlander rule is nice.\n // what ember-m3 did via private API to allow both worlds to interop would be much much harder using this.\n let maybeFactory = getModelFactory(this, this._modelFactoryCache, normalizedModelName);\n\n // for factorFor factory/class split\n let klass = maybeFactory && maybeFactory.class ? maybeFactory.class : maybeFactory;\n if (!klass || !klass.isModel) {\n assert(`No model was found for '${modelName}' and no schema handles the type`, this.getSchemaDefinitionService().doesTypeExist(modelName));\n return getShimClass(this, modelName);\n } else {\n // TODO @deprecate ever returning the klass, always return the shim\n return klass;\n }\n }\n assert(`No model was found for '${modelName}' and no schema handles the type`, this.getSchemaDefinitionService().doesTypeExist(modelName));\n return getShimClass(this, modelName);\n }\n\n /**\n Create a new record in the current store. The properties passed\n to this method are set on the newly created record.\n To create a new instance of a `Post`:\n ```js\n store.createRecord('post', {\n title: 'Ember is awesome!'\n });\n ```\n To create a new instance of a `Post` that has a relationship with a `User` record:\n ```js\n let user = this.store.peekRecord('user', 1);\n store.createRecord('post', {\n title: 'Ember is awesome!',\n user: user\n });\n ```\n @method createRecord\n @public\n @param {String} modelName\n @param {Object} inputProperties a hash of properties to set on the\n newly created record.\n @return {Model} record\n */\n createRecord(modelName, inputProperties) {\n if (DEBUG) {\n assertDestroyingStore(this, 'createRecord');\n }\n assert(`You need to pass a model name to the store's createRecord method`, modelName);\n assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string');\n\n // This is wrapped in a `run.join` so that in test environments users do not need to manually wrap\n // calls to `createRecord`. The run loop usage here is because we batch the joining and updating\n // of record-arrays via ember's run loop, not our own.\n //\n // to remove this, we would need to move to a new `async` API.\n return emberBackburner.join(() => {\n return this._backburner.join(() => {\n let normalizedModelName = normalizeModelName(modelName);\n let properties = {\n ...inputProperties\n };\n\n // If the passed properties do not include a primary key,\n // give the adapter an opportunity to generate one. Typically,\n // client-side ID generators will use something like uuid.js\n // to avoid conflicts.\n\n if (properties.id === null || properties.id === undefined) {\n let adapter = this.adapterFor(modelName);\n if (adapter && adapter.generateIdForRecord) {\n properties.id = adapter.generateIdForRecord(this, modelName, properties);\n } else {\n properties.id = null;\n }\n }\n\n // Coerce ID to a string\n properties.id = coerceId(properties.id);\n const factory = internalModelFactoryFor(this);\n const internalModel = factory.build({\n type: normalizedModelName,\n id: properties.id\n });\n const {\n identifier\n } = internalModel;\n this._instanceCache.getRecordData(identifier).clientDidCreate();\n this.recordArrayManager.recordDidChange(identifier);\n return this._instanceCache.getRecord(identifier, properties);\n });\n });\n }\n\n /**\n For symmetry, a record can be deleted via the store.\n Example\n ```javascript\n let post = store.createRecord('post', {\n title: 'Ember is awesome!'\n });\n store.deleteRecord(post);\n ```\n @method deleteRecord\n @public\n @param {Model} record\n */\n deleteRecord(record) {\n if (DEBUG) {\n assertDestroyingStore(this, 'deleteRecord');\n }\n this._backburner.join(() => {\n let identifier = peekRecordIdentifier(record);\n if (identifier) {\n let internalModel = internalModelFactoryFor(this).peek(identifier);\n if (internalModel) {\n internalModel.deleteRecord();\n }\n }\n });\n }\n\n /**\n For symmetry, a record can be unloaded via the store.\n This will cause the record to be destroyed and freed up for garbage collection.\n Example\n ```javascript\n store.findRecord('post', 1).then(function(post) {\n store.unloadRecord(post);\n });\n ```\n @method unloadRecord\n @public\n @param {Model} record\n */\n unloadRecord(record) {\n if (DEBUG) {\n assertDestroyingStore(this, 'unloadRecord');\n }\n let identifier = peekRecordIdentifier(record);\n if (identifier) {\n let internalModel = internalModelFactoryFor(this).peek(identifier);\n if (internalModel) {\n internalModel.unloadRecord();\n }\n }\n }\n\n /**\n @method find\n @param {String} modelName\n @param {String|Integer} id\n @param {Object} options\n @return {Promise} promise\n @deprecated\n @private\n */\n find(modelName, id, options) {\n if (DEBUG) {\n assertDestroyingStore(this, 'find');\n }\n // The default `model` hook in Route calls `find(modelName, id)`,\n // that's why we have to keep this method around even though `findRecord` is\n // the public way to get a record by modelName and id.\n assert(`Using store.find(type) has been removed. Use store.findAll(modelName) to retrieve all records for a given type.`, arguments.length !== 1);\n assert(`Calling store.find(modelName, id, { preload: preload }) is no longer supported. Use store.findRecord(modelName, id, { preload: preload }) instead.`, !options);\n assert(`You need to pass the model name and id to the store's find method`, arguments.length === 2);\n assert(`You cannot pass '${id}' as id to the store's find method`, typeof id === 'string' || typeof id === 'number');\n assert(`Calling store.find() with a query object is no longer supported. Use store.query() instead.`, typeof id !== 'object');\n assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string');\n if (true /* DEPRECATE_STORE_FIND */) {\n deprecate(`Using store.find is deprecated, use store.findRecord instead. Likely this means you are relying on the implicit store fetching behavior of routes unknowingly.`, false, {\n id: 'ember-data:deprecate-store-find',\n since: {\n available: '4.5',\n enabled: '4.5'\n },\n for: 'ember-data',\n until: '5.0'\n });\n return this.findRecord(modelName, id);\n }\n assert(`store.find has been removed. Use store.findRecord instead.`);\n }\n\n /**\n This method returns a record for a given identifier or type and id combination.\n The `findRecord` method will always resolve its promise with the same\n object for a given identifier or type and `id`.\n The `findRecord` method will always return a **promise** that will be\n resolved with the record.\n **Example 1**\n ```app/routes/post.js\n import Route from '@ember/routing/route';\n export default class PostRoute extends Route {\n model({ post_id }) {\n return this.store.findRecord('post', post_id);\n }\n }\n ```\n **Example 2**\n `findRecord` can be called with a single identifier argument instead of the combination\n of `type` (modelName) and `id` as separate arguments. You may recognize this combo as\n the typical pairing from [JSON:API](https://jsonapi.org/format/#document-resource-object-identification)\n ```app/routes/post.js\n import Route from '@ember/routing/route';\n export default class PostRoute extends Route {\n model({ post_id: id }) {\n return this.store.findRecord({ type: 'post', id });\n }\n }\n ```\n **Example 3**\n If you have previously received an lid via an Identifier for this record, and the record\n has already been assigned an id, you can find the record again using just the lid.\n ```app/routes/post.js\n store.findRecord({ lid });\n ```\n If the record is not yet available, the store will ask the adapter's `findRecord`\n method to retrieve and supply the necessary data. If the record is already present\n in the store, it depends on the reload behavior _when_ the returned promise\n resolves.\n ### Preloading\n You can optionally `preload` specific attributes and relationships that you know of\n by passing them via the passed `options`.\n For example, if your Ember route looks like `/posts/1/comments/2` and your API route\n for the comment also looks like `/posts/1/comments/2` if you want to fetch the comment\n without also fetching the post you can pass in the post to the `findRecord` call:\n ```app/routes/post-comments.js\n import Route from '@ember/routing/route';\n export default class PostRoute extends Route {\n model({ post_id, comment_id: id }) {\n return this.store.findRecord({ type: 'comment', id, { preload: { post: post_id }} });\n }\n }\n ```\n In your adapter you can then access this id without triggering a network request via the\n snapshot:\n ```app/adapters/application.js\n import EmberObject from '@ember/object';\n export default class Adapter extends EmberObject {\n findRecord(store, schema, id, snapshot) {\n let type = schema.modelName;\n if (type === 'comment')\n let postId = snapshot.belongsTo('post', { id: true });\n return fetch(`./posts/${postId}/comments/${id}`)\n .then(response => response.json())\n }\n }\n }\n ```\n This could also be achieved by supplying the post id to the adapter via the adapterOptions\n property on the options hash.\n ```app/routes/post-comments.js\n import Route from '@ember/routing/route';\n export default class PostRoute extends Route {\n model({ post_id, comment_id: id }) {\n return this.store.findRecord({ type: 'comment', id, { adapterOptions: { post: post_id }} });\n }\n }\n ```\n ```app/adapters/application.js\n import EmberObject from '@ember/object';\n export default class Adapter extends EmberObject {\n findRecord(store, schema, id, snapshot) {\n let type = schema.modelName;\n if (type === 'comment')\n let postId = snapshot.adapterOptions.post;\n return fetch(`./posts/${postId}/comments/${id}`)\n .then(response => response.json())\n }\n }\n }\n ```\n If you have access to the post model you can also pass the model itself to preload:\n ```javascript\n let post = await store.findRecord('post', 1);\n let comment = await store.findRecord('comment', 2, { post: myPostModel });\n ```\n ### Reloading\n The reload behavior is configured either via the passed `options` hash or\n the result of the adapter's `shouldReloadRecord`.\n If `{ reload: true }` is passed or `adapter.shouldReloadRecord` evaluates\n to `true`, then the returned promise resolves once the adapter returns\n data, regardless if the requested record is already in the store:\n ```js\n store.push({\n data: {\n id: 1,\n type: 'post',\n revision: 1\n }\n });\n // adapter#findRecord resolves with\n // [\n // {\n // id: 1,\n // type: 'post',\n // revision: 2\n // }\n // ]\n store.findRecord('post', 1, { reload: true }).then(function(post) {\n post.get('revision'); // 2\n });\n ```\n If no reload is indicated via the above mentioned ways, then the promise\n immediately resolves with the cached version in the store.\n ### Background Reloading\n Optionally, if `adapter.shouldBackgroundReloadRecord` evaluates to `true`,\n then a background reload is started, which updates the records' data, once\n it is available:\n ```js\n // app/adapters/post.js\n import ApplicationAdapter from \"./application\";\n export default class PostAdapter extends ApplicationAdapter {\n shouldReloadRecord(store, snapshot) {\n return false;\n },\n shouldBackgroundReloadRecord(store, snapshot) {\n return true;\n }\n });\n // ...\n store.push({\n data: {\n id: 1,\n type: 'post',\n revision: 1\n }\n });\n let blogPost = store.findRecord('post', 1).then(function(post) {\n post.get('revision'); // 1\n });\n // later, once adapter#findRecord resolved with\n // [\n // {\n // id: 1,\n // type: 'post',\n // revision: 2\n // }\n // ]\n blogPost.get('revision'); // 2\n ```\n If you would like to force or prevent background reloading, you can set a\n boolean value for `backgroundReload` in the options object for\n `findRecord`.\n ```app/routes/post/edit.js\n import Route from '@ember/routing/route';\n export default class PostEditRoute extends Route {\n model(params) {\n return this.store.findRecord('post', params.post_id, { backgroundReload: false });\n }\n }\n ```\n If you pass an object on the `adapterOptions` property of the options\n argument it will be passed to your adapter via the snapshot\n ```app/routes/post/edit.js\n import Route from '@ember/routing/route';\n export default class PostEditRoute extends Route {\n model(params) {\n return this.store.findRecord('post', params.post_id, {\n adapterOptions: { subscribe: false }\n });\n }\n }\n ```\n ```app/adapters/post.js\n import MyCustomAdapter from './custom-adapter';\n export default class PostAdapter extends MyCustomAdapter {\n findRecord(store, type, id, snapshot) {\n if (snapshot.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n }\n ```\n See [peekRecord](../methods/peekRecord?anchor=peekRecord) to get the cached version of a record.\n ### Retrieving Related Model Records\n If you use an adapter such as Ember's default\n [`JSONAPIAdapter`](/ember-data/release/classes/JSONAPIAdapter)\n that supports the [JSON API specification](http://jsonapi.org/) and if your server\n endpoint supports the use of an\n ['include' query parameter](http://jsonapi.org/format/#fetching-includes),\n you can use `findRecord()` or `findAll()` to automatically retrieve additional records related to\n the one you request by supplying an `include` parameter in the `options` object.\n For example, given a `post` model that has a `hasMany` relationship with a `comment`\n model, when we retrieve a specific post we can have the server also return that post's\n comments in the same request:\n ```app/routes/post.js\n import Route from '@ember/routing/route';\n export default class PostRoute extends Route {\n model(params) {\n return this.store.findRecord('post', params.post_id, { include: 'comments' });\n }\n }\n ```\n ```app/adapters/application.js\n import EmberObject from '@ember/object';\n export default class Adapter extends EmberObject {\n findRecord(store, schema, id, snapshot) {\n let type = schema.modelName;\n if (type === 'post')\n let includes = snapshot.adapterOptions.include;\n return fetch(`./posts/${postId}?include=${includes}`)\n .then(response => response.json())\n }\n }\n }\n ```\n In this case, the post's comments would then be available in your template as\n `model.comments`.\n Multiple relationships can be requested using an `include` parameter consisting of a\n comma-separated list (without white-space) while nested relationships can be specified\n using a dot-separated sequence of relationship names. So to request both the post's\n comments and the authors of those comments the request would look like this:\n ```app/routes/post.js\n import Route from '@ember/routing/route';\n export default class PostRoute extends Route {\n model(params) {\n return this.store.findRecord('post', params.post_id, { include: 'comments,comments.author' });\n }\n }\n ```\n ### Retrieving Specific Fields by Type\n If your server endpoint supports the use of a ['fields' query parameter](https://jsonapi.org/format/#fetching-sparse-fieldsets),\n you can use pass those fields through to your server. At this point in time, this requires a few manual steps on your part.\n 1. Implement `buildQuery` in your adapter.\n ```app/adapters/application.js\n buildQuery(snapshot) {\n let query = super.buildQuery(...arguments);\n let { fields } = snapshot.adapterOptions;\n if (fields) {\n query.fields = fields;\n }\n return query;\n }\n ```\n 2. Then pass through the applicable fields to your `findRecord` request.\n Given a `post` model with attributes body, title, publishDate and meta, you can retrieve a filtered list of attributes.\n ```app/routes/post.js\n import Route from '@ember/routing/route';\n export default Route.extend({\n model(params) {\n return this.store.findRecord('post', params.post_id, { adapterOptions: { fields: { post: 'body,title' } });\n }\n });\n ```\n Moreover, you can filter attributes on related models as well. If a `post` has a `belongsTo` relationship to a user,\n just include the relationship key and attributes.\n ```app/routes/post.js\n import Route from '@ember/routing/route';\n export default Route.extend({\n model(params) {\n return this.store.findRecord('post', params.post_id, { adapterOptions: { fields: { post: 'body,title', user: 'name,email' } });\n }\n });\n ```\n @since 1.13.0\n @method findRecord\n @public\n @param {String|object} modelName - either a string representing the modelName or a ResourceIdentifier object containing both the type (a string) and the id (a string) for the record or an lid (a string) of an existing record\n @param {(String|Integer|Object)} id - optional object with options for the request only if the first param is a ResourceIdentifier, else the string id of the record to be retrieved\n @param {Object} [options] - if the first param is a string this will be the optional options for the request. See examples for available options.\n @return {Promise} promise\n */\n\n findRecord(resource, id, options) {\n if (DEBUG) {\n assertDestroyingStore(this, 'findRecord');\n }\n assert(`You need to pass a modelName or resource identifier as the first argument to the store's findRecord method`, resource);\n if (isMaybeIdentifier(resource)) {\n options = id;\n } else {\n assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${resource}`, typeof resource === 'string');\n const type = normalizeModelName(resource);\n const normalizedId = ensureStringId(id);\n resource = constructResource(type, normalizedId);\n }\n const internalModel = internalModelFactoryFor(this).lookup(resource);\n const {\n identifier\n } = internalModel;\n let promise;\n options = options || {};\n\n // if not loaded start loading\n if (!internalModel.isLoaded) {\n promise = this._instanceCache._fetchDataIfNeededForIdentifier(identifier, options);\n\n // Refetch if the reload option is passed\n } else if (options.reload) {\n assertIdentifierHasId(identifier);\n promise = this._fetchManager.scheduleFetch(identifier, options);\n } else {\n let snapshot = this._instanceCache.createSnapshot(identifier, options);\n let adapter = this.adapterFor(identifier.type);\n\n // Refetch the record if the adapter thinks the record is stale\n if (typeof options.reload === 'undefined' && adapter.shouldReloadRecord && adapter.shouldReloadRecord(this, snapshot)) {\n assertIdentifierHasId(identifier);\n promise = this._fetchManager.scheduleFetch(identifier, options);\n } else {\n // Trigger the background refetch if backgroundReload option is passed\n if (options.backgroundReload !== false && (options.backgroundReload || !adapter.shouldBackgroundReloadRecord || adapter.shouldBackgroundReloadRecord(this, snapshot))) {\n assertIdentifierHasId(identifier);\n this._fetchManager.scheduleFetch(identifier, options);\n }\n\n // Return the cached record\n promise = resolve(identifier);\n }\n }\n return promiseRecord(this, promise, `DS: Store#findRecord ${identifier}`);\n }\n\n /**\n Get the reference for the specified record.\n Example\n ```javascript\n let userRef = store.getReference('user', 1);\n // check if the user is loaded\n let isLoaded = userRef.value() !== null;\n // get the record of the reference (null if not yet available)\n let user = userRef.value();\n // get the identifier of the reference\n if (userRef.remoteType() === 'id') {\n let id = userRef.id();\n }\n // load user (via store.find)\n userRef.load().then(...)\n // or trigger a reload\n userRef.reload().then(...)\n // provide data for reference\n userRef.push({ id: 1, username: '@user' }).then(function(user) {\n userRef.value() === user;\n });\n ```\n @method getReference\n @public\n @param {String|object} resource - modelName (string) or Identifier (object)\n @param {String|Integer} id\n @since 2.5.0\n @return {RecordReference}\n */\n // TODO @deprecate getReference (and references generally)\n getReference(resource, id) {\n if (DEBUG) {\n assertDestroyingStore(this, 'getReference');\n }\n let resourceIdentifier;\n if (arguments.length === 1 && isMaybeIdentifier(resource)) {\n resourceIdentifier = resource;\n } else {\n const type = normalizeModelName(resource);\n const normalizedId = ensureStringId(id);\n resourceIdentifier = constructResource(type, normalizedId);\n }\n assert('getReference expected to receive either a resource identifier or type and id as arguments', isMaybeIdentifier(resourceIdentifier));\n let identifier = this.identifierCache.getOrCreateRecordIdentifier(resourceIdentifier);\n return this._instanceCache.getReference(identifier);\n }\n\n /**\n Get a record by a given type and ID without triggering a fetch.\n This method will synchronously return the record if it is available in the store,\n otherwise it will return `null`. A record is available if it has been fetched earlier, or\n pushed manually into the store.\n See [findRecord](../methods/findRecord?anchor=findRecord) if you would like to request this record from the backend.\n _Note: This is a synchronous method and does not return a promise._\n **Example 1**\n ```js\n let post = store.peekRecord('post', 1);\n post.id; // 1\n ```\n `peekRecord` can be called with a single identifier argument instead of the combination\n of `type` (modelName) and `id` as separate arguments. You may recognize this combo as\n the typical pairing from [JSON:API](https://jsonapi.org/format/#document-resource-object-identification)\n **Example 2**\n ```js\n let post = store.peekRecord({ type: 'post', id });\n post.id; // 1\n ```\n If you have previously received an lid from an Identifier for this record, you can lookup the record again using\n just the lid.\n **Example 3**\n ```js\n let post = store.peekRecord({ lid });\n post.id; // 1\n ```\n @since 1.13.0\n @method peekRecord\n @public\n @param {String|object} modelName - either a string representing the modelName or a ResourceIdentifier object containing both the type (a string) and the id (a string) for the record or an lid (a string) of an existing record\n @param {String|Integer} id - optional only if the first param is a ResourceIdentifier, else the string id of the record to be retrieved.\n @return {Model|null} record\n */\n\n peekRecord(identifier, id) {\n if (arguments.length === 1 && isMaybeIdentifier(identifier)) {\n const stableIdentifier = this.identifierCache.peekRecordIdentifier(identifier);\n const internalModel = stableIdentifier && internalModelFactoryFor(this).peek(stableIdentifier);\n // TODO come up with a better mechanism for determining if we have data and could peek.\n // this is basically an \"are we not empty\" query.\n return internalModel && internalModel.isLoaded ? this._instanceCache.getRecord(stableIdentifier) : null;\n }\n if (DEBUG) {\n assertDestroyingStore(this, 'peekRecord');\n }\n assert(`You need to pass a model name to the store's peekRecord method`, identifier);\n assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${identifier}`, typeof identifier === 'string');\n const type = normalizeModelName(identifier);\n const normalizedId = ensureStringId(id);\n const resource = {\n type,\n id: normalizedId\n };\n const stableIdentifier = this.identifierCache.peekRecordIdentifier(resource);\n const internalModel = stableIdentifier && internalModelFactoryFor(this).peek(stableIdentifier);\n return internalModel && internalModel.isLoaded ? this._instanceCache.getRecord(stableIdentifier) : null;\n }\n\n /**\n This method returns true if a record for a given modelName and id is already\n loaded in the store. Use this function to know beforehand if a findRecord()\n will result in a request or that it will be a cache hit.\n Example\n ```javascript\n store.hasRecordForId('post', 1); // false\n store.findRecord('post', 1).then(function() {\n store.hasRecordForId('post', 1); // true\n });\n ```\n @method hasRecordForId\n @public\n @param {String} modelName\n @param {(String|Integer)} id\n @return {Boolean}\n */\n hasRecordForId(modelName, id) {\n if (true /* DEPRECATE_HAS_RECORD */) {\n deprecate(`store.hasRecordForId has been deprecated in favor of store.peekRecord`, false, {\n id: 'ember-data:deprecate-has-record-for-id',\n since: {\n available: '4.5',\n enabled: '4.5'\n },\n until: '5.0',\n for: 'ember-data'\n });\n if (DEBUG) {\n assertDestroyingStore(this, 'hasRecordForId');\n }\n assert(`You need to pass a model name to the store's hasRecordForId method`, modelName);\n assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string');\n const type = normalizeModelName(modelName);\n const trueId = ensureStringId(id);\n const resource = {\n type,\n id: trueId\n };\n const identifier = this.identifierCache.peekRecordIdentifier(resource);\n const internalModel = identifier && internalModelFactoryFor(this).peek(identifier);\n return !!internalModel && internalModel.isLoaded;\n }\n assert(`store.hasRecordForId has been removed`);\n }\n\n /**\n This method delegates a query to the adapter. This is the one place where\n adapter-level semantics are exposed to the application.\n Each time this method is called a new request is made through the adapter.\n Exposing queries this way seems preferable to creating an abstract query\n language for all server-side queries, and then require all adapters to\n implement them.\n ---\n If you do something like this:\n ```javascript\n store.query('person', { page: 1 });\n ```\n The request made to the server will look something like this:\n ```\n GET \"/api/v1/person?page=1\"\n ```\n ---\n If you do something like this:\n ```javascript\n store.query('person', { ids: [1, 2, 3] });\n ```\n The request made to the server will look something like this:\n ```\n GET \"/api/v1/person?ids%5B%5D=1&ids%5B%5D=2&ids%5B%5D=3\"\n decoded: \"/api/v1/person?ids[]=1&ids[]=2&ids[]=3\"\n ```\n This method returns a promise, which is resolved with an\n [`AdapterPopulatedRecordArray`](/ember-data/release/classes/AdapterPopulatedRecordArray)\n once the server returns.\n @since 1.13.0\n @method query\n @public\n @param {String} modelName\n @param {any} query an opaque query to be used by the adapter\n @param {Object} options optional, may include `adapterOptions` hash which will be passed to adapter.query\n @return {Promise} promise\n */\n query(modelName, query, options) {\n if (DEBUG) {\n assertDestroyingStore(this, 'query');\n }\n assert(`You need to pass a model name to the store's query method`, modelName);\n assert(`You need to pass a query hash to the store's query method`, query);\n assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string');\n let adapterOptionsWrapper = {};\n if (options && options.adapterOptions) {\n adapterOptionsWrapper.adapterOptions = options.adapterOptions;\n }\n let recordArray = options?._recordArray || null;\n let normalizedModelName = normalizeModelName(modelName);\n let adapter = this.adapterFor(normalizedModelName);\n assert(`You tried to load a query but you have no adapter (for ${modelName})`, adapter);\n assert(`You tried to load a query but your adapter does not implement 'query'`, typeof adapter.query === 'function');\n let queryPromise = _query(adapter, this, normalizedModelName, query, recordArray, adapterOptionsWrapper);\n return promiseArray(queryPromise);\n }\n\n /**\n This method makes a request for one record, where the `id` is not known\n beforehand (if the `id` is known, use [`findRecord`](../methods/findRecord?anchor=findRecord)\n instead).\n This method can be used when it is certain that the server will return a\n single object for the primary data.\n Each time this method is called a new request is made through the adapter.\n Let's assume our API provides an endpoint for the currently logged in user\n via:\n ```\n // GET /api/current_user\n {\n user: {\n id: 1234,\n username: 'admin'\n }\n }\n ```\n Since the specific `id` of the `user` is not known beforehand, we can use\n `queryRecord` to get the user:\n ```javascript\n store.queryRecord('user', {}).then(function(user) {\n let username = user.get('username');\n console.log(`Currently logged in as ${username}`);\n });\n ```\n The request is made through the adapters' `queryRecord`:\n ```app/adapters/user.js\n import Adapter from '@ember-data/adapter';\n import $ from 'jquery';\n export default class UserAdapter extends Adapter {\n queryRecord(modelName, query) {\n return $.getJSON('/api/current_user');\n }\n }\n ```\n Note: the primary use case for `store.queryRecord` is when a single record\n is queried and the `id` is not known beforehand. In all other cases\n `store.query` and using the first item of the array is likely the preferred\n way:\n ```\n // GET /users?username=unique\n {\n data: [{\n id: 1234,\n type: 'user',\n attributes: {\n username: \"unique\"\n }\n }]\n }\n ```\n ```javascript\n store.query('user', { username: 'unique' }).then(function(users) {\n return users.get('firstObject');\n }).then(function(user) {\n let id = user.get('id');\n });\n ```\n This method returns a promise, which resolves with the found record.\n If the adapter returns no data for the primary data of the payload, then\n `queryRecord` resolves with `null`:\n ```\n // GET /users?username=unique\n {\n data: null\n }\n ```\n ```javascript\n store.queryRecord('user', { username: 'unique' }).then(function(user) {\n console.log(user); // null\n });\n ```\n @since 1.13.0\n @method queryRecord\n @public\n @param {String} modelName\n @param {any} query an opaque query to be used by the adapter\n @param {Object} options optional, may include `adapterOptions` hash which will be passed to adapter.queryRecord\n @return {Promise} promise which resolves with the found record or `null`\n */\n queryRecord(modelName, query, options) {\n if (DEBUG) {\n assertDestroyingStore(this, 'queryRecord');\n }\n assert(`You need to pass a model name to the store's queryRecord method`, modelName);\n assert(`You need to pass a query hash to the store's queryRecord method`, query);\n assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string');\n let normalizedModelName = normalizeModelName(modelName);\n let adapter = this.adapterFor(normalizedModelName);\n let adapterOptionsWrapper = {};\n if (options && options.adapterOptions) {\n adapterOptionsWrapper.adapterOptions = options.adapterOptions;\n }\n assert(`You tried to make a query but you have no adapter (for ${normalizedModelName})`, adapter);\n assert(`You tried to make a query but your adapter does not implement 'queryRecord'`, typeof adapter.queryRecord === 'function');\n const promise = _queryRecord(adapter, this, normalizedModelName, query, adapterOptionsWrapper);\n return promiseObject(promise.then(identifier => identifier && this.peekRecord(identifier)));\n }\n\n /**\n `findAll` asks the adapter's `findAll` method to find the records for the\n given type, and returns a promise which will resolve with all records of\n this type present in the store, even if the adapter only returns a subset\n of them.\n ```app/routes/authors.js\n import Route from '@ember/routing/route';\n export default class AuthorsRoute extends Route {\n model(params) {\n return this.store.findAll('author');\n }\n }\n ```\n _When_ the returned promise resolves depends on the reload behavior,\n configured via the passed `options` hash and the result of the adapter's\n `shouldReloadAll` method.\n ### Reloading\n If `{ reload: true }` is passed or `adapter.shouldReloadAll` evaluates to\n `true`, then the returned promise resolves once the adapter returns data,\n regardless if there are already records in the store:\n ```js\n store.push({\n data: {\n id: 'first',\n type: 'author'\n }\n });\n // adapter#findAll resolves with\n // [\n // {\n // id: 'second',\n // type: 'author'\n // }\n // ]\n store.findAll('author', { reload: true }).then(function(authors) {\n authors.getEach('id'); // ['first', 'second']\n });\n ```\n If no reload is indicated via the above mentioned ways, then the promise\n immediately resolves with all the records currently loaded in the store.\n ### Background Reloading\n Optionally, if `adapter.shouldBackgroundReloadAll` evaluates to `true`,\n then a background reload is started. Once this resolves, the array with\n which the promise resolves, is updated automatically so it contains all the\n records in the store:\n ```app/adapters/application.js\n import Adapter from '@ember-data/adapter';\n export default class ApplicationAdapter extends Adapter {\n shouldReloadAll(store, snapshotsArray) {\n return false;\n },\n shouldBackgroundReloadAll(store, snapshotsArray) {\n return true;\n }\n });\n // ...\n store.push({\n data: {\n id: 'first',\n type: 'author'\n }\n });\n let allAuthors;\n store.findAll('author').then(function(authors) {\n authors.getEach('id'); // ['first']\n allAuthors = authors;\n });\n // later, once adapter#findAll resolved with\n // [\n // {\n // id: 'second',\n // type: 'author'\n // }\n // ]\n allAuthors.getEach('id'); // ['first', 'second']\n ```\n If you would like to force or prevent background reloading, you can set a\n boolean value for `backgroundReload` in the options object for\n `findAll`.\n ```app/routes/post/edit.js\n import Route from '@ember/routing/route';\n export default class PostEditRoute extends Route {\n model() {\n return this.store.findAll('post', { backgroundReload: false });\n }\n }\n ```\n If you pass an object on the `adapterOptions` property of the options\n argument it will be passed to you adapter via the `snapshotRecordArray`\n ```app/routes/posts.js\n import Route from '@ember/routing/route';\n export default class PostsRoute extends Route {\n model(params) {\n return this.store.findAll('post', {\n adapterOptions: { subscribe: false }\n });\n }\n }\n ```\n ```app/adapters/post.js\n import MyCustomAdapter from './custom-adapter';\n export default class UserAdapter extends MyCustomAdapter {\n findAll(store, type, sinceToken, snapshotRecordArray) {\n if (snapshotRecordArray.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n }\n ```\n See [peekAll](../methods/peekAll?anchor=peekAll) to get an array of current records in the\n store, without waiting until a reload is finished.\n ### Retrieving Related Model Records\n If you use an adapter such as Ember's default\n [`JSONAPIAdapter`](/ember-data/release/classes/JSONAPIAdapter)\n that supports the [JSON API specification](http://jsonapi.org/) and if your server\n endpoint supports the use of an\n ['include' query parameter](http://jsonapi.org/format/#fetching-includes),\n you can use `findAll()` to automatically retrieve additional records related to\n those requested by supplying an `include` parameter in the `options` object.\n For example, given a `post` model that has a `hasMany` relationship with a `comment`\n model, when we retrieve all of the post records we can have the server also return\n all of the posts' comments in the same request:\n ```app/routes/posts.js\n import Route from '@ember/routing/route';\n export default class PostsRoute extends Route {\n model() {\n return this.store.findAll('post', { include: 'comments' });\n }\n }\n ```\n Multiple relationships can be requested using an `include` parameter consisting of a\n comma-separated list (without white-space) while nested relationships can be specified\n using a dot-separated sequence of relationship names. So to request both the posts'\n comments and the authors of those comments the request would look like this:\n ```app/routes/posts.js\n import Route from '@ember/routing/route';\n export default class PostsRoute extends Route {\n model() {\n return this.store.findAll('post', { include: 'comments,comments.author' });\n }\n }\n ```\n See [query](../methods/query?anchor=query) to only get a subset of records from the server.\n @since 1.13.0\n @method findAll\n @public\n @param {String} modelName\n @param {Object} options\n @return {Promise} promise\n */\n findAll(modelName, options = {}) {\n if (DEBUG) {\n assertDestroyingStore(this, 'findAll');\n }\n assert(`You need to pass a model name to the store's findAll method`, modelName);\n assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string');\n let normalizedModelName = normalizeModelName(modelName);\n let array = this.peekAll(normalizedModelName);\n let fetch;\n let adapter = this.adapterFor(normalizedModelName);\n assert(`You tried to load all records but you have no adapter (for ${normalizedModelName})`, adapter);\n assert(`You tried to load all records but your adapter does not implement 'findAll'`, typeof adapter.findAll === 'function');\n if (options.reload) {\n array.isUpdating = true;\n fetch = _findAll(adapter, this, normalizedModelName, options);\n } else {\n let snapshotArray = array._createSnapshot(options);\n if (options.reload !== false) {\n if (adapter.shouldReloadAll && adapter.shouldReloadAll(this, snapshotArray) || !adapter.shouldReloadAll && snapshotArray.length === 0) {\n array.isUpdating = true;\n fetch = _findAll(adapter, this, modelName, options);\n }\n }\n if (!fetch) {\n if (options.backgroundReload === false) {\n fetch = resolve(array);\n } else if (options.backgroundReload || !adapter.shouldBackgroundReloadAll || adapter.shouldBackgroundReloadAll(this, snapshotArray)) {\n array.isUpdating = true;\n _findAll(adapter, this, modelName, options);\n }\n fetch = resolve(array);\n }\n }\n return promiseArray(fetch);\n }\n\n /**\n This method returns a filtered array that contains all of the\n known records for a given type in the store.\n Note that because it's just a filter, the result will contain any\n locally created records of the type, however, it will not make a\n request to the backend to retrieve additional records. If you\n would like to request all the records from the backend please use\n [store.findAll](../methods/findAll?anchor=findAll).\n Also note that multiple calls to `peekAll` for a given type will always\n return the same `RecordArray`.\n Example\n ```javascript\n let localPosts = store.peekAll('post');\n ```\n @since 1.13.0\n @method peekAll\n @public\n @param {String} modelName\n @return {RecordArray}\n */\n peekAll(modelName) {\n if (DEBUG) {\n assertDestroyingStore(this, 'peekAll');\n }\n assert(`You need to pass a model name to the store's peekAll method`, modelName);\n assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string');\n let normalizedModelName = normalizeModelName(modelName);\n return this.recordArrayManager.liveRecordArrayFor(normalizedModelName);\n }\n\n /**\n This method unloads all records in the store.\n It schedules unloading to happen during the next run loop.\n Optionally you can pass a type which unload all records for a given type.\n ```javascript\n store.unloadAll();\n store.unloadAll('post');\n ```\n @method unloadAll\n @public\n @param {String} modelName\n */\n unloadAll(modelName) {\n if (DEBUG) {\n assertDestroyedStoreOnly(this, 'unloadAll');\n }\n assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, !modelName || typeof modelName === 'string');\n const factory = internalModelFactoryFor(this);\n if (modelName === undefined) {\n factory.clear();\n } else {\n let normalizedModelName = normalizeModelName(modelName);\n factory.clear(normalizedModelName);\n }\n }\n\n /**\n This method is called once the promise returned by an\n adapter's `createRecord`, `updateRecord` or `deleteRecord`\n is rejected with a `InvalidError`.\n @method recordWasInvalid\n @private\n @deprecated\n @param {InternalModel} internalModel\n @param {Object} errors\n */\n recordWasInvalid(internalModel, parsedErrors, error) {\n if (true /* DEPRECATE_RECORD_WAS_INVALID */) {\n deprecate(`The private API recordWasInvalid will be removed in an upcoming release. Use record.errors add/remove instead if the intent was to move the record into an invalid state manually.`, false, {\n id: 'ember-data:deprecate-record-was-invalid',\n for: 'ember-data',\n until: '5.0',\n since: {\n enabled: '4.5',\n available: '4.5'\n }\n });\n if (DEBUG) {\n assertDestroyingStore(this, 'recordWasInvalid');\n }\n internalModel.adapterDidInvalidate(parsedErrors, error);\n }\n assert(`store.recordWasInvalid has been removed`);\n }\n\n /**\n Push some data for a given type into the store.\n This method expects normalized [JSON API](http://jsonapi.org/) document. This means you have to follow [JSON API specification](http://jsonapi.org/format/) with few minor adjustments:\n - record's `type` should always be in singular, dasherized form\n - members (properties) should be camelCased\n [Your primary data should be wrapped inside `data` property](http://jsonapi.org/format/#document-top-level):\n ```js\n store.push({\n data: {\n // primary data for single record of type `Person`\n id: '1',\n type: 'person',\n attributes: {\n firstName: 'Daniel',\n lastName: 'Kmak'\n }\n }\n });\n ```\n [Demo.](http://ember-twiddle.com/fb99f18cd3b4d3e2a4c7)\n `data` property can also hold an array (of records):\n ```js\n store.push({\n data: [\n // an array of records\n {\n id: '1',\n type: 'person',\n attributes: {\n firstName: 'Daniel',\n lastName: 'Kmak'\n }\n },\n {\n id: '2',\n type: 'person',\n attributes: {\n firstName: 'Tom',\n lastName: 'Dale'\n }\n }\n ]\n });\n ```\n [Demo.](http://ember-twiddle.com/69cdbeaa3702159dc355)\n There are some typical properties for `JSONAPI` payload:\n * `id` - mandatory, unique record's key\n * `type` - mandatory string which matches `model`'s dasherized name in singular form\n * `attributes` - object which holds data for record attributes - `attr`'s declared in model\n * `relationships` - object which must contain any of the following properties under each relationships' respective key (example path is `relationships.achievements.data`):\n - [`links`](http://jsonapi.org/format/#document-links)\n - [`data`](http://jsonapi.org/format/#document-resource-object-linkage) - place for primary data\n - [`meta`](http://jsonapi.org/format/#document-meta) - object which contains meta-information about relationship\n For this model:\n ```app/models/person.js\n import Model, { attr, hasMany } from '@ember-data/model';\n export default class PersonRoute extends Route {\n @attr('string') firstName;\n @attr('string') lastName;\n @hasMany('person') children;\n }\n ```\n To represent the children as IDs:\n ```js\n {\n data: {\n id: '1',\n type: 'person',\n attributes: {\n firstName: 'Tom',\n lastName: 'Dale'\n },\n relationships: {\n children: {\n data: [\n {\n id: '2',\n type: 'person'\n },\n {\n id: '3',\n type: 'person'\n },\n {\n id: '4',\n type: 'person'\n }\n ]\n }\n }\n }\n }\n ```\n [Demo.](http://ember-twiddle.com/343e1735e034091f5bde)\n To represent the children relationship as a URL:\n ```js\n {\n data: {\n id: '1',\n type: 'person',\n attributes: {\n firstName: 'Tom',\n lastName: 'Dale'\n },\n relationships: {\n children: {\n links: {\n related: '/people/1/children'\n }\n }\n }\n }\n }\n ```\n If you're streaming data or implementing an adapter, make sure\n that you have converted the incoming data into this form. The\n store's [normalize](../methods/normalize?anchor=normalize) method is a convenience\n helper for converting a json payload into the form Ember Data\n expects.\n ```js\n store.push(store.normalize('person', data));\n ```\n This method can be used both to push in brand new\n records, as well as to update existing records.\n @method push\n @public\n @param {Object} data\n @return the record(s) that was created or\n updated.\n */\n\n push(data) {\n if (DEBUG) {\n assertDestroyingStore(this, 'push');\n }\n let pushed = this._push(data);\n if (Array.isArray(pushed)) {\n let records = pushed.map(identifier => this._instanceCache.getRecord(identifier));\n return records;\n }\n if (pushed === null) {\n return null;\n }\n return this._instanceCache.getRecord(pushed);\n }\n\n /**\n Push some data in the form of a json-api document into the store,\n without creating materialized records.\n @method _push\n @private\n @param {Object} jsonApiDoc\n @return {InternalModel|Array} pushed InternalModel(s)\n */\n _push(jsonApiDoc) {\n if (DEBUG) {\n assertDestroyingStore(this, '_push');\n }\n let identifiers = this._backburner.join(() => {\n let included = jsonApiDoc.included;\n let i, length;\n if (included) {\n for (i = 0, length = included.length; i < length; i++) {\n this._instanceCache._load(included[i]);\n }\n }\n if (Array.isArray(jsonApiDoc.data)) {\n length = jsonApiDoc.data.length;\n let identifiers = new Array(length);\n for (i = 0; i < length; i++) {\n identifiers[i] = this._instanceCache._load(jsonApiDoc.data[i]);\n }\n return identifiers;\n }\n if (jsonApiDoc.data === null) {\n return null;\n }\n assert(`Expected an object in the 'data' property in a call to 'push' for ${jsonApiDoc.type}, but was ${typeof jsonApiDoc.data}`, typeof jsonApiDoc.data === 'object');\n return this._instanceCache._load(jsonApiDoc.data);\n });\n\n // this typecast is necessary because `backburner.join` is mistyped to return void\n return identifiers;\n }\n\n /**\n Push some raw data into the store.\n This method can be used both to push in brand new\n records, as well as to update existing records. You\n can push in more than one type of object at once.\n All objects should be in the format expected by the\n serializer.\n ```app/serializers/application.js\n import RESTSerializer from '@ember-data/serializer/rest';\n export default class ApplicationSerializer extends RESTSerializer;\n ```\n ```js\n let pushData = {\n posts: [\n { id: 1, postTitle: \"Great post\", commentIds: [2] }\n ],\n comments: [\n { id: 2, commentBody: \"Insightful comment\" }\n ]\n }\n store.pushPayload(pushData);\n ```\n By default, the data will be deserialized using a default\n serializer (the application serializer if it exists).\n Alternatively, `pushPayload` will accept a model type which\n will determine which serializer will process the payload.\n ```app/serializers/application.js\n import RESTSerializer from '@ember-data/serializer/rest';\n export default class ApplicationSerializer extends RESTSerializer;\n ```\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n export default JSONSerializer;\n ```\n ```js\n store.pushPayload(pushData); // Will use the application serializer\n store.pushPayload('post', pushData); // Will use the post serializer\n ```\n @method pushPayload\n @public\n @param {String} modelName Optionally, a model type used to determine which serializer will be used\n @param {Object} inputPayload\n */\n // TODO @runspired @deprecate pushPayload in favor of looking up the serializer\n pushPayload(modelName, inputPayload) {\n if (DEBUG) {\n assertDestroyingStore(this, 'pushPayload');\n }\n let serializer;\n let payload;\n if (!inputPayload) {\n payload = modelName;\n serializer = this.serializerFor('application');\n assert(`You cannot use 'store#pushPayload' without a modelName unless your default serializer defines 'pushPayload'`, typeof serializer.pushPayload === 'function');\n } else {\n payload = inputPayload;\n assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string');\n let normalizedModelName = normalizeModelName(modelName);\n serializer = this.serializerFor(normalizedModelName);\n }\n assert(`You must define a pushPayload method in your serializer in order to call store.pushPayload`, serializer.pushPayload);\n serializer.pushPayload(this, payload);\n }\n\n // TODO @runspired @deprecate records should implement their own serialization if desired\n serializeRecord(record, options) {\n // TODO we used to check if the record was destroyed here\n return this._instanceCache.createSnapshot(recordIdentifierFor(record)).serialize(options);\n }\n\n // todo @runspired this should likely be publicly @documented for custom records\n saveRecord(record, options = {}) {\n assert(`Unable to initate save for a record in a disconnected state`, storeFor(record));\n let identifier = recordIdentifierFor(record);\n let internalModel = identifier && internalModelFactoryFor(this).peek(identifier);\n if (!internalModel) {\n // this commonly means we're disconnected\n // but just in case we reject here to prevent bad things.\n return reject(`Record Is Disconnected`);\n }\n // TODO we used to check if the record was destroyed here\n // Casting can be removed once REQUEST_SERVICE ff is turned on\n // because a `Record` is provided there will always be a matching internalModel\n\n assert(`Cannot initiate a save request for an unloaded record: ${identifier}`, !internalModel.isEmpty && !internalModel.isDestroyed);\n if (internalModel._isRecordFullyDeleted()) {\n return resolve(record);\n }\n internalModel.adapterWillCommit();\n if (!options) {\n options = {};\n }\n let recordData = this._instanceCache.getRecordData(identifier);\n let operation = 'updateRecord';\n\n // TODO handle missing isNew\n if (recordData.isNew && recordData.isNew()) {\n operation = 'createRecord';\n } else if (recordData.isDeleted && recordData.isDeleted()) {\n operation = 'deleteRecord';\n }\n const saveOptions = Object.assign({\n [SaveOp]: operation\n }, options);\n let fetchManagerPromise = this._fetchManager.scheduleSave(identifier, saveOptions);\n return fetchManagerPromise.then(payload => {\n /*\n // TODO @runspired re-evaluate the below claim now that\n // the save request pipeline is more streamlined.\n Note to future spelunkers hoping to optimize.\n We rely on this `run` to create a run loop if needed\n that `store._push` and `store.saveRecord` will both share.\n We use `join` because it is often the case that we\n have an outer run loop available still from the first\n call to `store._push`;\n */\n this._backburner.join(() => {\n if (DEBUG) {\n assertDestroyingStore(this, 'saveRecord');\n }\n let data = payload && payload.data;\n if (!data) {\n assert(`Your ${internalModel.modelName} record was saved to the server, but the response does not have an id and no id has been set client side. Records must have ids. Please update the server response to provide an id in the response or generate the id on the client side either before saving the record or while normalizing the response.`, internalModel.id);\n }\n const cache = this.identifierCache;\n if (operation !== 'deleteRecord' && data) {\n cache.updateRecordIdentifier(identifier, data);\n }\n\n //We first make sure the primary data has been updated\n //TODO try to move notification to the user to the end of the runloop\n internalModel.adapterDidCommit(data);\n if (payload && payload.included) {\n this._push({\n data: null,\n included: payload.included\n });\n }\n });\n return record;\n }, e => {\n if (typeof e === 'string') {\n throw e;\n }\n const {\n error,\n parsedErrors\n } = e;\n internalModel.adapterDidInvalidate(parsedErrors, error);\n throw error;\n });\n }\n\n /**\n * Instantiation hook allowing applications or addons to configure the store\n * to utilize a custom RecordData implementation.\n *\n * @method createRecordDataFor\n * @public\n * @param modelName\n * @param id\n * @param clientId\n * @param storeWrapper\n */\n createRecordDataFor(modelName, id, clientId, storeWrapper) {\n if (true /* HAS_RECORD_DATA_PACKAGE */) {\n // we can't greedily use require as this causes\n // a cycle we can't easily fix (or clearly pin point) at present.\n //\n // it can be reproduced in partner tests by running\n // node ./scripts/packages-for-commit.js && yarn test-external:ember-observer\n if (_RecordData === undefined) {\n _RecordData = importSync('@ember-data/record-data/-private').RecordData;\n }\n let identifier = this.identifierCache.getOrCreateRecordIdentifier({\n type: modelName,\n id,\n lid: clientId\n });\n return new _RecordData(identifier, storeWrapper);\n }\n assert(`Expected store.createRecordDataFor to be implemented but it wasn't`);\n }\n\n /**\n `normalize` converts a json payload into the normalized form that\n [push](../methods/push?anchor=push) expects.\n Example\n ```js\n socket.on('message', function(message) {\n let modelName = message.model;\n let data = message.data;\n store.push(store.normalize(modelName, data));\n });\n ```\n @method normalize\n @public\n @param {String} modelName The name of the model type for this payload\n @param {Object} payload\n @return {Object} The normalized payload\n */\n // TODO @runspired @deprecate users should call normalize on the associated serializer directly\n normalize(modelName, payload) {\n if (DEBUG) {\n assertDestroyingStore(this, 'normalize');\n }\n assert(`You need to pass a model name to the store's normalize method`, modelName);\n assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${typeof modelName}`, typeof modelName === 'string');\n let normalizedModelName = normalizeModelName(modelName);\n let serializer = this.serializerFor(normalizedModelName);\n let model = this.modelFor(normalizedModelName);\n assert(`You must define a normalize method in your serializer in order to call store.normalize`, serializer?.normalize);\n return serializer.normalize(model, payload);\n }\n\n /**\n Returns an instance of the adapter for a given type. For\n example, `adapterFor('person')` will return an instance of\n the adapter located at `app/adapters/person.js`\n If no `person` adapter is found, this method will look\n for an `application` adapter (the default adapter for\n your entire application).\n @method adapterFor\n @public\n @param {String} modelName\n @return Adapter\n */\n adapterFor(modelName) {\n if (DEBUG) {\n assertDestroyingStore(this, 'adapterFor');\n }\n assert(`You need to pass a model name to the store's adapterFor method`, modelName);\n assert(`Passing classes to store.adapterFor has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string');\n let normalizedModelName = normalizeModelName(modelName);\n let {\n _adapterCache\n } = this;\n let adapter = _adapterCache[normalizedModelName];\n if (adapter) {\n return adapter;\n }\n let owner = getOwner(this);\n\n // name specific adapter\n adapter = owner.lookup(`adapter:${normalizedModelName}`);\n if (adapter !== undefined) {\n _adapterCache[normalizedModelName] = adapter;\n return adapter;\n }\n\n // no adapter found for the specific name, fallback and check for application adapter\n adapter = _adapterCache.application || owner.lookup('adapter:application');\n if (adapter !== undefined) {\n _adapterCache[normalizedModelName] = adapter;\n _adapterCache.application = adapter;\n return adapter;\n }\n if (true /* DEPRECATE_JSON_API_FALLBACK */) {\n // final fallback, no model specific adapter, no application adapter, no\n // `adapter` property on store: use json-api adapter\n adapter = _adapterCache['-json-api'] || owner.lookup('adapter:-json-api');\n if (adapter !== undefined) {\n deprecate(`Your application is utilizing a deprecated hidden fallback adapter (-json-api). Please implement an application adapter to function as your fallback.`, false, {\n id: 'ember-data:deprecate-secret-adapter-fallback',\n for: 'ember-data',\n until: '5.0',\n since: {\n available: '4.5',\n enabled: '4.5'\n }\n });\n _adapterCache[normalizedModelName] = adapter;\n _adapterCache['-json-api'] = adapter;\n return adapter;\n }\n }\n assert(`No adapter was found for '${modelName}' and no 'application' adapter was found as a fallback.`);\n }\n\n /**\n Returns an instance of the serializer for a given type. For\n example, `serializerFor('person')` will return an instance of\n `App.PersonSerializer`.\n If no `App.PersonSerializer` is found, this method will look\n for an `App.ApplicationSerializer` (the default serializer for\n your entire application).\n If a serializer cannot be found on the adapter, it will fall back\n to an instance of `JSONSerializer`.\n @method serializerFor\n @public\n @param {String} modelName the record to serialize\n @return {Serializer}\n */\n serializerFor(modelName) {\n if (DEBUG) {\n assertDestroyingStore(this, 'serializerFor');\n }\n assert(`You need to pass a model name to the store's serializerFor method`, modelName);\n assert(`Passing classes to store.serializerFor has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string');\n let normalizedModelName = normalizeModelName(modelName);\n let {\n _serializerCache\n } = this;\n let serializer = _serializerCache[normalizedModelName];\n if (serializer) {\n return serializer;\n }\n let owner = getOwner(this);\n\n // by name\n serializer = owner.lookup(`serializer:${normalizedModelName}`);\n if (serializer !== undefined) {\n _serializerCache[normalizedModelName] = serializer;\n return serializer;\n }\n\n // no serializer found for the specific model, fallback and check for application serializer\n serializer = _serializerCache.application || owner.lookup('serializer:application');\n if (serializer !== undefined) {\n _serializerCache[normalizedModelName] = serializer;\n _serializerCache.application = serializer;\n return serializer;\n }\n return null;\n }\n destroy() {\n // enqueue destruction of any adapters/serializers we have created\n for (let adapterName in this._adapterCache) {\n let adapter = this._adapterCache[adapterName];\n if (typeof adapter.destroy === 'function') {\n adapter.destroy();\n }\n }\n for (let serializerName in this._serializerCache) {\n let serializer = this._serializerCache[serializerName];\n if (typeof serializer.destroy === 'function') {\n serializer.destroy();\n }\n }\n if (true /* HAS_RECORD_DATA_PACKAGE */) {\n const peekGraph = importSync('@ember-data/record-data/-private').peekGraph;\n let graph = peekGraph(this);\n if (graph) {\n graph.destroy();\n }\n }\n return super.destroy();\n }\n willDestroy() {\n super.willDestroy();\n this.recordArrayManager.destroy();\n this.identifierCache.destroy();\n\n // destroy the graph before unloadAll\n // since then we avoid churning relationships\n // during unload\n if (true /* HAS_RECORD_DATA_PACKAGE */) {\n const peekGraph = importSync('@ember-data/record-data/-private').peekGraph;\n let graph = peekGraph(this);\n if (graph) {\n graph.willDestroy();\n }\n }\n this.unloadAll();\n if (DEBUG) {\n unregisterWaiter(this.__asyncWaiter);\n let tracked = this._trackedAsyncRequests;\n let isSettled = tracked.length === 0;\n if (!isSettled) {\n throw new Error('Async Request leaks detected. Add a breakpoint here and set `store.generateStackTracesForTrackedRequests = true;`to inspect traces for leak origins:\\n\\t - ' + tracked.map(o => o.label).join('\\n\\t - '));\n }\n }\n }\n}\nexport default Store;\nlet assertDestroyingStore;\nlet assertDestroyedStoreOnly;\nif (DEBUG) {\n assertDestroyingStore = function assertDestroyedStore(store, method) {\n assert(`Attempted to call store.${method}(), but the store instance has already been destroyed.`, !(store.isDestroying || store.isDestroyed));\n };\n assertDestroyedStoreOnly = function assertDestroyedStoreOnly(store, method) {\n assert(`Attempted to call store.${method}(), but the store instance has already been destroyed.`, !store.isDestroyed);\n };\n}\nfunction isMaybeIdentifier(maybeIdentifier) {\n return Boolean(maybeIdentifier !== null && typeof maybeIdentifier === 'object' && ('id' in maybeIdentifier && 'type' in maybeIdentifier && maybeIdentifier.id && maybeIdentifier.type || maybeIdentifier.lid));\n}\nexport function assertIdentifierHasId(identifier) {\n assert(`Attempted to schedule a fetch for a record without an id.`, identifier.id !== null);\n}","import { promiseObject } from '../promise-proxies';\nexport default function promiseRecord(store, promise, label) {\n let toReturn = promise.then(identifier => store.peekRecord(identifier));\n return promiseObject(toReturn, label);\n}","import { setModifierManager, capabilities } from '@ember/modifier';\nimport { macroCondition, dependencySatisfies } from '@embroider/macros';\n\n/**\n The `{{did-insert}}` element modifier is activated when an element is\n inserted into the DOM.\n\n In this example, the `fadeIn` function receives the `div` DOM element as its\n first argument and is executed after the element is inserted into the DOM.\n\n ```handlebars\n
\n {{yield}}\n
\n ```\n\n ```js\n export default Component.extend({\n fadeIn(element) {\n element.classList.add('fade-in');\n }\n });\n ```\n\n By default, the executed function will be unbound. If you would like to access\n the component context in your function, use the `action` decorator as follows:\n\n ```handlebars\n
first
\n
second
\n\n

{{this.count}} elements were rendered

\n ```\n\n ```js\n export default Component.extend({\n count: tracked({ value: 0 }),\n\n incrementCount: action(function() {\n this.count++;\n })\n });\n ```\n\n @method did-insert\n @public\n*/\nexport default setModifierManager(() => ({\n capabilities: capabilities(macroCondition(dependencySatisfies('ember-source', '>= 3.22.0-beta.1')) ? '3.22' : '3.13', {\n disableAutoTracking: true\n }),\n createModifier() {},\n installModifier(_state, element, {\n positional: [fn, ...args],\n named\n }) {\n fn(element, args, named);\n },\n updateModifier() {},\n destroyModifier() {}\n}), class DidInsertModifier {});","import { setModifierManager, capabilities } from '@ember/modifier';\nimport { macroCondition, dependencySatisfies, importSync } from '@embroider/macros';\nconst untrack = function () {\n if (macroCondition(dependencySatisfies('ember-source', '> 3.27.0-beta.1'))) {\n // ember-source@3.27 shipped \"real modules\" by default, so we can just use\n // importSync to get @glimmer/validator directly\n return importSync('@glimmer/validator').untrack;\n } else if (macroCondition(dependencySatisfies('ember-source', '>= 3.22.0-alpha.1'))) {\n // we can access `window.Ember` here because it wasn't deprecated until at least 3.27\n // eslint-disable-next-line no-undef\n return Ember.__loader.require('@glimmer/validator').untrack;\n } else {\n // nothing needed here, we do not call `untrack` in this case\n }\n}();\n\n/**\n The `{{did-update}}` element modifier is activated when any of its arguments\n are updated. It does not run on initial render.\n\n In this example, the `resize` function receives the `textarea` DOM element as its\n first argument and is executed anytime the `@text` argument changes.\n\n ```handlebars\n \n ```\n\n ```js\n export default Component.extend({\n resize(element) {\n element.style.height = `${element.scrollHeight}px`;\n }\n });\n ```\n\n In addition to the `element`, both named and positional arguments are passed to the\n executed function:\n\n ```handlebars\n
\n ```\n\n ```js\n export default Component.extend({\n logArguments(element, [first, second], { third }) {\n console.log('element', element);\n console.log('positional args', first, second);\n console.log('names args', third);\n }\n });\n ```\n\n By default, the executed function will be unbound. If you would like to access\n the component context in your function, use the `action` decorator as follows:\n\n ```handlebars\n
\n ```\n\n ```js\n export default Component.extend({\n someFunction: action(function(element, [someArg]) {\n // the `this` context will be the component instance\n })\n });\n ```\n\n @method did-update\n @public\n*/\nexport default setModifierManager(() => ({\n capabilities: macroCondition(dependencySatisfies('ember-source', '>= 3.22.0-alpha.1')) ? capabilities('3.22', {\n disableAutoTracking: false\n }) : capabilities('3.13', {\n disableAutoTracking: true\n }),\n createModifier() {\n return {\n element: null\n };\n },\n installModifier(state, element, args) {\n // save element into state bucket\n state.element = element;\n if (macroCondition(dependencySatisfies('ember-source', '>= 3.22.0-alpha.1'))) {\n // Consume individual properties to entangle tracking.\n // https://github.com/emberjs/ember.js/issues/19277\n // https://github.com/ember-modifier/ember-modifier/pull/63#issuecomment-815908201\n args.positional.forEach(() => {});\n args.named && Object.values(args.named);\n }\n },\n updateModifier({\n element\n }, args) {\n let [fn, ...positional] = args.positional;\n if (macroCondition(dependencySatisfies('ember-source', '>= 3.22.0-alpha.1'))) {\n // Consume individual properties to entangle tracking.\n // https://github.com/emberjs/ember.js/issues/19277\n // https://github.com/ember-modifier/ember-modifier/pull/63#issuecomment-815908201\n args.positional.forEach(() => {});\n args.named && Object.values(args.named);\n untrack(() => {\n fn(element, positional, args.named);\n });\n } else {\n fn(element, positional, args.named);\n }\n },\n destroyModifier() {}\n}), class DidUpdateModifier {});","import { setModifierManager, capabilities } from '@ember/modifier';\nimport { macroCondition, dependencySatisfies } from '@embroider/macros';\n\n/**\n The `{{will-destroy}}` element modifier is activated immediately before the element\n is removed from the DOM.\n\n ```handlebars\n
\n {{yield}}\n
\n ```\n\n ```js\n export default Component.extend({\n teardownPlugin(element) {\n // teardown logic here\n }\n });\n ```\n\n By default, the executed function will be unbound. If you would like to access\n the component context in your function, use the `action` decorator as follows:\n\n ```handlebars\n
\n {{yield}}\n
\n ```\n\n ```js\n export default Component.extend({\n teardownPlugin: action(function(element) {\n // the `this` context will be the component instance\n })\n });\n ```\n\n @method will-destroy\n @public\n*/\nexport default setModifierManager(() => ({\n capabilities: capabilities(macroCondition(dependencySatisfies('ember-source', '>= 3.22.0-beta.1')) ? '3.22' : '3.13', {\n disableAutoTracking: true\n }),\n createModifier() {\n return {\n element: null\n };\n },\n installModifier(state, element) {\n state.element = element;\n },\n updateModifier() {},\n destroyModifier({\n element\n }, args) {\n let [fn, ...positional] = args.positional;\n fn(element, positional, args.named);\n }\n}), class WillDestroyModifier {});","export default class Cache {\n size = 0;\n misses = 0;\n hits = 0;\n\n constructor(limit, func, store) {\n this.limit = limit;\n this.func = func;\n this.store = store;\n this.store = store || new Map();\n }\n\n get(key) {\n let value = this.store.get(key);\n\n if (this.store.has(key)) {\n this.hits++;\n return this.store.get(key);\n } else {\n this.misses++;\n value = this.set(key, this.func(key));\n }\n\n return value;\n }\n\n set(key, value) {\n if (this.limit > this.size) {\n this.size++;\n this.store.set(key, value);\n }\n\n return value;\n }\n\n purge() {\n this.store.clear();\n this.size = 0;\n this.hits = 0;\n this.misses = 0;\n }\n\n}","/* eslint-disable no-useless-escape */\n\n/**\n @module @ember/string\n */\nimport Cache from './cache';\n// STATE within a module is frowned upon, this exists\n// to support Ember.STRINGS but shield ember internals from this legacy global\n// API.\nlet STRINGS = {};\nexport function setStrings(strings) {\n STRINGS = strings;\n}\nexport function getStrings() {\n return STRINGS;\n}\nexport function getString(name) {\n return STRINGS[name];\n}\nconst STRING_DASHERIZE_REGEXP = /[ _]/g;\nconst STRING_DASHERIZE_CACHE = new Cache(1000, key => decamelize(key).replace(STRING_DASHERIZE_REGEXP, '-'));\nconst STRING_CAMELIZE_REGEXP_1 = /(\\-|\\_|\\.|\\s)+(.)?/g;\nconst STRING_CAMELIZE_REGEXP_2 = /(^|\\/)([A-Z])/g;\nconst CAMELIZE_CACHE = new Cache(1000, key => key.replace(STRING_CAMELIZE_REGEXP_1, (_match, _separator, chr) => chr ? chr.toUpperCase() : '').replace(STRING_CAMELIZE_REGEXP_2, (match\n/*, separator, chr */\n) => match.toLowerCase()));\nconst STRING_CLASSIFY_REGEXP_1 = /^(\\-|_)+(.)?/;\nconst STRING_CLASSIFY_REGEXP_2 = /(.)(\\-|\\_|\\.|\\s)+(.)?/g;\nconst STRING_CLASSIFY_REGEXP_3 = /(^|\\/|\\.)([a-z])/g;\nconst CLASSIFY_CACHE = new Cache(1000, str => {\n const replace1 = (_match, _separator, chr) => chr ? `_${chr.toUpperCase()}` : '';\n\n const replace2 = (_match, initialChar, _separator, chr) => initialChar + (chr ? chr.toUpperCase() : '');\n\n const parts = str.split('/');\n\n for (let i = 0; i < parts.length; i++) {\n parts[i] = parts[i].replace(STRING_CLASSIFY_REGEXP_1, replace1).replace(STRING_CLASSIFY_REGEXP_2, replace2);\n }\n\n return parts.join('/').replace(STRING_CLASSIFY_REGEXP_3, (match\n /*, separator, chr */\n ) => match.toUpperCase());\n});\nconst STRING_UNDERSCORE_REGEXP_1 = /([a-z\\d])([A-Z]+)/g;\nconst STRING_UNDERSCORE_REGEXP_2 = /\\-|\\s+/g;\nconst UNDERSCORE_CACHE = new Cache(1000, str => str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase());\nconst STRING_CAPITALIZE_REGEXP = /(^|\\/)([a-z\\u00C0-\\u024F])/g;\nconst CAPITALIZE_CACHE = new Cache(1000, str => str.replace(STRING_CAPITALIZE_REGEXP, (match\n/*, separator, chr */\n) => match.toUpperCase()));\nconst STRING_DECAMELIZE_REGEXP = /([a-z\\d])([A-Z])/g;\nconst DECAMELIZE_CACHE = new Cache(1000, str => str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase());\n/**\n Splits a string into separate units separated by spaces, eliminating any\n empty strings in the process. This is a convenience method for split that\n is mostly useful when applied to the `String.prototype`.\n\n ```javascript\n import { w } from '@ember/string';\n\n w(\"alpha beta gamma\").forEach(function(key) {\n console.log(key);\n });\n\n // > alpha\n // > beta\n // > gamma\n ```\n\n @method w\n @param {String} str The string to split\n @return {Array} array containing the split strings\n @public\n*/\n\nexport function w(str) {\n return str.split(/\\s+/);\n}\n/**\n Converts a camelized string into all lower case separated by underscores.\n\n ```javascript\n import { decamelize } from '@ember/string';\n\n decamelize('innerHTML'); // 'inner_html'\n decamelize('action_name'); // 'action_name'\n decamelize('css-class-name'); // 'css-class-name'\n decamelize('my favorite items'); // 'my favorite items'\n ```\n\n @method decamelize\n @param {String} str The string to decamelize.\n @return {String} the decamelized string.\n @public\n*/\n\nexport function decamelize(str) {\n return DECAMELIZE_CACHE.get(str);\n}\n/**\n Replaces underscores, spaces, or camelCase with dashes.\n\n ```javascript\n import { dasherize } from '@ember/string';\n\n dasherize('innerHTML'); // 'inner-html'\n dasherize('action_name'); // 'action-name'\n dasherize('css-class-name'); // 'css-class-name'\n dasherize('my favorite items'); // 'my-favorite-items'\n dasherize('privateDocs/ownerInvoice'; // 'private-docs/owner-invoice'\n ```\n\n @method dasherize\n @param {String} str The string to dasherize.\n @return {String} the dasherized string.\n @public\n*/\n\nexport function dasherize(str) {\n return STRING_DASHERIZE_CACHE.get(str);\n}\n/**\n Returns the lowerCamelCase form of a string.\n\n ```javascript\n import { camelize } from '@ember/string';\n\n camelize('innerHTML'); // 'innerHTML'\n camelize('action_name'); // 'actionName'\n camelize('css-class-name'); // 'cssClassName'\n camelize('my favorite items'); // 'myFavoriteItems'\n camelize('My Favorite Items'); // 'myFavoriteItems'\n camelize('private-docs/owner-invoice'); // 'privateDocs/ownerInvoice'\n ```\n\n @method camelize\n @param {String} str The string to camelize.\n @return {String} the camelized string.\n @public\n*/\n\nexport function camelize(str) {\n return CAMELIZE_CACHE.get(str);\n}\n/**\n Returns the UpperCamelCase form of a string.\n\n ```javascript\n import { classify } from '@ember/string';\n\n classify('innerHTML'); // 'InnerHTML'\n classify('action_name'); // 'ActionName'\n classify('css-class-name'); // 'CssClassName'\n classify('my favorite items'); // 'MyFavoriteItems'\n classify('private-docs/owner-invoice'); // 'PrivateDocs/OwnerInvoice'\n ```\n\n @method classify\n @param {String} str the string to classify\n @return {String} the classified string\n @public\n*/\n\nexport function classify(str) {\n return CLASSIFY_CACHE.get(str);\n}\n/**\n More general than decamelize. Returns the lower\\_case\\_and\\_underscored\n form of a string.\n\n ```javascript\n import { underscore } from '@ember/string';\n\n underscore('innerHTML'); // 'inner_html'\n underscore('action_name'); // 'action_name'\n underscore('css-class-name'); // 'css_class_name'\n underscore('my favorite items'); // 'my_favorite_items'\n underscore('privateDocs/ownerInvoice'); // 'private_docs/owner_invoice'\n ```\n\n @method underscore\n @param {String} str The string to underscore.\n @return {String} the underscored string.\n @public\n*/\n\nexport function underscore(str) {\n return UNDERSCORE_CACHE.get(str);\n}\n/**\n Returns the Capitalized form of a string\n\n ```javascript\n import { capitalize } from '@ember/string';\n\n capitalize('innerHTML') // 'InnerHTML'\n capitalize('action_name') // 'Action_name'\n capitalize('css-class-name') // 'Css-class-name'\n capitalize('my favorite items') // 'My favorite items'\n capitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'\n ```\n\n @method capitalize\n @param {String} str The string to capitalize.\n @return {String} The capitalized string.\n @public\n*/\n\nexport function capitalize(str) {\n return CAPITALIZE_CACHE.get(str);\n}\n/*\n The following are implemented here to give users adding `@ember/string` to\n their projects a useful error message. The `ember-source` implementation of\n `@ember/string` is clobbered by adding this addon, and so the deprecation of\n the import path is not triggered. This error message is intended to help\n users discover what they need to change.\n*/\n\nexport function htmlSafe(str) {\n throw new Error('htmlSafe is not implemented in the `@ember/string` package. Please import from `@ember/template` instead.');\n}\nexport function isHTMLSafe(str) {\n throw new Error('isHTMLSafe is not implemented in the `@ember/string` package. Please import from `@ember/template` instead.');\n}","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport Service from '@ember/service';\nimport { getOwner } from '@ember/application';\nexport default class EnsureRegisteredService extends Service {\n constructor(...args) {\n super(...args);\n _defineProperty(this, \"classNonces\", new WeakMap());\n _defineProperty(this, \"nonceCounter\", 0);\n }\n register(klass, owner = getOwner(this)) {\n let nonce = this.classNonces.get(klass);\n if (nonce == null) {\n nonce = `-ensure${this.nonceCounter++}`;\n this.classNonces.set(klass, nonce);\n owner.register(`component:${nonce}`, klass);\n }\n return nonce;\n }\n}","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { DEBUG } from '@glimmer/env';\nimport { setOwner } from './owner';\nimport { isDestroying, isDestroyed } from './destroyables';\n\n// This provides a type-safe `WeakMap`: the getter and setter link the key to a\n// specific value. This is how `WeakMap`s actually behave, but the TS type\n// system does not (yet!) have a good way to capture that for types like\n// `WeakMap` where the type is generic over another generic type (here, `Args`).\n\n// SAFETY: this only holds because we *only* acces this when `DEBUG` is `true`.\n// There is not a great way to connect that data in TS at present.\nexport let ARGS_SET;\nif (DEBUG) {\n ARGS_SET = new WeakMap();\n}\n\n// --- Type utilities for component signatures --- //\n// Type-only \"symbol\" to use with `EmptyObject` below, so that it is *not*\n// equivalent to an empty interface.\n\n/**\n * This provides us a way to have a \"fallback\" which represents an empty object,\n * without the downsides of how TS treats `{}`. Specifically: this will\n * correctly leverage \"excess property checking\" so that, given a component\n * which has no named args, if someone invokes it with any named args, they will\n * get a type error.\n *\n * @internal This is exported so declaration emit works (if it were not emitted,\n * declarations which fall back to it would not work). It is *not* intended for\n * public usage, and the specific mechanics it uses may change at any time.\n * The location of this export *is* part of the public API, because moving it\n * will break existing declarations, but is not legal for end users to import\n * themselves, so ***DO NOT RELY ON IT***.\n */\n\n/** Given a signature `S`, get back the `Args` type. */\n\n/**\n * Given any allowed shorthand form of a signature, desugars it to its full\n * expanded type.\n *\n * @internal This is only exported so we can avoid duplicating it in\n * [Glint](https://github.com/typed-ember/glint) or other such tooling. It is\n * *not* intended for public usage, and the specific mechanics it uses may\n * change at any time. Although the signature produced by is part of Glimmer's\n * public API the existence and mechanics of this specific symbol are *not*,\n * so ***DO NOT RELY ON IT***.\n */\n// The conditional type here is because TS applies conditional types\n// distributively. This means that for union types, checks like `keyof T` get\n// all the keys from all elements of the union, instead of ending up as `never`\n// and then always falling into the `Signature` path instead of falling back to\n// the legacy args handling path.\n\n/**\n * @internal we use this type for convenience internally; inference means users\n * should not normally need to name it\n */\n\n/**\n * The `Component` class defines an encapsulated UI element that is rendered to\n * the DOM. A component is made up of a template and, optionally, this component\n * object.\n *\n * ## Defining a Component\n *\n * To define a component, subclass `Component` and add your own properties,\n * methods and lifecycle hooks:\n *\n * ```ts\n * import Component from '@glimmer/component';\n *\n * export default class extends Component {\n * }\n * ```\n *\n * ## Lifecycle Hooks\n *\n * Lifecycle hooks allow you to respond to changes to a component, such as when\n * it gets created, rendered, updated or destroyed. To add a lifecycle hook to a\n * component, implement the hook as a method on your component subclass.\n *\n * For example, to be notified when Glimmer has rendered your component so you\n * can attach a legacy jQuery plugin, implement the `didInsertElement()` method:\n *\n * ```ts\n * import Component from '@glimmer/component';\n *\n * export default class extends Component {\n * didInsertElement() {\n * $(this.element).pickadate();\n * }\n * }\n * ```\n *\n * ## Data for Templates\n *\n * `Component`s have two different kinds of data, or state, that can be\n * displayed in templates:\n *\n * 1. Arguments\n * 2. Properties\n *\n * Arguments are data that is passed in to a component from its parent\n * component. For example, if I have a `UserGreeting` component, I can pass it\n * a name and greeting to use:\n *\n * ```hbs\n * \n * ```\n *\n * Inside my `UserGreeting` template, I can access the `@name` and `@greeting`\n * arguments that I've been given:\n *\n * ```hbs\n * {{@greeting}}, {{@name}}!\n * ```\n *\n * Arguments are also available inside my component:\n *\n * ```ts\n * console.log(this.args.greeting); // prints \"Olá\"\n * ```\n *\n * Properties, on the other hand, are internal to the component and declared in\n * the class. You can use properties to store data that you want to show in the\n * template, or pass to another component as an argument.\n *\n * ```ts\n * import Component from '@glimmer/component';\n *\n * export default class extends Component {\n * user = {\n * name: 'Robbie'\n * }\n * }\n * ```\n *\n * In the above example, we've defined a component with a `user` property that\n * contains an object with its own `name` property.\n *\n * We can render that property in our template:\n *\n * ```hbs\n * Hello, {{user.name}}!\n * ```\n *\n * We can also take that property and pass it as an argument to the\n * `UserGreeting` component we defined above:\n *\n * ```hbs\n * \n * ```\n *\n * ## Arguments vs. Properties\n *\n * Remember, arguments are data that was given to your component by its parent\n * component, and properties are data your component has defined for itself.\n *\n * You can tell the difference between arguments and properties in templates\n * because arguments always start with an `@` sign (think \"A is for arguments\"):\n *\n * ```hbs\n * {{@firstName}}\n * ```\n *\n * We know that `@firstName` came from the parent component, not the current\n * component, because it starts with `@` and is therefore an argument.\n *\n * On the other hand, if we see:\n *\n * ```hbs\n * {{name}}\n * ```\n *\n * We know that `name` is a property on the component. If we want to know where\n * the data is coming from, we can go look at our component class to find out.\n *\n * Inside the component itself, arguments always show up inside the component's\n * `args` property. For example, if `{{@firstName}}` is `Tom` in the template,\n * inside the component `this.args.firstName` would also be `Tom`.\n */\nexport default class BaseComponent {\n /**\n * Constructs a new component and assigns itself the passed properties. You\n * should not construct new components yourself. Instead, Glimmer will\n * instantiate new components automatically as it renders.\n *\n * @param owner\n * @param args\n */\n constructor(owner, args) {\n /**\n * Named arguments passed to the component from its parent component.\n * They can be accessed in JavaScript via `this.args.argumentName` and in the template via `@argumentName`.\n *\n * Say you have the following component, which will have two `args`, `firstName` and `lastName`:\n *\n * ```hbs\n * \n * ```\n *\n * If you needed to calculate `fullName` by combining both of them, you would do:\n *\n * ```ts\n * didInsertElement() {\n * console.log(`Hi, my full name is ${this.args.firstName} ${this.args.lastName}`);\n * }\n * ```\n *\n * While in the template you could do:\n *\n * ```hbs\n *

Welcome, {{@firstName}} {{@lastName}}!

\n * ```\n */\n _defineProperty(this, \"args\", void 0);\n if (DEBUG && !(owner !== null && typeof owner === 'object' && ARGS_SET.has(args))) {\n throw new Error(`You must pass both the owner and args to super() in your component: ${this.constructor.name}. You can pass them directly, or use ...arguments to pass all arguments through.`);\n }\n this.args = args;\n setOwner(this, owner);\n }\n get isDestroying() {\n return isDestroying(this);\n }\n get isDestroyed() {\n return isDestroyed(this);\n }\n\n /**\n * Called before the component has been removed from the DOM.\n */\n willDestroy() {}\n}","import Ember from 'ember';\nexport const isDestroying = Ember._isDestroying;\nexport const isDestroyed = Ember._isDestroyed;","import { DEBUG } from '@glimmer/env';\nimport Ember from 'ember';\nimport { set } from '@ember/object';\nimport { getOwner, setOwner } from '@ember/application';\nimport { capabilities } from '@ember/component';\nimport { schedule } from '@ember/runloop';\nimport BaseComponentManager from './base-component-manager';\nimport * as destroyables from './destroyables';\nconst {\n setDestroyed,\n setDestroying\n} = destroyables;\nconst CAPABILITIES = true // @ts-ignore\n// @ts-ignore\n? capabilities('3.13', {\n destructor: true,\n asyncLifecycleCallbacks: false,\n updateHook: false\n}) : capabilities('3.4', {\n destructor: true,\n asyncLifecycleCallbacks: false\n});\nconst scheduledDestroyComponent = true ? undefined : (component, meta) => {\n if (component.isDestroyed) {\n return;\n }\n Ember.destroy(component);\n meta.setSourceDestroyed();\n setDestroyed(component);\n};\nconst destroy = true ? Ember.destroy : component => {\n if (component.isDestroying) {\n return;\n }\n let meta = Ember.meta(component);\n meta.setSourceDestroying();\n setDestroying(component);\n schedule('actions', component, component.willDestroy);\n schedule('destroy', this, scheduledDestroyComponent, component, meta);\n};\nconst registerDestructor = true ? Ember._registerDestructor : true ? Ember.__loader.require('@glimmer/runtime').registerDestructor : undefined;\n\n/**\n * This component manager runs in Ember.js environments and extends the base component manager to:\n *\n * 1. Properly destroy the component's associated `meta` data structure\n * 2. Schedule destruction using Ember's runloop\n */\nclass EmberGlimmerComponentManager extends BaseComponentManager(setOwner, getOwner, CAPABILITIES) {\n createComponent(ComponentClass, args) {\n const component = super.createComponent(ComponentClass, args);\n if (true) {\n registerDestructor(component, () => {\n component.willDestroy();\n });\n }\n return component;\n }\n destroyComponent(component) {\n destroy(component);\n }\n}\n// In Ember 3.12 and earlier, the updateComponent hook was mandatory.\n// As of Ember 3.13, the `args` object is stable and each property of the\n// object participates in the autotrack stack on its own. This means we do not\n// need to set the `args` property on the component instance to invalidate\n// tracked getters that rely on `args`, and therefore don't require the `updateComponent`\n// hook at all.\nif (!true) {\n EmberGlimmerComponentManager.prototype.updateComponent = function updateComponent(component, args) {\n let argSnapshot = args.named;\n if (DEBUG) {\n argSnapshot = Object.freeze(argSnapshot);\n }\n set(component, 'args', argSnapshot);\n };\n}\nexport default EmberGlimmerComponentManager;","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { DEBUG } from '@glimmer/env';\nimport { ARGS_SET } from './component';\n/**\n * This factory function returns a component manager class with common behavior\n * that can be extend to add Glimmer.js- or Ember.js-specific functionality. As\n * these environments converge, the need for two component manager\n * implementations (and thus this factory) should go away.\n */\nexport default function BaseComponentManager(setOwner, getOwner, capabilities) {\n return class {\n static create(attrs) {\n let owner = getOwner(attrs);\n return new this(owner);\n }\n constructor(owner) {\n _defineProperty(this, \"capabilities\", capabilities);\n setOwner(this, owner);\n }\n createComponent(ComponentClass, args) {\n if (DEBUG) {\n ARGS_SET.set(args.named, true);\n }\n return new ComponentClass(getOwner(this), args.named);\n }\n getContext(component) {\n return component;\n }\n };\n}","import { DEBUG } from '@glimmer/env';\nimport { setComponentManager } from '@ember/component';\n\n// Hax because the old version of `@types/ember__component` the `1.x` branch\n// uses does not provide any types for `setComponentManager` *and* because we\n// are using a very old version of `setComponentManager` for versions before\n// Ember 3.8.\n\nimport GlimmerComponentManager from './-private/ember-component-manager';\nimport GlimmerComponentBase from './-private/component';\nlet GlimmerComponent = GlimmerComponentBase;\nif (DEBUG) {\n // Add assertions against using Glimmer.js only APIs\n\n // TODO: Add GlimmerComponent API docs link to these messages once API docs are live\n function throwMethodUseError(methodName) {\n throw new Error(`You attempted to define the '${methodName}' method on a Glimmer Component, but that lifecycle hook does not exist in Ember.js applications, it only exists in Glimmer.js apps. You can rename this method, and you can trigger it using a modifier such as {{did-insert}} from '@ember/render-modifiers': https://github.com/emberjs/ember-render-modifiers.`);\n }\n function throwPropertyUseError(propertyName) {\n throw new Error(`You attempted to access the '${propertyName}' property on a Glimmer Component, but that property does not exist in Ember.js applications, it only exists in Glimmer.js apps. You define a class field with the same name on your component class and it will overwrite this error message, but it will not be used by the framework.`);\n }\n GlimmerComponent = class GlimmerDebugComponent extends GlimmerComponent {\n constructor(owner, args) {\n super(owner, args);\n if (typeof this['didInsertElement'] === 'function') {\n throwMethodUseError('didInsertElement');\n }\n if (typeof this['didUpdate'] === 'function') {\n throwMethodUseError('didUpdate');\n }\n }\n };\n let proto = GlimmerComponent.prototype;\n function defineErrorProp(proto, key, getterMethod) {\n Object.defineProperty(proto, key, {\n get: () => getterMethod(key),\n set(value) {\n Object.defineProperty(this, key, {\n value\n });\n }\n });\n }\n\n // Methods should still throw whenever they are accessed\n defineErrorProp(proto, 'bounds', throwPropertyUseError);\n defineErrorProp(proto, 'element', throwPropertyUseError);\n defineErrorProp(proto, 'debugName', throwPropertyUseError);\n}\nif (true) {\n setComponentManager(owner => {\n return new GlimmerComponentManager(owner);\n }, GlimmerComponent);\n} else {\n setComponentManager('glimmer', GlimmerComponent);\n}\nexport default GlimmerComponent;","import * as metal from \"@ember/-internals/metal\";\n const { cached, tracked } = metal;\n export { cached, tracked };","/* eslint-disable max-lines */\n\nimport { subscribe } from '@ember/instrumentation';\nimport { _backburner, run, scheduleOnce } from '@ember/runloop';\nimport { getOwnConfig, isTesting, macroCondition } from '@embroider/macros';\nimport * as Sentry from '@sentry/browser';\nimport { GLOBAL_OBJ, browserPerformanceTimeOrigin, timestampInSeconds } from '@sentry/utils';\nimport { getActiveSpan, startInactiveSpan } from '..';\nfunction getSentryConfig() {\n const _global = GLOBAL_OBJ;\n _global.__sentryEmberConfig = _global.__sentryEmberConfig ?? {};\n const environmentConfig = getOwnConfig().sentryConfig;\n if (!environmentConfig.sentry) {\n environmentConfig.sentry = {\n browserTracingOptions: {}\n };\n }\n Object.assign(environmentConfig.sentry, _global.__sentryEmberConfig);\n return environmentConfig;\n}\nexport function initialize(appInstance) {\n // Disable in fastboot - we only want to run Sentry client-side\n const fastboot = appInstance.lookup('service:fastboot');\n if (fastboot?.isFastBoot) {\n return;\n }\n const config = getSentryConfig();\n if (config['disablePerformance']) {\n return;\n }\n const performancePromise = instrumentForPerformance(appInstance);\n if (macroCondition(isTesting())) {\n window._sentryPerformanceLoad = performancePromise;\n }\n}\nfunction getBackburner() {\n if (_backburner) {\n return _backburner;\n }\n if (run.backburner) {\n return run.backburner;\n }\n return {\n on() {\n // noop\n },\n off() {\n // noop\n }\n };\n}\nfunction getTransitionInformation(transition, router) {\n const fromRoute = transition?.from?.name;\n const toRoute = transition?.to?.name || router.currentRouteName;\n return {\n fromRoute,\n toRoute\n };\n}\nfunction getLocationURL(location) {\n if (!location || !location.getURL || !location.formatURL) {\n return '';\n }\n const url = location.formatURL(location.getURL());\n if (location.implementation === 'hash') {\n return `${location.rootURL}${url}`;\n }\n return url;\n}\nexport function _instrumentEmberRouter(routerService, routerMain, config, startTransaction, startTransactionOnPageLoad) {\n const {\n disableRunloopPerformance\n } = config;\n const location = routerMain.location;\n let activeTransaction;\n let transitionSpan;\n const url = getLocationURL(location);\n if (macroCondition(isTesting())) {\n routerService._sentryInstrumented = true;\n routerService._startTransaction = startTransaction;\n }\n if (startTransactionOnPageLoad && url) {\n const routeInfo = routerService.recognize(url);\n activeTransaction = startTransaction({\n name: `route:${routeInfo.name}`,\n op: 'pageload',\n origin: 'auto.pageload.ember',\n tags: {\n url,\n toRoute: routeInfo.name,\n 'routing.instrumentation': '@sentry/ember'\n }\n });\n }\n const finishActiveTransaction = (_, nextInstance) => {\n if (nextInstance) {\n return;\n }\n activeTransaction?.end();\n getBackburner().off('end', finishActiveTransaction);\n };\n routerService.on('routeWillChange', transition => {\n const {\n fromRoute,\n toRoute\n } = getTransitionInformation(transition, routerService);\n activeTransaction?.end();\n activeTransaction = startTransaction({\n name: `route:${toRoute}`,\n op: 'navigation',\n origin: 'auto.navigation.ember',\n tags: {\n fromRoute,\n toRoute,\n 'routing.instrumentation': '@sentry/ember'\n }\n });\n transitionSpan = startInactiveSpan({\n op: 'ui.ember.transition',\n name: `route:${fromRoute} -> route:${toRoute}`,\n origin: 'auto.ui.ember'\n });\n });\n routerService.on('routeDidChange', () => {\n if (!transitionSpan || !activeTransaction) {\n return;\n }\n transitionSpan.end();\n if (disableRunloopPerformance) {\n activeTransaction.end();\n return;\n }\n getBackburner().on('end', finishActiveTransaction);\n });\n return {\n startTransaction\n };\n}\nfunction _instrumentEmberRunloop(config) {\n const {\n disableRunloopPerformance,\n minimumRunloopQueueDuration\n } = config;\n if (disableRunloopPerformance) {\n return;\n }\n let currentQueueStart;\n let currentQueueSpan;\n const instrumentedEmberQueues = ['actions', 'routerTransitions', 'render', 'afterRender', 'destroy'];\n getBackburner().on('begin', (_, previousInstance) => {\n if (previousInstance) {\n return;\n }\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n return;\n }\n if (currentQueueSpan) {\n currentQueueSpan.end();\n }\n currentQueueStart = timestampInSeconds();\n const processQueue = queue => {\n // Process this queue using the end of the previous queue.\n if (currentQueueStart) {\n const now = timestampInSeconds();\n const minQueueDuration = minimumRunloopQueueDuration ?? 5;\n if ((now - currentQueueStart) * 1000 >= minQueueDuration) {\n startInactiveSpan({\n name: 'runloop',\n op: `ui.ember.runloop.${queue}`,\n origin: 'auto.ui.ember',\n startTimestamp: currentQueueStart\n })?.end(now);\n }\n currentQueueStart = undefined;\n }\n\n // Setup for next queue\n\n const stillActiveSpan = getActiveSpan();\n if (!stillActiveSpan) {\n return;\n }\n currentQueueStart = timestampInSeconds();\n };\n instrumentedEmberQueues.forEach(queue => {\n scheduleOnce(queue, null, processQueue, queue);\n });\n });\n getBackburner().on('end', (_, nextInstance) => {\n if (nextInstance) {\n return;\n }\n if (currentQueueSpan) {\n currentQueueSpan.end();\n currentQueueSpan = undefined;\n }\n });\n}\nfunction processComponentRenderBefore(payload, beforeEntries) {\n const info = {\n payload,\n now: timestampInSeconds()\n };\n beforeEntries[payload.object] = info;\n}\nfunction processComponentRenderAfter(payload, beforeEntries, op, minComponentDuration) {\n const begin = beforeEntries[payload.object];\n if (!begin) {\n return;\n }\n const now = timestampInSeconds();\n const componentRenderDuration = now - begin.now;\n if (componentRenderDuration * 1000 >= minComponentDuration) {\n startInactiveSpan({\n name: payload.containerKey || payload.object,\n op,\n origin: 'auto.ui.ember',\n startTimestamp: begin.now\n })?.end(now);\n }\n}\nfunction _instrumentComponents(config) {\n const {\n disableInstrumentComponents,\n minimumComponentRenderDuration,\n enableComponentDefinitions\n } = config;\n if (disableInstrumentComponents) {\n return;\n }\n const minComponentDuration = minimumComponentRenderDuration ?? 2;\n const beforeEntries = {};\n const beforeComponentDefinitionEntries = {};\n function _subscribeToRenderEvents() {\n subscribe('render.component', {\n before(_name, _timestamp, payload) {\n processComponentRenderBefore(payload, beforeEntries);\n },\n after(_name, _timestamp, payload, _beganIndex) {\n processComponentRenderAfter(payload, beforeEntries, 'ui.ember.component.render', minComponentDuration);\n }\n });\n if (enableComponentDefinitions) {\n subscribe('render.getComponentDefinition', {\n before(_name, _timestamp, payload) {\n processComponentRenderBefore(payload, beforeComponentDefinitionEntries);\n },\n after(_name, _timestamp, payload, _beganIndex) {\n processComponentRenderAfter(payload, beforeComponentDefinitionEntries, 'ui.ember.component.definition', 0);\n }\n });\n }\n }\n _subscribeToRenderEvents();\n}\nfunction _instrumentInitialLoad(config) {\n const startName = '@sentry/ember:initial-load-start';\n const endName = '@sentry/ember:initial-load-end';\n const {\n HAS_PERFORMANCE,\n HAS_PERFORMANCE_TIMING\n } = _hasPerformanceSupport();\n if (!HAS_PERFORMANCE) {\n return;\n }\n const {\n performance\n } = window;\n if (config.disableInitialLoadInstrumentation) {\n performance.clearMarks(startName);\n performance.clearMarks(endName);\n return;\n }\n\n // Split performance check in two so clearMarks still happens even if timeOrigin isn't available.\n if (!HAS_PERFORMANCE_TIMING || browserPerformanceTimeOrigin === undefined) {\n return;\n }\n const measureName = '@sentry/ember:initial-load';\n const startMarkExists = performance.getEntriesByName(startName).length > 0;\n const endMarkExists = performance.getEntriesByName(endName).length > 0;\n if (!startMarkExists || !endMarkExists) {\n return;\n }\n performance.measure(measureName, startName, endName);\n const measures = performance.getEntriesByName(measureName);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const measure = measures[0];\n const startTimestamp = (measure.startTime + browserPerformanceTimeOrigin) / 1000;\n const endTimestamp = startTimestamp + measure.duration / 1000;\n startInactiveSpan({\n op: 'ui.ember.init',\n name: 'init',\n origin: 'auto.ui.ember',\n startTimestamp\n })?.end(endTimestamp);\n performance.clearMarks(startName);\n performance.clearMarks(endName);\n performance.clearMeasures(measureName);\n}\nfunction _hasPerformanceSupport() {\n // TS says that all of these methods are always available, but some of them may not be supported in older browsers\n // So we \"pretend\" they are all optional in order to be able to check this properly without TS complaining\n const _performance = window.performance;\n const HAS_PERFORMANCE = Boolean(_performance && _performance.clearMarks && _performance.clearMeasures);\n const HAS_PERFORMANCE_TIMING = Boolean(_performance.measure && _performance.getEntriesByName && browserPerformanceTimeOrigin !== undefined);\n return {\n HAS_PERFORMANCE,\n HAS_PERFORMANCE_TIMING\n };\n}\nexport async function instrumentForPerformance(appInstance) {\n const config = getSentryConfig();\n // Maintaining backwards compatibility with config.browserTracingOptions, but passing it with Sentry options is preferred.\n const browserTracingOptions = config.browserTracingOptions || config.sentry.browserTracingOptions || {};\n const {\n BrowserTracing\n } = await import('@sentry/browser');\n const idleTimeout = config.transitionTimeout || 5000;\n const browserTracing = new BrowserTracing({\n routingInstrumentation: (customStartTransaction, startTransactionOnPageLoad) => {\n // eslint-disable-next-line ember/no-private-routing-service\n const routerMain = appInstance.lookup('router:main');\n let routerService = appInstance.lookup('service:router');\n if (routerService.externalRouter) {\n // Using ember-engines-router-service in an engine.\n routerService = routerService.externalRouter;\n }\n if (routerService._hasMountedSentryPerformanceRouting) {\n // Routing listens to route changes on the main router, and should not be initialized multiple times per page.\n return;\n }\n if (!routerService.recognize) {\n // Router is missing critical functionality to limit cardinality of the transaction names.\n return;\n }\n routerService._hasMountedSentryPerformanceRouting = true;\n _instrumentEmberRouter(routerService, routerMain, config, customStartTransaction, startTransactionOnPageLoad);\n },\n idleTimeout,\n ...browserTracingOptions\n });\n if (macroCondition(isTesting())) {\n const client = Sentry.getCurrentHub().getClient();\n if (client && client.getIntegrationById && client.getIntegrationById('BrowserTracing')) {\n // Initializers are called more than once in tests, causing the integrations to not be setup correctly.\n return;\n }\n }\n const client = Sentry.getCurrentHub().getClient();\n if (client && client.addIntegration) {\n client.addIntegration(browserTracing);\n }\n _instrumentEmberRunloop(config);\n _instrumentComponents(config);\n _instrumentInitialLoad(config);\n}\nexport default {\n initialize\n};","import type { DsnComponents, DsnLike, DsnProtocol } from '@sentry/types';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { consoleSandbox, logger } from './logger';\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+)?)?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\nfunction isValidProtocol(protocol?: string): protocol is DsnProtocol {\n return protocol === 'http' || protocol === 'https';\n}\n\n/**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\nexport function dsnToString(dsn: DsnComponents, withPassword: boolean = false): string {\n const { host, path, pass, port, projectId, protocol, publicKey } = dsn;\n return (\n `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +\n `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n );\n}\n\n/**\n * Parses a Dsn from a given string.\n *\n * @param str A Dsn as string\n * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string\n */\nexport function dsnFromString(str: string): DsnComponents | undefined {\n const match = DSN_REGEX.exec(str);\n\n if (!match) {\n // This should be logged to the console\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(`Invalid Sentry Dsn: ${str}`);\n });\n return undefined;\n }\n\n const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);\n let path = '';\n let projectId = lastPath;\n\n const split = projectId.split('/');\n if (split.length > 1) {\n path = split.slice(0, -1).join('/');\n projectId = split.pop() as string;\n }\n\n if (projectId) {\n const projectMatch = projectId.match(/^\\d+/);\n if (projectMatch) {\n projectId = projectMatch[0];\n }\n }\n\n return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol as DsnProtocol, publicKey });\n}\n\nfunction dsnFromComponents(components: DsnComponents): DsnComponents {\n return {\n protocol: components.protocol,\n publicKey: components.publicKey || '',\n pass: components.pass || '',\n host: components.host,\n port: components.port || '',\n path: components.path || '',\n projectId: components.projectId,\n };\n}\n\nfunction validateDsn(dsn: DsnComponents): boolean {\n if (!DEBUG_BUILD) {\n return true;\n }\n\n const { port, projectId, protocol } = dsn;\n\n const requiredComponents: ReadonlyArray = ['protocol', 'publicKey', 'host', 'projectId'];\n const hasMissingRequiredComponent = requiredComponents.find(component => {\n if (!dsn[component]) {\n logger.error(`Invalid Sentry Dsn: ${component} missing`);\n return true;\n }\n return false;\n });\n\n if (hasMissingRequiredComponent) {\n return false;\n }\n\n if (!projectId.match(/^\\d+$/)) {\n logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);\n return false;\n }\n\n if (!isValidProtocol(protocol)) {\n logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);\n return false;\n }\n\n if (port && isNaN(parseInt(port, 10))) {\n logger.error(`Invalid Sentry Dsn: Invalid port ${port}`);\n return false;\n }\n\n return true;\n}\n\n/**\n * Creates a valid Sentry Dsn object, identifying a Sentry instance and project.\n * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source\n */\nexport function makeDsn(from: DsnLike): DsnComponents | undefined {\n const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);\n if (!components || !validateDsn(components)) {\n return undefined;\n }\n return components;\n}\n","import type {\n Attachment,\n AttachmentItem,\n BaseEnvelopeHeaders,\n BaseEnvelopeItemHeaders,\n DataCategory,\n DsnComponents,\n Envelope,\n EnvelopeItemType,\n Event,\n EventEnvelopeHeaders,\n SdkInfo,\n SdkMetadata,\n TextEncoderInternal,\n} from '@sentry/types';\n\nimport { dsnToString } from './dsn';\nimport { normalize } from './normalize';\nimport { dropUndefinedKeys } from './object';\n\n/**\n * Creates an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nexport function createEnvelope(headers: E[0], items: E[1] = []): E {\n return [headers, items] as E;\n}\n\n/**\n * Add an item to an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nexport function addItemToEnvelope(envelope: E, newItem: E[1][number]): E {\n const [headers, items] = envelope;\n return [headers, [...items, newItem]] as unknown as E;\n}\n\n/**\n * Convenience function to loop through the items and item types of an envelope.\n * (This function was mostly created because working with envelope types is painful at the moment)\n *\n * If the callback returns true, the rest of the items will be skipped.\n */\nexport function forEachEnvelopeItem(\n envelope: Envelope,\n callback: (envelopeItem: E[1][number], envelopeItemType: E[1][number][0]['type']) => boolean | void,\n): boolean {\n const envelopeItems = envelope[1];\n\n for (const envelopeItem of envelopeItems) {\n const envelopeItemType = envelopeItem[0].type;\n const result = callback(envelopeItem, envelopeItemType);\n\n if (result) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Returns true if the envelope contains any of the given envelope item types\n */\nexport function envelopeContainsItemType(envelope: Envelope, types: EnvelopeItemType[]): boolean {\n return forEachEnvelopeItem(envelope, (_, type) => types.includes(type));\n}\n\n/**\n * Encode a string to UTF8.\n */\nfunction encodeUTF8(input: string, textEncoder?: TextEncoderInternal): Uint8Array {\n const utf8 = textEncoder || new TextEncoder();\n return utf8.encode(input);\n}\n\n/**\n * Serializes an envelope.\n */\nexport function serializeEnvelope(envelope: Envelope, textEncoder?: TextEncoderInternal): string | Uint8Array {\n const [envHeaders, items] = envelope;\n\n // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data\n let parts: string | Uint8Array[] = JSON.stringify(envHeaders);\n\n function append(next: string | Uint8Array): void {\n if (typeof parts === 'string') {\n parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts, textEncoder), next];\n } else {\n parts.push(typeof next === 'string' ? encodeUTF8(next, textEncoder) : next);\n }\n }\n\n for (const item of items) {\n const [itemHeaders, payload] = item;\n\n append(`\\n${JSON.stringify(itemHeaders)}\\n`);\n\n if (typeof payload === 'string' || payload instanceof Uint8Array) {\n append(payload);\n } else {\n let stringifiedPayload: string;\n try {\n stringifiedPayload = JSON.stringify(payload);\n } catch (e) {\n // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.strinify()` still\n // fails, we try again after normalizing it again with infinite normalization depth. This of course has a\n // performance impact but in this case a performance hit is better than throwing.\n stringifiedPayload = JSON.stringify(normalize(payload));\n }\n append(stringifiedPayload);\n }\n }\n\n return typeof parts === 'string' ? parts : concatBuffers(parts);\n}\n\nfunction concatBuffers(buffers: Uint8Array[]): Uint8Array {\n const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);\n\n const merged = new Uint8Array(totalLength);\n let offset = 0;\n for (const buffer of buffers) {\n merged.set(buffer, offset);\n offset += buffer.length;\n }\n\n return merged;\n}\n\nexport interface TextDecoderInternal {\n decode(input?: Uint8Array): string;\n}\n\n/**\n * Parses an envelope\n */\nexport function parseEnvelope(\n env: string | Uint8Array,\n textEncoder: TextEncoderInternal,\n textDecoder: TextDecoderInternal,\n): Envelope {\n let buffer = typeof env === 'string' ? textEncoder.encode(env) : env;\n\n function readBinary(length: number): Uint8Array {\n const bin = buffer.subarray(0, length);\n // Replace the buffer with the remaining data excluding trailing newline\n buffer = buffer.subarray(length + 1);\n return bin;\n }\n\n function readJson(): T {\n let i = buffer.indexOf(0xa);\n // If we couldn't find a newline, we must have found the end of the buffer\n if (i < 0) {\n i = buffer.length;\n }\n\n return JSON.parse(textDecoder.decode(readBinary(i))) as T;\n }\n\n const envelopeHeader = readJson();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const items: [any, any][] = [];\n\n while (buffer.length) {\n const itemHeader = readJson();\n const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined;\n\n items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]);\n }\n\n return [envelopeHeader, items];\n}\n\n/**\n * Creates attachment envelope items\n */\nexport function createAttachmentEnvelopeItem(\n attachment: Attachment,\n textEncoder?: TextEncoderInternal,\n): AttachmentItem {\n const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;\n\n return [\n dropUndefinedKeys({\n type: 'attachment',\n length: buffer.length,\n filename: attachment.filename,\n content_type: attachment.contentType,\n attachment_type: attachment.attachmentType,\n }),\n buffer,\n ];\n}\n\nconst ITEM_TYPE_TO_DATA_CATEGORY_MAP: Record = {\n session: 'session',\n sessions: 'session',\n attachment: 'attachment',\n transaction: 'transaction',\n event: 'error',\n client_report: 'internal',\n user_report: 'default',\n profile: 'profile',\n replay_event: 'replay',\n replay_recording: 'replay',\n check_in: 'monitor',\n feedback: 'feedback',\n // TODO: This is a temporary workaround until we have a proper data category for metrics\n statsd: 'unknown',\n};\n\n/**\n * Maps the type of an envelope item to a data category.\n */\nexport function envelopeItemTypeToDataCategory(type: EnvelopeItemType): DataCategory {\n return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type];\n}\n\n/** Extracts the minimal SDK info from from the metadata or an events */\nexport function getSdkMetadataForEnvelopeHeader(metadataOrEvent?: SdkMetadata | Event): SdkInfo | undefined {\n if (!metadataOrEvent || !metadataOrEvent.sdk) {\n return;\n }\n const { name, version } = metadataOrEvent.sdk;\n return { name, version };\n}\n\n/**\n * Creates event envelope headers, based on event, sdk info and tunnel\n * Note: This function was extracted from the core package to make it available in Replay\n */\nexport function createEventEnvelopeHeaders(\n event: Event,\n sdkInfo: SdkInfo | undefined,\n tunnel: string | undefined,\n dsn?: DsnComponents,\n): EventEnvelopeHeaders {\n const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext;\n return {\n event_id: event.event_id as string,\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n ...(dynamicSamplingContext && {\n trace: dropUndefinedKeys({ ...dynamicSamplingContext }),\n }),\n };\n}\n","import type { ConsoleLevel } from '@sentry/types';\n\n/** An error emitted by Sentry SDKs and related utilities. */\nexport class SentryError extends Error {\n /** Display name of this error instance. */\n public name: string;\n\n public logLevel: ConsoleLevel;\n\n public constructor(public message: string, logLevel: ConsoleLevel = 'warn') {\n super(message);\n\n this.name = new.target.prototype.constructor.name;\n // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line\n // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes\n // instances of `SentryError` fail `obj instanceof SentryError` checks.\n Object.setPrototypeOf(this, new.target.prototype);\n this.logLevel = logLevel;\n }\n}\n","import type { ClientOptions, DsnComponents, DsnLike, SdkInfo } from '@sentry/types';\nimport { dsnToString, makeDsn, urlEncode } from '@sentry/utils';\n\nconst SENTRY_API_VERSION = '7';\n\n/** Returns the prefix to construct Sentry ingestion API endpoints. */\nfunction getBaseApiEndpoint(dsn: DsnComponents): string {\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}\n\n/** Returns the ingest API endpoint for target. */\nfunction _getIngestEndpoint(dsn: DsnComponents): string {\n return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;\n}\n\n/** Returns a URL-encoded string with auth config suitable for a query string. */\nfunction _encodedAuth(dsn: DsnComponents, sdkInfo: SdkInfo | undefined): string {\n return urlEncode({\n // We send only the minimum set of required information. See\n // https://github.com/getsentry/sentry-javascript/issues/2572.\n sentry_key: dsn.publicKey,\n sentry_version: SENTRY_API_VERSION,\n ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }),\n });\n}\n\n/**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\nexport function getEnvelopeEndpointWithUrlEncodedAuth(\n dsn: DsnComponents,\n // TODO (v8): Remove `tunnelOrOptions` in favor of `options`, and use the substitute code below\n // options: ClientOptions = {} as ClientOptions,\n tunnelOrOptions: string | ClientOptions = {} as ClientOptions,\n): string {\n // TODO (v8): Use this code instead\n // const { tunnel, _metadata = {} } = options;\n // return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, _metadata.sdk)}`;\n\n const tunnel = typeof tunnelOrOptions === 'string' ? tunnelOrOptions : tunnelOrOptions.tunnel;\n const sdkInfo =\n typeof tunnelOrOptions === 'string' || !tunnelOrOptions._metadata ? undefined : tunnelOrOptions._metadata.sdk;\n\n return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;\n}\n\n/** Returns the url to the report dialog endpoint. */\nexport function getReportDialogEndpoint(\n dsnLike: DsnLike,\n dialogOptions: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n user?: { name?: string; email?: string };\n },\n): string {\n const dsn = makeDsn(dsnLike);\n if (!dsn) {\n return '';\n }\n\n const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;\n\n let encodedOptions = `dsn=${dsnToString(dsn)}`;\n for (const key in dialogOptions) {\n if (key === 'dsn') {\n continue;\n }\n\n if (key === 'onClose') {\n continue;\n }\n\n if (key === 'user') {\n const user = dialogOptions.user;\n if (!user) {\n continue;\n }\n if (user.name) {\n encodedOptions += `&name=${encodeURIComponent(user.name)}`;\n }\n if (user.email) {\n encodedOptions += `&email=${encodeURIComponent(user.email)}`;\n }\n } else {\n encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] as string)}`;\n }\n }\n\n return `${endpoint}?${encodedOptions}`;\n}\n","/* eslint-disable max-lines */\nimport type {\n Breadcrumb,\n BreadcrumbHint,\n Client,\n ClientOptions,\n DataCategory,\n DsnComponents,\n DynamicSamplingContext,\n Envelope,\n ErrorEvent,\n Event,\n EventDropReason,\n EventHint,\n EventProcessor,\n FeedbackEvent,\n Integration,\n IntegrationClass,\n MetricBucketItem,\n MetricsAggregator,\n Outcome,\n ParameterizedString,\n PropagationContext,\n SdkMetadata,\n Session,\n SessionAggregates,\n Severity,\n SeverityLevel,\n Transaction,\n TransactionEvent,\n Transport,\n TransportMakeRequestResponse,\n} from '@sentry/types';\nimport {\n SentryError,\n SyncPromise,\n addItemToEnvelope,\n checkOrSetAlreadyCaught,\n createAttachmentEnvelopeItem,\n isParameterizedString,\n isPlainObject,\n isPrimitive,\n isThenable,\n logger,\n makeDsn,\n rejectedSyncPromise,\n resolvedSyncPromise,\n} from '@sentry/utils';\n\nimport { getEnvelopeEndpointWithUrlEncodedAuth } from './api';\nimport { DEBUG_BUILD } from './debug-build';\nimport { createEventEnvelope, createSessionEnvelope } from './envelope';\nimport { getClient } from './exports';\nimport { getIsolationScope } from './hub';\nimport type { IntegrationIndex } from './integration';\nimport { setupIntegration, setupIntegrations } from './integration';\nimport { createMetricEnvelope } from './metrics/envelope';\nimport type { Scope } from './scope';\nimport { updateSession } from './session';\nimport { getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext';\nimport { prepareEvent } from './utils/prepareEvent';\n\nconst ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient {\n * public constructor(options: NodeOptions) {\n * super(options);\n * }\n *\n * // ...\n * }\n */\nexport abstract class BaseClient implements Client {\n /**\n * A reference to a metrics aggregator\n *\n * @experimental Note this is alpha API. It may experience breaking changes in the future.\n */\n public metricsAggregator?: MetricsAggregator;\n\n /** Options passed to the SDK. */\n protected readonly _options: O;\n\n /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n protected readonly _dsn?: DsnComponents;\n\n protected readonly _transport?: Transport;\n\n /** Array of set up integrations. */\n protected _integrations: IntegrationIndex;\n\n /** Indicates whether this client's integrations have been set up. */\n protected _integrationsInitialized: boolean;\n\n /** Number of calls being processed */\n protected _numProcessing: number;\n\n protected _eventProcessors: EventProcessor[];\n\n /** Holds flushable */\n private _outcomes: { [key: string]: number };\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n private _hooks: Record;\n\n /**\n * Initializes this client instance.\n *\n * @param options Options for the client.\n */\n protected constructor(options: O) {\n this._options = options;\n this._integrations = {};\n this._integrationsInitialized = false;\n this._numProcessing = 0;\n this._outcomes = {};\n this._hooks = {};\n this._eventProcessors = [];\n\n if (options.dsn) {\n this._dsn = makeDsn(options.dsn);\n } else {\n DEBUG_BUILD && logger.warn('No DSN provided, client will not send events.');\n }\n\n if (this._dsn) {\n const url = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);\n this._transport = options.transport({\n recordDroppedEvent: this.recordDroppedEvent.bind(this),\n ...options.transportOptions,\n url,\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n public captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined {\n // ensure we haven't captured this very object before\n if (checkOrSetAlreadyCaught(exception)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n let eventId: string | undefined = hint && hint.event_id;\n\n this._process(\n this.eventFromException(exception, hint)\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureMessage(\n message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n level?: Severity | SeverityLevel,\n hint?: EventHint,\n scope?: Scope,\n ): string | undefined {\n let eventId: string | undefined = hint && hint.event_id;\n\n const eventMessage = isParameterizedString(message) ? message : String(message);\n\n const promisedEvent = isPrimitive(message)\n ? this.eventFromMessage(eventMessage, level, hint)\n : this.eventFromException(message, hint);\n\n this._process(\n promisedEvent\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined {\n // ensure we haven't captured this very object before\n if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n let eventId: string | undefined = hint && hint.event_id;\n\n this._process(\n this._captureEvent(event, hint, scope).then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureSession(session: Session): void {\n if (!(typeof session.release === 'string')) {\n DEBUG_BUILD && logger.warn('Discarded session because of missing or non-string release');\n } else {\n this.sendSession(session);\n // After sending, we set init false to indicate it's not the first occurrence\n updateSession(session, { init: false });\n }\n }\n\n /**\n * @inheritDoc\n */\n public getDsn(): DsnComponents | undefined {\n return this._dsn;\n }\n\n /**\n * @inheritDoc\n */\n public getOptions(): O {\n return this._options;\n }\n\n /**\n * @see SdkMetadata in @sentry/types\n *\n * @return The metadata of the SDK\n */\n public getSdkMetadata(): SdkMetadata | undefined {\n return this._options._metadata;\n }\n\n /**\n * @inheritDoc\n */\n public getTransport(): Transport | undefined {\n return this._transport;\n }\n\n /**\n * @inheritDoc\n */\n public flush(timeout?: number): PromiseLike {\n const transport = this._transport;\n if (transport) {\n if (this.metricsAggregator) {\n this.metricsAggregator.flush();\n }\n return this._isClientDoneProcessing(timeout).then(clientFinished => {\n return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed);\n });\n } else {\n return resolvedSyncPromise(true);\n }\n }\n\n /**\n * @inheritDoc\n */\n public close(timeout?: number): PromiseLike {\n return this.flush(timeout).then(result => {\n this.getOptions().enabled = false;\n if (this.metricsAggregator) {\n this.metricsAggregator.close();\n }\n return result;\n });\n }\n\n /** Get all installed event processors. */\n public getEventProcessors(): EventProcessor[] {\n return this._eventProcessors;\n }\n\n /** @inheritDoc */\n public addEventProcessor(eventProcessor: EventProcessor): void {\n this._eventProcessors.push(eventProcessor);\n }\n\n /**\n * Sets up the integrations\n */\n public setupIntegrations(forceInitialize?: boolean): void {\n if ((forceInitialize && !this._integrationsInitialized) || (this._isEnabled() && !this._integrationsInitialized)) {\n this._integrations = setupIntegrations(this, this._options.integrations);\n this._integrationsInitialized = true;\n }\n }\n\n /**\n * Gets an installed integration by its `id`.\n *\n * @returns The installed integration or `undefined` if no integration with that `id` was installed.\n */\n public getIntegrationById(integrationId: string): Integration | undefined {\n return this._integrations[integrationId];\n }\n\n /**\n * @inheritDoc\n */\n public getIntegration(integration: IntegrationClass): T | null {\n try {\n return (this._integrations[integration.id] as T) || null;\n } catch (_oO) {\n DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);\n return null;\n }\n }\n\n /**\n * @inheritDoc\n */\n public addIntegration(integration: Integration): void {\n setupIntegration(this, integration, this._integrations);\n }\n\n /**\n * @inheritDoc\n */\n public sendEvent(event: Event, hint: EventHint = {}): void {\n this.emit('beforeSendEvent', event, hint);\n\n let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);\n\n for (const attachment of hint.attachments || []) {\n env = addItemToEnvelope(\n env,\n createAttachmentEnvelopeItem(\n attachment,\n this._options.transportOptions && this._options.transportOptions.textEncoder,\n ),\n );\n }\n\n const promise = this._sendEnvelope(env);\n if (promise) {\n promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null);\n }\n }\n\n /**\n * @inheritDoc\n */\n public sendSession(session: Session | SessionAggregates): void {\n const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(env);\n }\n\n /**\n * @inheritDoc\n */\n public recordDroppedEvent(reason: EventDropReason, category: DataCategory, _event?: Event): void {\n // Note: we use `event` in replay, where we overwrite this hook.\n\n if (this._options.sendClientReports) {\n // We want to track each category (error, transaction, session, replay_event) separately\n // but still keep the distinction between different type of outcomes.\n // We could use nested maps, but it's much easier to read and type this way.\n // A correct type for map-based implementation if we want to go that route\n // would be `Partial>>>`\n // With typescript 4.1 we could even use template literal types\n const key = `${reason}:${category}`;\n DEBUG_BUILD && logger.log(`Adding outcome: \"${key}\"`);\n\n // The following works because undefined + 1 === NaN and NaN is falsy\n this._outcomes[key] = this._outcomes[key] + 1 || 1;\n }\n }\n\n /**\n * @inheritDoc\n */\n public captureAggregateMetrics(metricBucketItems: Array): void {\n DEBUG_BUILD && logger.log(`Flushing aggregated metrics, number of metrics: ${metricBucketItems.length}`);\n const metricsEnvelope = createMetricEnvelope(\n metricBucketItems,\n this._dsn,\n this._options._metadata,\n this._options.tunnel,\n );\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(metricsEnvelope);\n }\n\n // Keep on() & emit() signatures in sync with types' client.ts interface\n /* eslint-disable @typescript-eslint/unified-signatures */\n\n /** @inheritdoc */\n public on(hook: 'startTransaction', callback: (transaction: Transaction) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'finishTransaction', callback: (transaction: Transaction) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'beforeEnvelope', callback: (envelope: Envelope) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'beforeSendEvent', callback: (event: Event, hint?: EventHint) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'preprocessEvent', callback: (event: Event, hint?: EventHint) => void): void;\n\n /** @inheritdoc */\n public on(\n hook: 'afterSendEvent',\n callback: (event: Event, sendResponse: TransportMakeRequestResponse | void) => void,\n ): void;\n\n /** @inheritdoc */\n public on(hook: 'beforeAddBreadcrumb', callback: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'createDsc', callback: (dsc: DynamicSamplingContext) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'otelSpanEnd', callback: (otelSpan: unknown, mutableOptions: { drop: boolean }) => void): void;\n\n /** @inheritdoc */\n public on(\n hook: 'beforeSendFeedback',\n callback: (feedback: FeedbackEvent, options?: { includeReplay: boolean }) => void,\n ): void;\n\n /** @inheritdoc */\n public on(hook: string, callback: unknown): void {\n if (!this._hooks[hook]) {\n this._hooks[hook] = [];\n }\n\n // @ts-expect-error We assue the types are correct\n this._hooks[hook].push(callback);\n }\n\n /** @inheritdoc */\n public emit(hook: 'startTransaction', transaction: Transaction): void;\n\n /** @inheritdoc */\n public emit(hook: 'finishTransaction', transaction: Transaction): void;\n\n /** @inheritdoc */\n public emit(hook: 'beforeEnvelope', envelope: Envelope): void;\n\n /** @inheritdoc */\n public emit(hook: 'beforeSendEvent', event: Event, hint?: EventHint): void;\n\n /** @inheritdoc */\n public emit(hook: 'preprocessEvent', event: Event, hint?: EventHint): void;\n\n /** @inheritdoc */\n public emit(hook: 'afterSendEvent', event: Event, sendResponse: TransportMakeRequestResponse | void): void;\n\n /** @inheritdoc */\n public emit(hook: 'beforeAddBreadcrumb', breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;\n\n /** @inheritdoc */\n public emit(hook: 'createDsc', dsc: DynamicSamplingContext): void;\n\n /** @inheritdoc */\n public emit(hook: 'otelSpanEnd', otelSpan: unknown, mutableOptions: { drop: boolean }): void;\n\n /** @inheritdoc */\n public emit(hook: 'beforeSendFeedback', feedback: FeedbackEvent, options?: { includeReplay: boolean }): void;\n\n /** @inheritdoc */\n public emit(hook: string, ...rest: unknown[]): void {\n if (this._hooks[hook]) {\n this._hooks[hook].forEach(callback => callback(...rest));\n }\n }\n\n /* eslint-enable @typescript-eslint/unified-signatures */\n\n /** Updates existing session based on the provided event */\n protected _updateSessionFromEvent(session: Session, event: Event): void {\n let crashed = false;\n let errored = false;\n const exceptions = event.exception && event.exception.values;\n\n if (exceptions) {\n errored = true;\n\n for (const ex of exceptions) {\n const mechanism = ex.mechanism;\n if (mechanism && mechanism.handled === false) {\n crashed = true;\n break;\n }\n }\n }\n\n // A session is updated and that session update is sent in only one of the two following scenarios:\n // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update\n // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update\n const sessionNonTerminal = session.status === 'ok';\n const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);\n\n if (shouldUpdateAndSend) {\n updateSession(session, {\n ...(crashed && { status: 'crashed' }),\n errors: session.errors || Number(errored || crashed),\n });\n this.captureSession(session);\n }\n }\n\n /**\n * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying\n * \"no\" (resolving to `false`) in order to give the client a chance to potentially finish first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not\n * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and\n * `false` otherwise\n */\n protected _isClientDoneProcessing(timeout?: number): PromiseLike {\n return new SyncPromise(resolve => {\n let ticked: number = 0;\n const tick: number = 1;\n\n const interval = setInterval(() => {\n if (this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n }\n\n /** Determines whether this SDK is enabled and a transport is present. */\n protected _isEnabled(): boolean {\n return this.getOptions().enabled !== false && this._transport !== undefined;\n }\n\n /**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n */\n protected _prepareEvent(\n event: Event,\n hint: EventHint,\n scope?: Scope,\n isolationScope = getIsolationScope(),\n ): PromiseLike {\n const options = this.getOptions();\n const integrations = Object.keys(this._integrations);\n if (!hint.integrations && integrations.length > 0) {\n hint.integrations = integrations;\n }\n\n this.emit('preprocessEvent', event, hint);\n\n return prepareEvent(options, event, hint, scope, this, isolationScope).then(evt => {\n if (evt === null) {\n return evt;\n }\n\n // If a trace context is not set on the event, we use the propagationContext set on the event to\n // generate a trace context. If the propagationContext does not have a dynamic sampling context, we\n // also generate one for it.\n const { propagationContext } = evt.sdkProcessingMetadata || {};\n const trace = evt.contexts && evt.contexts.trace;\n if (!trace && propagationContext) {\n const { traceId: trace_id, spanId, parentSpanId, dsc } = propagationContext as PropagationContext;\n evt.contexts = {\n trace: {\n trace_id,\n span_id: spanId,\n parent_span_id: parentSpanId,\n },\n ...evt.contexts,\n };\n\n const dynamicSamplingContext = dsc ? dsc : getDynamicSamplingContextFromClient(trace_id, this, scope);\n\n evt.sdkProcessingMetadata = {\n dynamicSamplingContext,\n ...evt.sdkProcessingMetadata,\n };\n }\n return evt;\n });\n }\n\n /**\n * Processes the event and logs an error in case of rejection\n * @param event\n * @param hint\n * @param scope\n */\n protected _captureEvent(event: Event, hint: EventHint = {}, scope?: Scope): PromiseLike {\n return this._processEvent(event, hint, scope).then(\n finalEvent => {\n return finalEvent.event_id;\n },\n reason => {\n if (DEBUG_BUILD) {\n // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for\n // control flow, log just the message (no stack) as a log-level log.\n const sentryError = reason as SentryError;\n if (sentryError.logLevel === 'log') {\n logger.log(sentryError.message);\n } else {\n logger.warn(sentryError);\n }\n }\n return undefined;\n },\n );\n }\n\n /**\n * Processes an event (either error or message) and sends it to Sentry.\n *\n * This also adds breadcrumbs and context information to the event. However,\n * platform specific meta data (such as the User's IP address) must be added\n * by the SDK implementor.\n *\n *\n * @param event The event to send to Sentry.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n */\n protected _processEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike {\n const options = this.getOptions();\n const { sampleRate } = options;\n\n const isTransaction = isTransactionEvent(event);\n const isError = isErrorEvent(event);\n const eventType = event.type || 'error';\n const beforeSendLabel = `before send for type \\`${eventType}\\``;\n\n // 1.0 === 100% events are sent\n // 0.0 === 0% events are sent\n // Sampling for transaction happens somewhere else\n if (isError && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n this.recordDroppedEvent('sample_rate', 'error', event);\n return rejectedSyncPromise(\n new SentryError(\n `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,\n 'log',\n ),\n );\n }\n\n const dataCategory: DataCategory = eventType === 'replay_event' ? 'replay' : eventType;\n\n return this._prepareEvent(event, hint, scope)\n .then(prepared => {\n if (prepared === null) {\n this.recordDroppedEvent('event_processor', dataCategory, event);\n throw new SentryError('An event processor returned `null`, will not send event.', 'log');\n }\n\n const isInternalException = hint.data && (hint.data as { __sentry__: boolean }).__sentry__ === true;\n if (isInternalException) {\n return prepared;\n }\n\n const result = processBeforeSend(options, prepared, hint);\n return _validateBeforeSendResult(result, beforeSendLabel);\n })\n .then(processedEvent => {\n if (processedEvent === null) {\n this.recordDroppedEvent('before_send', dataCategory, event);\n throw new SentryError(`${beforeSendLabel} returned \\`null\\`, will not send event.`, 'log');\n }\n\n const session = scope && scope.getSession();\n if (!isTransaction && session) {\n this._updateSessionFromEvent(session, processedEvent);\n }\n\n // None of the Sentry built event processor will update transaction name,\n // so if the transaction name has been changed by an event processor, we know\n // it has to come from custom event processor added by a user\n const transactionInfo = processedEvent.transaction_info;\n if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {\n const source = 'custom';\n processedEvent.transaction_info = {\n ...transactionInfo,\n source,\n };\n }\n\n this.sendEvent(processedEvent, hint);\n return processedEvent;\n })\n .then(null, reason => {\n if (reason instanceof SentryError) {\n throw reason;\n }\n\n this.captureException(reason, {\n data: {\n __sentry__: true,\n },\n originalException: reason,\n });\n throw new SentryError(\n `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n );\n });\n }\n\n /**\n * Occupies the client with processing and event\n */\n protected _process(promise: PromiseLike): void {\n this._numProcessing++;\n void promise.then(\n value => {\n this._numProcessing--;\n return value;\n },\n reason => {\n this._numProcessing--;\n return reason;\n },\n );\n }\n\n /**\n * @inheritdoc\n */\n protected _sendEnvelope(envelope: Envelope): PromiseLike | void {\n this.emit('beforeEnvelope', envelope);\n\n if (this._isEnabled() && this._transport) {\n return this._transport.send(envelope).then(null, reason => {\n DEBUG_BUILD && logger.error('Error while sending event:', reason);\n });\n } else {\n DEBUG_BUILD && logger.error('Transport disabled');\n }\n }\n\n /**\n * Clears outcomes on this client and returns them.\n */\n protected _clearOutcomes(): Outcome[] {\n const outcomes = this._outcomes;\n this._outcomes = {};\n return Object.keys(outcomes).map(key => {\n const [reason, category] = key.split(':') as [EventDropReason, DataCategory];\n return {\n reason,\n category,\n quantity: outcomes[key],\n };\n });\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n public abstract eventFromException(_exception: any, _hint?: EventHint): PromiseLike;\n\n /**\n * @inheritDoc\n */\n public abstract eventFromMessage(\n _message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n _level?: Severity | SeverityLevel,\n _hint?: EventHint,\n ): PromiseLike;\n}\n\n/**\n * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so.\n */\nfunction _validateBeforeSendResult(\n beforeSendResult: PromiseLike | Event | null,\n beforeSendLabel: string,\n): PromiseLike | Event | null {\n const invalidValueError = `${beforeSendLabel} must return \\`null\\` or a valid event.`;\n if (isThenable(beforeSendResult)) {\n return beforeSendResult.then(\n event => {\n if (!isPlainObject(event) && event !== null) {\n throw new SentryError(invalidValueError);\n }\n return event;\n },\n e => {\n throw new SentryError(`${beforeSendLabel} rejected with ${e}`);\n },\n );\n } else if (!isPlainObject(beforeSendResult) && beforeSendResult !== null) {\n throw new SentryError(invalidValueError);\n }\n return beforeSendResult;\n}\n\n/**\n * Process the matching `beforeSendXXX` callback.\n */\nfunction processBeforeSend(\n options: ClientOptions,\n event: Event,\n hint: EventHint,\n): PromiseLike | Event | null {\n const { beforeSend, beforeSendTransaction } = options;\n\n if (isErrorEvent(event) && beforeSend) {\n return beforeSend(event, hint);\n }\n\n if (isTransactionEvent(event) && beforeSendTransaction) {\n return beforeSendTransaction(event, hint);\n }\n\n return event;\n}\n\nfunction isErrorEvent(event: Event): event is ErrorEvent {\n return event.type === undefined;\n}\n\nfunction isTransactionEvent(event: Event): event is TransactionEvent {\n return event.type === 'transaction';\n}\n\n/**\n * Add an event processor to the current client.\n * This event processor will run for all events processed by this client.\n */\nexport function addEventProcessor(callback: EventProcessor): void {\n const client = getClient();\n\n if (!client || !client.addEventProcessor) {\n return;\n }\n\n client.addEventProcessor(callback);\n}\n","import type { DsnComponents, MetricBucketItem, SdkMetadata, StatsdEnvelope, StatsdItem } from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\nimport { serializeMetricBuckets } from './utils';\n\n/**\n * Create envelope from a metric aggregate.\n */\nexport function createMetricEnvelope(\n metricBucketItems: Array,\n dsn?: DsnComponents,\n metadata?: SdkMetadata,\n tunnel?: string,\n): StatsdEnvelope {\n const headers: StatsdEnvelope[0] = {\n sent_at: new Date().toISOString(),\n };\n\n if (metadata && metadata.sdk) {\n headers.sdk = {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n };\n }\n\n if (!!tunnel && dsn) {\n headers.dsn = dsnToString(dsn);\n }\n\n const item = createMetricEnvelopeItem(metricBucketItems);\n return createEnvelope(headers, [item]);\n}\n\nfunction createMetricEnvelopeItem(metricBucketItems: MetricBucketItem[]): StatsdItem {\n const payload = serializeMetricBuckets(metricBucketItems);\n const metricHeaders: StatsdItem[0] = {\n type: 'statsd',\n length: payload.length,\n };\n return [metricHeaders, payload];\n}\n","import type { MeasurementUnit, MetricBucketItem, Primitive } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\nimport { NAME_AND_TAG_KEY_NORMALIZATION_REGEX, TAG_VALUE_NORMALIZATION_REGEX } from './constants';\nimport type { MetricType } from './types';\n\n/**\n * Generate bucket key from metric properties.\n */\nexport function getBucketKey(\n metricType: MetricType,\n name: string,\n unit: MeasurementUnit,\n tags: Record,\n): string {\n const stringifiedTags = Object.entries(dropUndefinedKeys(tags)).sort((a, b) => a[0].localeCompare(b[0]));\n return `${metricType}${name}${unit}${stringifiedTags}`;\n}\n\n/* eslint-disable no-bitwise */\n/**\n * Simple hash function for strings.\n */\nexport function simpleHash(s: string): number {\n let rv = 0;\n for (let i = 0; i < s.length; i++) {\n const c = s.charCodeAt(i);\n rv = (rv << 5) - rv + c;\n rv &= rv;\n }\n return rv >>> 0;\n}\n/* eslint-enable no-bitwise */\n\n/**\n * Serialize metrics buckets into a string based on statsd format.\n *\n * Example of format:\n * metric.name@second:1:1.2|d|#a:value,b:anothervalue|T12345677\n * Segments:\n * name: metric.name\n * unit: second\n * value: [1, 1.2]\n * type of metric: d (distribution)\n * tags: { a: value, b: anothervalue }\n * timestamp: 12345677\n */\nexport function serializeMetricBuckets(metricBucketItems: MetricBucketItem[]): string {\n let out = '';\n for (const item of metricBucketItems) {\n const tagEntries = Object.entries(item.tags);\n const maybeTags = tagEntries.length > 0 ? `|#${tagEntries.map(([key, value]) => `${key}:${value}`).join(',')}` : '';\n out += `${item.name}@${item.unit}:${item.metric}|${item.metricType}${maybeTags}|T${item.timestamp}\\n`;\n }\n return out;\n}\n\n/**\n * Sanitizes tags.\n */\nexport function sanitizeTags(unsanitizedTags: Record): Record {\n const tags: Record = {};\n for (const key in unsanitizedTags) {\n if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) {\n const sanitizedKey = key.replace(NAME_AND_TAG_KEY_NORMALIZATION_REGEX, '_');\n tags[sanitizedKey] = String(unsanitizedTags[key]).replace(TAG_VALUE_NORMALIZATION_REGEX, '_');\n }\n }\n return tags;\n}\n","import type { Scope } from '@sentry/core';\nimport { BaseClient, SDK_VERSION } from '@sentry/core';\nimport type {\n BrowserClientProfilingOptions,\n BrowserClientReplayOptions,\n ClientOptions,\n Event,\n EventHint,\n Options,\n ParameterizedString,\n Severity,\n SeverityLevel,\n UserFeedback,\n} from '@sentry/types';\nimport { createClientReportEnvelope, dsnToString, getSDKSource, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\nimport { createUserFeedbackEnvelope } from './userfeedback';\n\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/types Options for more information.\n */\nexport type BrowserOptions = Options &\n BrowserClientReplayOptions &\n BrowserClientProfilingOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions &\n BrowserClientReplayOptions &\n BrowserClientProfilingOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends BaseClient {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserClientOptions) {\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || {\n name: 'sentry.javascript.browser',\n packages: [\n {\n name: `${sdkSource}:@sentry/browser`,\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n };\n\n super(options);\n\n if (options.sendClientReports && WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n this._flushOutcomes();\n }\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(\n message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n level: Severity | SeverityLevel = 'info',\n hint?: EventHint,\n ): PromiseLike {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n if (!this._isEnabled()) {\n DEBUG_BUILD && logger.warn('SDK not enabled, will not capture user feedback.');\n return;\n }\n\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this.getSdkMetadata(),\n dsn: this.getDsn(),\n tunnel: this.getOptions().tunnel,\n });\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(envelope);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike {\n event.platform = event.platform || 'javascript';\n return super._prepareEvent(event, hint, scope);\n }\n\n /**\n * Sends client reports as an envelope.\n */\n private _flushOutcomes(): void {\n const outcomes = this._clearOutcomes();\n\n if (outcomes.length === 0) {\n DEBUG_BUILD && logger.log('No outcomes to send');\n return;\n }\n\n // This is really the only place where we want to check for a DSN and only send outcomes then\n if (!this._dsn) {\n DEBUG_BUILD && logger.log('No dsn provided, will not send outcomes');\n return;\n }\n\n DEBUG_BUILD && logger.log('Sending outcomes:', outcomes);\n\n const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn));\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(envelope);\n }\n}\n","/*\n * This module exists for optimizations in the build process through rollup and terser. We define some global\n * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these\n * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will\n * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to\n * `logger` and preventing node-related code from appearing in browser bundles.\n *\n * Attention:\n * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by\n * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack)\n * having issues tree-shaking these constants across package boundaries.\n * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want\n * users to be able to shake away expressions that it guards.\n */\n\ndeclare const __SENTRY_BROWSER_BUNDLE__: boolean | undefined;\n\nexport type SdkSource = 'npm' | 'cdn' | 'loader';\n\n/**\n * Figures out if we're building a browser bundle.\n *\n * @returns true if this is a browser bundle build.\n */\nexport function isBrowserBundle(): boolean {\n return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;\n}\n\n/**\n * Get source of SDK.\n */\nexport function getSDKSource(): SdkSource {\n // @ts-expect-error __SENTRY_SDK_SOURCE__ is injected by rollup during build process\n return __SENTRY_SDK_SOURCE__;\n}\n","import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata &&\n metadata.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n","import type { ClientReport, ClientReportEnvelope, ClientReportItem } from '@sentry/types';\n\nimport { createEnvelope } from './envelope';\nimport { dateTimestampInSeconds } from './time';\n\n/**\n * Creates client report envelope\n * @param discarded_events An array of discard events\n * @param dsn A DSN that can be set on the header. Optional.\n */\nexport function createClientReportEnvelope(\n discarded_events: ClientReport['discarded_events'],\n dsn?: string,\n timestamp?: number,\n): ClientReportEnvelope {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: timestamp || dateTimestampInSeconds(),\n discarded_events,\n },\n ];\n return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]);\n}\n","// This was originally forked from https://github.com/csnover/TraceKit, and was largely\n// re - written as part of raven - js.\n//\n// This code was later copied to the JavaScript mono - repo and further modified and\n// refactored over the years.\n\n// Copyright (c) 2013 Onur Can Cakmak onur.cakmak@gmail.com and all TraceKit contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files(the 'Software'), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify,\n// merge, publish, distribute, sublicense, and / or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies\n// or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { StackFrame, StackLineParser, StackLineParserFn } from '@sentry/types';\nimport { createStackParser } from '@sentry/utils';\n\n// global reference to slice\nconst UNKNOWN_FUNCTION = '?';\n\nconst OPERA10_PRIORITY = 10;\nconst OPERA11_PRIORITY = 20;\nconst CHROME_PRIORITY = 30;\nconst WINJS_PRIORITY = 40;\nconst GECKO_PRIORITY = 50;\n\nfunction createFrame(filename: string, func: string, lineno?: number, colno?: number): StackFrame {\n const frame: StackFrame = {\n filename,\n function: func,\n in_app: true, // All browser frames are considered in_app\n };\n\n if (lineno !== undefined) {\n frame.lineno = lineno;\n }\n\n if (colno !== undefined) {\n frame.colno = colno;\n }\n\n return frame;\n}\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\nconst chromeRegex =\n /^\\s*at (?:(.+?\\)(?: \\[.+\\])?|.*?) ?\\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\\/)?.*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nconst chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\nconst chrome: StackLineParserFn = line => {\n const parts = chromeRegex.exec(line);\n\n if (parts) {\n const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n if (isEval) {\n const subMatch = chromeEvalRegex.exec(parts[2]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = subMatch[1]; // url\n parts[3] = subMatch[2]; // line\n parts[4] = subMatch[3]; // column\n }\n }\n\n // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);\n\n return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);\n }\n\n return;\n};\n\nexport const chromeStackLineParser: StackLineParser = [CHROME_PRIORITY, chrome];\n\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst geckoREgex =\n /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:[-a-z]+)?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nconst gecko: StackLineParserFn = line => {\n const parts = geckoREgex.exec(line);\n\n if (parts) {\n const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval) {\n const subMatch = geckoEvalRegex.exec(parts[3]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line number\n parts[1] = parts[1] || 'eval';\n parts[3] = subMatch[1];\n parts[4] = subMatch[2];\n parts[5] = ''; // no column when eval\n }\n }\n\n let filename = parts[3];\n let func = parts[1] || UNKNOWN_FUNCTION;\n [func, filename] = extractSafariExtensionDetails(func, filename);\n\n return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);\n }\n\n return;\n};\n\nexport const geckoStackLineParser: StackLineParser = [GECKO_PRIORITY, gecko];\n\nconst winjsRegex = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:[-a-z]+):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nconst winjs: StackLineParserFn = line => {\n const parts = winjsRegex.exec(line);\n\n return parts\n ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)\n : undefined;\n};\n\nexport const winjsStackLineParser: StackLineParser = [WINJS_PRIORITY, winjs];\n\nconst opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n\nconst opera10: StackLineParserFn = line => {\n const parts = opera10Regex.exec(line);\n return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;\n};\n\nexport const opera10StackLineParser: StackLineParser = [OPERA10_PRIORITY, opera10];\n\nconst opera11Regex =\n / line (\\d+), column (\\d+)\\s*(?:in (?:]+)>|([^)]+))\\(.*\\))? in (.*):\\s*$/i;\n\nconst opera11: StackLineParserFn = line => {\n const parts = opera11Regex.exec(line);\n return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;\n};\n\nexport const opera11StackLineParser: StackLineParser = [OPERA11_PRIORITY, opera11];\n\nexport const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser, winjsStackLineParser];\n\nexport const defaultStackParser = createStackParser(...defaultStackLineParsers);\n\n/**\n * Safari web extensions, starting version unknown, can produce \"frames-only\" stacktraces.\n * What it means, is that instead of format like:\n *\n * Error: wat\n * at function@url:row:col\n * at function@url:row:col\n * at function@url:row:col\n *\n * it produces something like:\n *\n * function@url:row:col\n * function@url:row:col\n * function@url:row:col\n *\n * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.\n * This function is extracted so that we can use it in both places without duplicating the logic.\n * Unfortunately \"just\" changing RegExp is too complicated now and making it pass all tests\n * and fix this case seems like an impossible, or at least way too time-consuming task.\n */\nconst extractSafariExtensionDetails = (func: string, filename: string): [string, string] => {\n const isSafariExtension = func.indexOf('safari-extension') !== -1;\n const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n\n return isSafariExtension || isSafariWebExtension\n ? [\n func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION,\n isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`,\n ]\n : [func, filename];\n};\n","import type { TransportMakeRequestResponse } from '@sentry/types';\n\n// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend\nexport type RateLimits = Record;\n\nexport const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param header string representation of 'Retry-After' header\n * @param now current unix timestamp\n *\n */\nexport function parseRetryAfterHeader(header: string, now: number = Date.now()): number {\n const headerDelay = parseInt(`${header}`, 10);\n if (!isNaN(headerDelay)) {\n return headerDelay * 1000;\n }\n\n const headerDate = Date.parse(`${header}`);\n if (!isNaN(headerDate)) {\n return headerDate - now;\n }\n\n return DEFAULT_RETRY_AFTER;\n}\n\n/**\n * Gets the time that the given category is disabled until for rate limiting.\n * In case no category-specific limit is set but a general rate limit across all categories is active,\n * that time is returned.\n *\n * @return the time in ms that the category is disabled until or 0 if there's no active rate limit.\n */\nexport function disabledUntil(limits: RateLimits, category: string): number {\n return limits[category] || limits.all || 0;\n}\n\n/**\n * Checks if a category is rate limited\n */\nexport function isRateLimited(limits: RateLimits, category: string, now: number = Date.now()): boolean {\n return disabledUntil(limits, category) > now;\n}\n\n/**\n * Update ratelimits from incoming headers.\n *\n * @return the updated RateLimits object.\n */\nexport function updateRateLimits(\n limits: RateLimits,\n { statusCode, headers }: TransportMakeRequestResponse,\n now: number = Date.now(),\n): RateLimits {\n const updatedRateLimits: RateLimits = {\n ...limits,\n };\n\n // \"The name is case-insensitive.\"\n // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n const rateLimitHeader = headers && headers['x-sentry-rate-limits'];\n const retryAfterHeader = headers && headers['retry-after'];\n\n if (rateLimitHeader) {\n /**\n * rate limit headers are of the form\n *
,
,..\n * where each
is of the form\n * : : : \n * where\n * is a delay in seconds\n * is the event type(s) (error, transaction, etc) being rate limited and is of the form\n * ;;...\n * is what's being limited (org, project, or key) - ignored by SDK\n * is an arbitrary string like \"org_quota\" - ignored by SDK\n */\n for (const limit of rateLimitHeader.trim().split(',')) {\n const [retryAfter, categories] = limit.split(':', 2);\n const headerDelay = parseInt(retryAfter, 10);\n const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n if (!categories) {\n updatedRateLimits.all = now + delay;\n } else {\n for (const category of categories.split(';')) {\n updatedRateLimits[category] = now + delay;\n }\n }\n }\n } else if (retryAfterHeader) {\n updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);\n } else if (statusCode === 429) {\n updatedRateLimits.all = now + 60 * 1000;\n }\n\n return updatedRateLimits;\n}\n","import type {\n Envelope,\n EnvelopeItem,\n EnvelopeItemType,\n Event,\n EventDropReason,\n EventItem,\n InternalBaseTransportOptions,\n Transport,\n TransportMakeRequestResponse,\n TransportRequestExecutor,\n} from '@sentry/types';\nimport type { PromiseBuffer, RateLimits } from '@sentry/utils';\nimport {\n SentryError,\n createEnvelope,\n envelopeItemTypeToDataCategory,\n forEachEnvelopeItem,\n isRateLimited,\n logger,\n makePromiseBuffer,\n resolvedSyncPromise,\n serializeEnvelope,\n updateRateLimits,\n} from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\n\nexport const DEFAULT_TRANSPORT_BUFFER_SIZE = 30;\n\n/**\n * Creates an instance of a Sentry `Transport`\n *\n * @param options\n * @param makeRequest\n */\nexport function createTransport(\n options: InternalBaseTransportOptions,\n makeRequest: TransportRequestExecutor,\n buffer: PromiseBuffer = makePromiseBuffer(\n options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE,\n ),\n): Transport {\n let rateLimits: RateLimits = {};\n const flush = (timeout?: number): PromiseLike => buffer.drain(timeout);\n\n function send(envelope: Envelope): PromiseLike {\n const filteredEnvelopeItems: EnvelopeItem[] = [];\n\n // Drop rate limited items from envelope\n forEachEnvelopeItem(envelope, (item, type) => {\n const envelopeItemDataCategory = envelopeItemTypeToDataCategory(type);\n if (isRateLimited(rateLimits, envelopeItemDataCategory)) {\n const event: Event | undefined = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent('ratelimit_backoff', envelopeItemDataCategory, event);\n } else {\n filteredEnvelopeItems.push(item);\n }\n });\n\n // Skip sending if envelope is empty after filtering out rate limited events\n if (filteredEnvelopeItems.length === 0) {\n return resolvedSyncPromise();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const filteredEnvelope: Envelope = createEnvelope(envelope[0], filteredEnvelopeItems as any);\n\n // Creates client report for each item in an envelope\n const recordEnvelopeLoss = (reason: EventDropReason): void => {\n forEachEnvelopeItem(filteredEnvelope, (item, type) => {\n const event: Event | undefined = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event);\n });\n };\n\n const requestTask = (): PromiseLike =>\n makeRequest({ body: serializeEnvelope(filteredEnvelope, options.textEncoder) }).then(\n response => {\n // We don't want to throw on NOK responses, but we want to at least log them\n if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {\n DEBUG_BUILD && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);\n }\n\n rateLimits = updateRateLimits(rateLimits, response);\n return response;\n },\n error => {\n recordEnvelopeLoss('network_error');\n throw error;\n },\n );\n\n return buffer.add(requestTask).then(\n result => result,\n error => {\n if (error instanceof SentryError) {\n DEBUG_BUILD && logger.error('Skipped sending event because buffer is full.');\n recordEnvelopeLoss('queue_overflow');\n return resolvedSyncPromise();\n } else {\n throw error;\n }\n },\n );\n }\n\n // We use this to identifify if the transport is the base transport\n // TODO (v8): Remove this again as we'll no longer need it\n send.__sentry__baseTransport__ = true;\n\n return {\n send,\n flush,\n };\n}\n\nfunction getEventForEnvelopeItem(item: Envelope[1][number], type: EnvelopeItemType): Event | undefined {\n if (type !== 'event' && type !== 'transaction') {\n return undefined;\n }\n\n return Array.isArray(item) ? (item as EventItem)[1] : undefined;\n}\n","import { SentryError } from './error';\nimport { SyncPromise, rejectedSyncPromise, resolvedSyncPromise } from './syncpromise';\n\nexport interface PromiseBuffer {\n // exposes the internal array so tests can assert on the state of it.\n // XXX: this really should not be public api.\n $: Array>;\n add(taskProducer: () => PromiseLike): PromiseLike;\n drain(timeout?: number): PromiseLike;\n}\n\n/**\n * Creates an new PromiseBuffer object with the specified limit\n * @param limit max number of promises that can be stored in the buffer\n */\nexport function makePromiseBuffer(limit?: number): PromiseBuffer {\n const buffer: Array> = [];\n\n function isReady(): boolean {\n return limit === undefined || buffer.length < limit;\n }\n\n /**\n * Remove a promise from the queue.\n *\n * @param task Can be any PromiseLike\n * @returns Removed promise.\n */\n function remove(task: PromiseLike): PromiseLike {\n return buffer.splice(buffer.indexOf(task), 1)[0];\n }\n\n /**\n * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.\n *\n * @param taskProducer A function producing any PromiseLike; In previous versions this used to be `task:\n * PromiseLike`, but under that model, Promises were instantly created on the call-site and their executor\n * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By\n * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer\n * limit check.\n * @returns The original promise.\n */\n function add(taskProducer: () => PromiseLike): PromiseLike {\n if (!isReady()) {\n return rejectedSyncPromise(new SentryError('Not adding Promise because buffer limit was reached.'));\n }\n\n // start the task and add its promise to the queue\n const task = taskProducer();\n if (buffer.indexOf(task) === -1) {\n buffer.push(task);\n }\n void task\n .then(() => remove(task))\n // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`\n // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't\n // have promises, so TS has to polyfill when down-compiling.)\n .then(null, () =>\n remove(task).then(null, () => {\n // We have to add another catch here because `remove()` starts a new promise chain.\n }),\n );\n return task;\n }\n\n /**\n * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or\n * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and\n * `false` otherwise\n */\n function drain(timeout?: number): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n let counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n }\n\n // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n const capturedSetTimeout = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n\n // if all promises resolve in time, cancel the timer and resolve to `true`\n buffer.forEach(item => {\n void resolvedSyncPromise(item).then(() => {\n if (!--counter) {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }\n }, reject);\n });\n });\n }\n\n return {\n $: buffer,\n add,\n drain,\n };\n}\n","import { isNativeFetch, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\nlet cachedFetchImpl: FetchImpl | undefined = undefined;\n\nexport type FetchImpl = typeof fetch;\n\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * const f = window.fetch;\n * window.fetch = function () {\n * const p = f.apply(this, arguments);\n *\n * p.then(function() {\n * console.log('hi.');\n * });\n *\n * return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome: Failed to fetch\n * Edge: Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari: resource blocked by content blocker\n */\nexport function getNativeFetchImplementation(): FetchImpl {\n if (cachedFetchImpl) {\n return cachedFetchImpl;\n }\n\n /* eslint-disable @typescript-eslint/unbound-method */\n\n // Fast path to avoid DOM I/O\n if (isNativeFetch(WINDOW.fetch)) {\n return (cachedFetchImpl = WINDOW.fetch.bind(WINDOW));\n }\n\n const document = WINDOW.document;\n let fetchImpl = WINDOW.fetch;\n // eslint-disable-next-line deprecation/deprecation\n if (document && typeof document.createElement === 'function') {\n try {\n const sandbox = document.createElement('iframe');\n sandbox.hidden = true;\n document.head.appendChild(sandbox);\n const contentWindow = sandbox.contentWindow;\n if (contentWindow && contentWindow.fetch) {\n fetchImpl = contentWindow.fetch;\n }\n document.head.removeChild(sandbox);\n } catch (e) {\n DEBUG_BUILD && logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);\n }\n }\n\n return (cachedFetchImpl = fetchImpl.bind(WINDOW));\n /* eslint-enable @typescript-eslint/unbound-method */\n}\n\n/** Clears cached fetch impl */\nexport function clearCachedFetchImplementation(): void {\n cachedFetchImpl = undefined;\n}\n","import { createTransport } from '@sentry/core';\nimport type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { rejectedSyncPromise } from '@sentry/utils';\n\nimport type { BrowserTransportOptions } from './types';\nimport type { FetchImpl } from './utils';\nimport { clearCachedFetchImplementation, getNativeFetchImplementation } from './utils';\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nexport function makeFetchTransport(\n options: BrowserTransportOptions,\n nativeFetch: FetchImpl = getNativeFetchImplementation(),\n): Transport {\n let pendingBodySize = 0;\n let pendingCount = 0;\n\n function makeRequest(request: TransportRequest): PromiseLike {\n const requestSize = request.body.length;\n pendingBodySize += requestSize;\n pendingCount++;\n\n const requestOptions: RequestInit = {\n body: request.body,\n method: 'POST',\n referrerPolicy: 'origin',\n headers: options.headers,\n // Outgoing requests are usually cancelled when navigating to a different page, causing a \"TypeError: Failed to\n // fetch\" error and sending a \"network_error\" client-outcome - in Chrome, the request status shows \"(cancelled)\".\n // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're\n // frequently sending events right before the user is switching pages (eg. whenfinishing navigation transactions).\n // Gotchas:\n // - `keepalive` isn't supported by Firefox\n // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):\n // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.\n // We will therefore only activate the flag when we're below that limit.\n // There is also a limit of requests that can be open at the same time, so we also limit this to 15\n // See https://github.com/getsentry/sentry-javascript/pull/7553 for details\n keepalive: pendingBodySize <= 60_000 && pendingCount < 15,\n ...options.fetchOptions,\n };\n\n try {\n return nativeFetch(options.url, requestOptions).then(response => {\n pendingBodySize -= requestSize;\n pendingCount--;\n return {\n statusCode: response.status,\n headers: {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After'),\n },\n };\n });\n } catch (e) {\n clearCachedFetchImplementation();\n pendingBodySize -= requestSize;\n pendingCount--;\n return rejectedSyncPromise(e);\n }\n }\n\n return createTransport(options, makeRequest);\n}\n","import { createTransport } from '@sentry/core';\nimport type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { SyncPromise } from '@sentry/utils';\n\nimport type { BrowserTransportOptions } from './types';\n\n/**\n * The DONE ready state for XmlHttpRequest\n *\n * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined\n * (e.g. during testing, it is `undefined`)\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}\n */\nconst XHR_READYSTATE_DONE = 4;\n\n/**\n * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.\n */\nexport function makeXHRTransport(options: BrowserTransportOptions): Transport {\n function makeRequest(request: TransportRequest): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n\n xhr.onerror = reject;\n\n xhr.onreadystatechange = (): void => {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n resolve({\n statusCode: xhr.status,\n headers: {\n 'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),\n 'retry-after': xhr.getResponseHeader('Retry-After'),\n },\n });\n }\n };\n\n xhr.open('POST', options.url);\n\n for (const header in options.headers) {\n if (Object.prototype.hasOwnProperty.call(options.headers, header)) {\n xhr.setRequestHeader(header, options.headers[header]);\n }\n }\n\n xhr.send(request.body);\n });\n }\n\n return createTransport(options, makeRequest);\n}\n","import type { Hub } from '@sentry/core';\nimport {\n Integrations as CoreIntegrations,\n captureSession,\n getClient,\n getCurrentHub,\n getIntegrationsToSetup,\n getReportDialogEndpoint,\n initAndBind,\n startSession,\n} from '@sentry/core';\nimport type { UserFeedback } from '@sentry/types';\nimport {\n addHistoryInstrumentationHandler,\n logger,\n stackParserFromStackParserOptions,\n supportsFetch,\n} from '@sentry/utils';\n\nimport type { BrowserClientOptions, BrowserOptions } from './client';\nimport { BrowserClient } from './client';\nimport { DEBUG_BUILD } from './debug-build';\nimport type { ReportDialogOptions } from './helpers';\nimport { WINDOW, wrap as internalWrap } from './helpers';\nimport { Breadcrumbs, Dedupe, GlobalHandlers, HttpContext, LinkedErrors, TryCatch } from './integrations';\nimport { defaultStackParser } from './stack-parsers';\nimport { makeFetchTransport, makeXHRTransport } from './transports';\n\nexport const defaultIntegrations = [\n new CoreIntegrations.InboundFilters(),\n new CoreIntegrations.FunctionToString(),\n new TryCatch(),\n new Breadcrumbs(),\n new GlobalHandlers(),\n new LinkedErrors(),\n new Dedupe(),\n new HttpContext(),\n];\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n * scope.setExtra({ battery: 0.7 });\n * scope.setTag({ user_mode: 'admin' });\n * scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nexport function init(options: BrowserOptions = {}): void {\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = defaultIntegrations;\n }\n if (options.release === undefined) {\n // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n if (typeof __SENTRY_RELEASE__ === 'string') {\n options.release = __SENTRY_RELEASE__;\n }\n\n // This supports the variable that sentry-webpack-plugin injects\n if (WINDOW.SENTRY_RELEASE && WINDOW.SENTRY_RELEASE.id) {\n options.release = WINDOW.SENTRY_RELEASE.id;\n }\n }\n if (options.autoSessionTracking === undefined) {\n options.autoSessionTracking = true;\n }\n if (options.sendClientReports === undefined) {\n options.sendClientReports = true;\n }\n\n const clientOptions: BrowserClientOptions = {\n ...options,\n stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n integrations: getIntegrationsToSetup(options),\n transport: options.transport || (supportsFetch() ? makeFetchTransport : makeXHRTransport),\n };\n\n initAndBind(BrowserClient, clientOptions);\n\n if (options.autoSessionTracking) {\n startSessionTracking();\n }\n}\n\ntype NewReportDialogOptions = ReportDialogOptions & { eventId: string }; // eslint-disable-line\n\ninterface ShowReportDialogFunction {\n /**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n */\n (options: NewReportDialogOptions): void;\n\n /**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n *\n * @deprecated Please always pass an `options` argument with `eventId`. The `hub` argument will not be used in the next version of the SDK.\n */\n // eslint-disable-next-line deprecation/deprecation\n (options?: ReportDialogOptions, hub?: Hub): void;\n}\n\nexport const showReportDialog: ShowReportDialogFunction = (\n // eslint-disable-next-line deprecation/deprecation\n options: ReportDialogOptions = {},\n hub: Hub = getCurrentHub(),\n) => {\n // doesn't work without a document (React Native)\n if (!WINDOW.document) {\n DEBUG_BUILD && logger.error('Global document not defined in showReportDialog call');\n return;\n }\n\n const { client, scope } = hub.getStackTop();\n const dsn = options.dsn || (client && client.getDsn());\n if (!dsn) {\n DEBUG_BUILD && logger.error('DSN not configured for showReportDialog call');\n return;\n }\n\n if (scope) {\n options.user = {\n ...scope.getUser(),\n ...options.user,\n };\n }\n\n // TODO(v8): Remove this entire if statement. `eventId` will be a required option.\n // eslint-disable-next-line deprecation/deprecation\n if (!options.eventId) {\n // eslint-disable-next-line deprecation/deprecation\n options.eventId = hub.lastEventId();\n }\n\n const script = WINDOW.document.createElement('script');\n script.async = true;\n script.crossOrigin = 'anonymous';\n script.src = getReportDialogEndpoint(dsn, options);\n\n if (options.onLoad) {\n script.onload = options.onLoad;\n }\n\n const { onClose } = options;\n if (onClose) {\n const reportDialogClosedMessageHandler = (event: MessageEvent): void => {\n if (event.data === '__sentry_reportdialog_closed__') {\n try {\n onClose();\n } finally {\n WINDOW.removeEventListener('message', reportDialogClosedMessageHandler);\n }\n }\n };\n WINDOW.addEventListener('message', reportDialogClosedMessageHandler);\n }\n\n const injectionPoint = WINDOW.document.head || WINDOW.document.body;\n if (injectionPoint) {\n injectionPoint.appendChild(script);\n } else {\n DEBUG_BUILD && logger.error('Not injecting report dialog. No injection point found in HTML');\n }\n};\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function forceLoad(): void {\n // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function onLoad(callback: () => void): void {\n callback();\n}\n\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @deprecated This function will be removed in v8.\n * It is not part of Sentry's official API and it's easily replaceable by using a try/catch block\n * and calling Sentry.captureException.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\n// TODO(v8): Remove this function\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrap(fn: (...args: any) => any): any {\n return internalWrap(fn)();\n}\n\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\nfunction startSessionTracking(): void {\n if (typeof WINDOW.document === 'undefined') {\n DEBUG_BUILD && logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n return;\n }\n\n // The session duration for browser sessions does not track a meaningful\n // concept that can be used as a metric.\n // Automatically captured sessions are akin to page views, and thus we\n // discard their duration.\n startSession({ ignoreDuration: true });\n captureSession();\n\n // We want to create a session for every navigation as well\n addHistoryInstrumentationHandler(({ from, to }) => {\n // Don't create an additional session for the initial route or if the location did not change\n if (from !== undefined && from !== to) {\n startSession({ ignoreDuration: true });\n captureSession();\n }\n });\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n */\nexport function captureUserFeedback(feedback: UserFeedback): void {\n const client = getClient();\n if (client) {\n client.captureUserFeedback(feedback);\n }\n}\n","import { assert, warn } from '@ember/debug';\nimport { next } from '@ember/runloop';\nimport { getOwnConfig, isDevelopingApp, macroCondition } from '@embroider/macros';\nimport { startSpan } from '@sentry/browser';\nimport * as Sentry from '@sentry/browser';\nimport { SDK_VERSION } from '@sentry/browser';\nimport { GLOBAL_OBJ } from '@sentry/utils';\nimport Ember from 'ember';\nfunction _getSentryInitConfig() {\n const _global = GLOBAL_OBJ;\n _global.__sentryEmberConfig = _global.__sentryEmberConfig ?? {};\n return _global.__sentryEmberConfig;\n}\nexport function InitSentryForEmber(_runtimeConfig) {\n const environmentConfig = getOwnConfig().sentryConfig;\n assert('Missing configuration.', environmentConfig);\n assert('Missing configuration for Sentry.', environmentConfig.sentry || _runtimeConfig);\n if (!environmentConfig.sentry) {\n // If environment config is not specified but the above assertion passes, use runtime config.\n environmentConfig.sentry = {\n ..._runtimeConfig\n };\n }\n\n // Merge runtime config into environment config, preferring runtime.\n Object.assign(environmentConfig.sentry, _runtimeConfig || {});\n const initConfig = Object.assign({}, environmentConfig.sentry);\n initConfig._metadata = initConfig._metadata || {};\n initConfig._metadata.sdk = {\n name: 'sentry.javascript.ember',\n packages: [{\n name: 'npm:@sentry/ember',\n version: SDK_VERSION\n }],\n version: SDK_VERSION\n };\n\n // Persist Sentry init options so they are identical when performance initializers call init again.\n const sentryInitConfig = _getSentryInitConfig();\n Object.assign(sentryInitConfig, initConfig);\n Sentry.init(initConfig);\n if (macroCondition(isDevelopingApp())) {\n if (environmentConfig.ignoreEmberOnErrorWarning) {\n return;\n }\n next(null, function () {\n warn('Ember.onerror found. Using Ember.onerror can hide some errors (such as flushed runloop errors) from Sentry. Use Sentry.captureException to capture errors within Ember.onError or remove it to have errors caught by Sentry directly. This error can be silenced via addon configuration.', !Ember.onerror, {\n id: '@sentry/ember.ember-onerror-detected'\n });\n });\n }\n}\n\n/**\n * Grabs active transaction off scope.\n *\n * @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.\n */\nexport const getActiveTransaction = () => {\n // eslint-disable-next-line deprecation/deprecation\n return Sentry.getCurrentHub().getScope().getTransaction();\n};\nexport const instrumentRoutePerformance = BaseRoute => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const instrumentFunction = async (op, description, fn, args) => {\n return startSpan({\n op,\n name: description,\n origin: 'auto.ui.ember'\n }, () => {\n return fn(...args);\n });\n };\n const routeName = BaseRoute.name;\n return {\n // @ts-expect-error TS2545 We do not need to redefine a constructor here\n [routeName]: class extends BaseRoute {\n beforeModel(...args) {\n return instrumentFunction('ui.ember.route.before_model', this.fullRouteName, super.beforeModel.bind(this), args);\n }\n async model(...args) {\n return instrumentFunction('ui.ember.route.model', this.fullRouteName, super.model.bind(this), args);\n }\n afterModel(...args) {\n return instrumentFunction('ui.ember.route.after_model', this.fullRouteName, super.afterModel.bind(this), args);\n }\n setupController(...args) {\n return instrumentFunction('ui.ember.route.setup_controller', this.fullRouteName, super.setupController.bind(this), args);\n }\n }\n }[routeName];\n};\nexport * from '@sentry/browser';\n\n// init is now the preferred way to call initialization for this addon.\nexport const init = InitSentryForEmber;","import type { Client, ClientOptions } from '@sentry/types';\nimport { consoleSandbox, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { getCurrentHub } from './hub';\n\n/** A class object that can instantiate Client objects. */\nexport type ClientClass = new (options: O) => F;\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\nexport function initAndBind(\n clientClass: ClientClass,\n options: O,\n): void {\n if (options.debug === true) {\n if (DEBUG_BUILD) {\n logger.enable();\n } else {\n // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n });\n }\n }\n const hub = getCurrentHub();\n const scope = hub.getScope();\n scope.update(options.initialScope);\n\n const client = new clientClass(options);\n hub.bindClient(client);\n}\n","import Ember from 'ember';\n\nconst { libraries } = Ember;\n\nexport default function initializerFactory(name, version) {\n let registered = false;\n\n return function () {\n if (!registered && name && version) {\n libraries.register(name, version);\n registered = true;\n }\n };\n}\n","import initializerFactory from 'ember-cli-app-version/initializer-factory';\nimport config from '../config/environment';\n\nlet name, version;\nif (config.APP) {\n name = config.APP.name;\n version = config.APP.version;\n}\n\nexport default {\n name: 'App Version',\n initialize: initializerFactory(name, version),\n};\n","export function isFactory(\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n_factoryOrClass) {\n return !true;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\n/**\n * Consume each positional and named argument to entangle it in autotracking and\n * enable updates.\n *\n * This is a temporary workaround for a change in the autotracking semantics of\n * the args proxy introduced in `v3.22`. What changed is that arguments are no\n * longer eagerly consumed. Didn’t use an argument? Then updates won’t be run\n * when its value changes. This workaround reproduces the previous behaviour to\n * avoid introducing a breaking change until a suitable transition path is made\n * available.\n */\nlet consumeArgs = noop;\nif (true) {\n consumeArgs = function ({\n positional,\n named\n }) {\n // SAFETY: TS before 4.6 does not correctly/fully resolve the type in a way\n // that allows the type checker to see that `positional` must *always* be\n // something which `extends unknown[]` here, because the underlying\n // machinery is fairly complicated and relies on a fair bit of type\n // recursion. It will stop mattering when we cut v4.0, because we won't be\n // doing this anyway.\n const pos = positional;\n for (let i = 0; i < pos.length; i++) {\n pos[i];\n }\n\n // SAFETY: TS 4.7 does not see that `named` will always be an object here.\n // However, it is guaranteed to be resolved as such by the types. This *may*\n // be a bug (https://github.com/microsoft/TypeScript/issues/48468), but it\n // *should* also stop being relevant once we ship 4.0.\n Object.values(named);\n };\n}\nexport { consumeArgs };","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { capabilities } from '@ember/modifier';\nimport { destroy, registerDestructor } from '@ember/destroyable';\nimport { Element, _implementsModify, Args } from './modifier';\nimport { consumeArgs, isFactory } from '../compat';\nfunction destroyModifier(modifier) {\n modifier.willRemove();\n modifier.willDestroy();\n}\n\n/**\n * The state bucket used throughout the life-cycle of the modifier. Basically a\n * state *machine*, where the framework calls us with the version we hand back\n * to it at each phase. The two states are the two `extends` versions of this\n * below.\n *\n * @internal\n */\n\n/**\n * The `State` after calling `createModifier`, and therefore the state available\n * at the start of `InstallModifier`.\n * @internal\n */\n\n/**\n * The `State` after calling `installModifier`, and therefore the state\n * available in all `updateModifier` calls and in `destroyModifier`.\n * @internal\n */\n\n// Wraps the unsafe (b/c it mutates, rather than creating new state) code that\n// TS does not yet understand.\nfunction installElement(state, element) {\n // SAFETY: this cast represents how we are actually handling the state machine\n // transition: from this point forward in the lifecycle of the modifier, it\n // always behaves as `InstalledState`. It is safe because, and *only*\n // because, we immediately initialize `element`. (We cannot create a new state\n // from the old one because the modifier manager API expects mutation of a\n // single state bucket rather than updating it at hook calls.)\n const installedState = state;\n installedState.element = element;\n return installedState;\n}\nfunction installElementOnInstance(instance, element) {\n // SAFETY: we use the internal API for all class-based modifiers to set this\n // in a way which lets us issue the deprecation warning for anyone accessing\n // `element` as a getter while allowing types to continue working for any\n // existing subclasses (see the discussion on the class definition).\n instance[Element] = element;\n}\nfunction updateArgsOnInstance(instance, args) {\n // SAFETY: we use the internal API for all class-based modifiers to set this\n // in a way which lets us issue the deprecation warning for anyone accessing\n // `args` as a getter while allowing types to continue working for any\n // existing subclasses (see the discussion on the class definition).\n instance[Args] = args;\n}\nexport default class ClassBasedModifierManager {\n constructor(owner) {\n _defineProperty(this, \"capabilities\", capabilities(true ? '3.22' : '3.13'));\n this.owner = owner;\n }\n createModifier(factoryOrClass, args) {\n const Modifier = isFactory(factoryOrClass) ? factoryOrClass.class : factoryOrClass;\n const modifier = new Modifier(this.owner, args);\n registerDestructor(modifier, destroyModifier);\n return {\n instance: modifier,\n implementsModify: _implementsModify(modifier),\n element: null\n };\n }\n installModifier(createdState, element, args) {\n const state = installElement(createdState, element);\n\n // TODO: this can be deleted entirely at v4.\n const {\n instance\n } = state;\n installElementOnInstance(instance, element);\n if (state.implementsModify) {\n instance.modify(element, args.positional, args.named);\n } else {\n // The `consumeArgs()` call provides backwards compatibility on v3 for the\n // deprecated legacy lifecycle hooks (`didInstall`, `didReceiveArguments`,\n // and `didUpdateArguments`), which accidentally had eager consumption\n // semantics prior to Ember 3.22. The new, recommended `modify` hook has\n // the updated lazy semantics associated with normal auto-tracking.\n if (true) {\n consumeArgs(args);\n }\n instance.didReceiveArguments();\n instance.didInstall();\n }\n }\n updateModifier(state, args) {\n const {\n instance\n } = state;\n\n // TODO: remove at 4.0\n updateArgsOnInstance(state.instance, args);\n if (state.implementsModify) {\n instance.modify(state.element, args.positional, args.named);\n } else {\n // The `consumeArgs()` call provides backwards compatibility on v3 for the\n // deprecated legacy lifecycle hooks (`didInstall`, `didReceiveArguments`,\n // and `didUpdateArguments`), which accidentally had eager consumption\n // semantics prior to Ember 3.22. The new, recommended `modify` hook has\n // the updated lazy semantics associated with normal auto-tracking.\n if (true) {\n consumeArgs(args);\n }\n instance.didUpdateArguments();\n instance.didReceiveArguments();\n }\n }\n destroyModifier(state) {\n destroy(state.instance);\n }\n}","import { setOwner } from '@ember/application';\nimport { setModifierManager } from '@ember/modifier';\nimport Manager from './modifier-manager';\nimport { isDestroying, isDestroyed } from '@ember/destroyable';\nimport { assert, deprecate } from '@ember/debug';\nimport { DEBUG } from '@glimmer/env';\n\n// SAFETY: these sets are dev-only code to avoid showing deprecations for the\n// same class more than once.\n\nlet SEEN_CLASSES_FOR_LIFECYCLE;\nif (DEBUG) {\n SEEN_CLASSES_FOR_LIFECYCLE = new Set();\n}\nlet SEEN_CLASSES_FOR_DESTROYABLES;\nif (DEBUG) {\n SEEN_CLASSES_FOR_DESTROYABLES = new Set();\n}\nlet SEEN_CLASSES_FOR_ARGS;\nif (DEBUG) {\n SEEN_CLASSES_FOR_ARGS = new Set();\n}\nlet SEEN_CLASSES_FOR_ELEMENTS;\nif (DEBUG) {\n SEEN_CLASSES_FOR_ELEMENTS = new Set();\n}\n\n/** @internal */\nexport const _implementsModify = instance => instance.modify !== ClassBasedModifier.prototype.modify;\n\n/** @internal */\nexport const _implementsLegacyHooks = instance => instance.didInstall !== ClassBasedModifier.prototype.didInstall || instance.didUpdateArguments !== ClassBasedModifier.prototype.didUpdateArguments || instance.didReceiveArguments !== ClassBasedModifier.prototype.didReceiveArguments;\n\n/** @internal */\nexport const Element = Symbol('Element');\n\n/** @internal */\nexport const Args = Symbol('Args');\n\n// Preserve the signature on a class-based modifier so it can be plucked off\n// later (by e.g. Glint), using interface merging with an opaque item to\n// preserve it in the type system. The fact that it's an empty interface is\n// actually the point: it *only* hooks the type parameter into the opaque\n// (nominal) type. Note that this is distinct from the function-based modifier\n// type intentionally, because it is actually the static class side of a\n// class-based modifier which corresponds to the result of calling `modifier()`\n// with a callback defining a function-based modifier.\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\n\n/**\n * A base class for modifiers which need more capabilities than function-based\n * modifiers. Useful if, for example:\n *\n * 1. You need to inject services and access them\n * 2. You need fine-grained control of updates, either for performance or\n * convenience reasons, and don't want to teardown the state of your modifier\n * every time only to set it up again.\n * 3. You need to store some local state within your modifier.\n *\n * The lifecycle hooks of class modifiers are tracked. When they run, they any\n * values they access will be added to the modifier, and the modifier will\n * update if any of those values change.\n */\nexport default class ClassBasedModifier {\n // Done this way with the weird combination of `declare` and `defineProperty`\n // so that subclasses which are overriding this by writing their own `args`\n // field type declarations continue to type check correctly. (If we introduced\n // a getter here, existing classes defining their args via a `declare args:`\n // would stop type checking, because TS -- correctly! -- differentiates\n // between class fields and getters).\n /**\n * The arguments passed to the modifier. `args.positional` is an array of\n * positional arguments, and `args.named` is an object containing the named\n * arguments.\n *\n * @deprecated Until 4.0. Access positional and named arguments directly in\n * the `modify` hook instead.\n */\n\n // Done this way with the weird combination of `declare` and `defineProperty`\n // so that subclasses which are overriding this by writing their own `element`\n // field declarations continue to type check correctly.\n /**\n * The element the modifier is applied to.\n *\n * @warning `element` is ***not*** available during `constructor` or\n * `willDestroy`.\n * @deprecated Until 4.0. Access the `element` as an argument in the `modify`\n * hook instead.\n */\n\n constructor(owner, args) {\n setOwner(this, owner);\n\n // SAFETY: the point here is (for the period where we are providing `args`\n // and `element`) to provide an internal-only way of setting and update the\n // `args` for the modifier instance; we use the `InternalClassBasedModifier`\n // interface to represent the internal-only API in a way that end users do\n // *not* have access to when subclassing `ClassBasedModifier`.\n this[Args] = args;\n assert('ember-modifier: You cannot implement both `modify` and any of the deprecated legacy lifecycle hooks (`didInstall`, `didReceiveArguments`, and `didUpdateArguments`)', !(_implementsModify(this) && _implementsLegacyHooks(this)));\n deprecate(`ember-modifier (in ${this.constructor.name} at ${new Error().stack}): \\`willDestroy\\`, \\`isDestroyed\\`, and \\`isDestroyed\\` are deprecated. Use the corresponding API from '@ember/destroyable' instead.`, this.willDestroy === ClassBasedModifier.prototype.willDestroy || SEEN_CLASSES_FOR_DESTROYABLES.has(this.constructor), {\n id: 'ember-modifier.use-destroyables',\n until: '4.0.0',\n for: 'ember-modifier',\n since: {\n available: '3.2.0',\n enabled: '3.2.0'\n }\n });\n if (DEBUG && !SEEN_CLASSES_FOR_DESTROYABLES.has(this.constructor)) {\n SEEN_CLASSES_FOR_DESTROYABLES.add(this.constructor);\n }\n deprecate(`ember-modifier (in ${this.constructor.name} at ${new Error().stack}): The \\`didInstall\\`, \\`didReceiveArguments\\`, and \\`didUpdateArguments\\` hooks are deprecated. Use the new \\`modify\\` hook instead.`, _implementsModify(this) || SEEN_CLASSES_FOR_LIFECYCLE.has(this.constructor), {\n id: 'ember-modifier.use-modify',\n until: '4.0.0',\n for: 'ember-modifier',\n since: {\n available: '3.2.0',\n enabled: '3.2.0'\n }\n });\n if (DEBUG && !SEEN_CLASSES_FOR_LIFECYCLE.has(this.constructor)) {\n SEEN_CLASSES_FOR_LIFECYCLE.add(this.constructor);\n }\n }\n\n /**\n * Called when the modifier is installed and any time any tracked state used\n * in the modifier changes.\n *\n * If you need to do first-time-only setup, create a class field representing\n * the initialization state and check it when running the hook. That is also\n * where and when you should use `registerDestructor` for any teardown you\n * need to do. For example:\n *\n * ```js\n * function disconnect(instance) {\n * instance.observer?.disconnect();\n * }\n *\n * class IntersectionObserver extends Modifier {\n * observer;\n *\n * constructor(owner, args) {\n * super(owner, args);\n * registerDestructor(this, disconnect);\n * }\n *\n * modify(element, callback, options) {\n * disconnect(this);\n *\n * this.observer = new IntersectionObserver(callback, options);\n * this.observer.observe(element);\n * }\n * }\n * ```\n *\n * @param element The element to which the modifier is applied.\n * @param positional The positional arguments to the modifier.\n * @param named The named arguments to the modifier.\n */\n modify( /* eslint-disable @typescript-eslint/no-unused-vars */\n element, positional, named) {\n /* no op, for subclassing */\n }\n\n /**\n * Called when the modifier is installed **and** anytime the arguments are\n * updated.\n *\n * @deprecated Until 4.0. Use `modify()`.\n */\n didReceiveArguments() {\n /* no op, for subclassing */\n }\n\n /**\n * Called anytime the arguments are updated but **not** on the initial\n * install. Called before `didReceiveArguments`.\n *\n * @deprecated Until 4.0. Use `modify()`.\n */\n didUpdateArguments() {\n /* no op, for subclassing */\n }\n\n /**\n * Called when the modifier is installed on the DOM element. Called after\n * `didReceiveArguments`.\n *\n * @deprecated Until 4.0. Use `modify()`.\n */\n didInstall() {\n /* no op, for subclassing */\n }\n\n /**\n * Called when the DOM element is about to be destroyed; use for removing\n * event listeners on the element and other similar clean-up tasks.\n *\n * @deprecated since 2.0.0: prefer to use `willDestroy`, since both it and\n * `willRemove` can perform all the same operations, including on the\n * `element`.\n */\n willRemove() {\n /* no op, for subclassing */\n }\n\n /**\n * Called when the modifier itself is about to be destroyed; use for teardown\n * code. Called after `willRemove`.\n *\n * @deprecated Until 4.0. Use `registerDestructor` from `@ember/destroyables`.\n */\n willDestroy() {\n /* no op, for subclassing */\n }\n\n /**\n * @deprecated Until 4.0. Use `isDestroying` from `@ember/destroyables`.\n */\n get isDestroying() {\n deprecate('Modifier.isDestroying is deprecated', SEEN_CLASSES_FOR_DESTROYABLES.has(this.constructor), {\n id: 'ember-modifier.use-destroyables',\n until: '4.0.0',\n for: 'ember-modifier',\n since: {\n available: '3.2.0',\n enabled: '3.2.0'\n }\n });\n if (DEBUG && !SEEN_CLASSES_FOR_DESTROYABLES.has(this.constructor)) {\n SEEN_CLASSES_FOR_DESTROYABLES.add(this.constructor);\n }\n return isDestroying(this);\n }\n\n /**\n * @deprecated Until 4.0. Use `isDestroyed` from `@ember/destroyables`.\n */\n get isDestroyed() {\n deprecate('Modifier.isDestroyed is deprecated', SEEN_CLASSES_FOR_DESTROYABLES.has(this.constructor), {\n id: 'ember-modifier.use-destroyables',\n until: '4.0.0',\n for: 'ember-modifier',\n since: {\n available: '3.2.0',\n enabled: '3.2.0'\n }\n });\n if (DEBUG && !SEEN_CLASSES_FOR_DESTROYABLES.has(this.constructor)) {\n SEEN_CLASSES_FOR_DESTROYABLES.add(this.constructor);\n }\n return isDestroyed(this);\n }\n}\n\n// We apply these here, against the prototype, so that there is only one of\n// these, rather than one per instance. We also only issue the deprecation once\n// per class for each of `args` and `element`.\nObject.defineProperty(ClassBasedModifier.prototype, 'args', {\n enumerable: true,\n get() {\n deprecate(`ember-modifier (in ${this.constructor.name} at ${new Error().stack}): using \\`this.args\\` is deprecated. Access positional and named arguments directly in the \\`modify\\` hook instead.`, SEEN_CLASSES_FOR_ARGS.has(this.constructor), {\n id: 'ember-modifier.no-args-property',\n for: 'ember-modifier',\n since: {\n available: '3.2.0',\n enabled: '3.2.0'\n },\n until: '4.0.0'\n });\n if (DEBUG && !SEEN_CLASSES_FOR_ARGS.has(this.constructor)) {\n SEEN_CLASSES_FOR_ARGS.add(this.constructor);\n }\n return this[Args];\n }\n});\nObject.defineProperty(ClassBasedModifier.prototype, 'element', {\n enumerable: true,\n get() {\n deprecate(`ember-modifier (in ${this.constructor.name} at ${new Error().stack}): using \\`this.element\\` is deprecated. Access the \\`element\\` as an argument in the \\`modify\\` hook instead.`, SEEN_CLASSES_FOR_ELEMENTS.has(this.constructor), {\n id: 'ember-modifier.no-element-property',\n for: 'ember-modifier',\n since: {\n available: '3.2.0',\n enabled: '3.2.0'\n },\n until: '4.0.0'\n });\n if (DEBUG && !SEEN_CLASSES_FOR_ELEMENTS.has(this.constructor)) {\n SEEN_CLASSES_FOR_ELEMENTS.add(this.constructor);\n }\n return this[Element] ?? null;\n }\n});\n\n/**\n * @internal This provides an interface we can use to backwards-compatibly set\n * up the element in a way that external callers will not have access to or\n * even see.\n */\n\nsetModifierManager(owner => new Manager(owner), ClassBasedModifier);","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { capabilities } from '@ember/modifier';\nimport { consumeArgs, isFactory } from '../compat';\n// Wraps the unsafe (b/c it mutates, rather than creating new state) code that\n// TS does not yet understand.\nfunction installElement(state, element) {\n // SAFETY: this cast represents how we are actually handling the state machine\n // transition: from this point forward in the lifecycle of the modifier, it\n // always behaves as `InstalledState`. It is safe because, and *only*\n // because, we immediately initialize `element`. (We cannot create a new state\n // from the old one because the modifier manager API expects mutation of a\n // single state bucket rather than updating it at hook calls.)\n const installedState = state;\n installedState.element = element;\n return installedState;\n}\nexport default class FunctionBasedModifierManager {\n constructor(options) {\n _defineProperty(this, \"capabilities\", capabilities(true ? '3.22' : '3.13'));\n _defineProperty(this, \"options\", void 0);\n this.options = {\n eager: options?.eager ?? true\n };\n }\n createModifier(factoryOrClass) {\n const instance = isFactory(factoryOrClass) ? factoryOrClass.class : factoryOrClass;\n return {\n element: null,\n instance: instance\n };\n }\n installModifier(createdState, element, args) {\n const state = installElement(createdState, element);\n const {\n positional,\n named\n } = args;\n const teardown = createdState.instance(element, positional, named);\n if (typeof teardown === 'function') {\n state.teardown = teardown;\n }\n if (true && this.options.eager) {\n consumeArgs(args);\n }\n }\n updateModifier(state, args) {\n if (state.teardown) {\n state.teardown();\n }\n const teardown = state.instance(state.element, args.positional, args.named);\n if (typeof teardown === 'function') {\n state.teardown = teardown;\n }\n if (true && this.options.eager) {\n consumeArgs(args);\n }\n }\n destroyModifier(state) {\n if (typeof state.teardown === 'function') {\n state.teardown();\n }\n }\n}","import { deprecate } from '@ember/debug';\nimport { setModifierManager } from '@ember/modifier';\nimport Modifier from '../class/modifier';\nimport FunctionBasedModifierManager from './modifier-manager';\n\n// Provide a singleton manager for each of the options. (If we extend this to\n// many more options in the future, we can revisit, but for now this means we\n// only ever allocate two managers.)\nconst EAGER_MANAGER = new FunctionBasedModifierManager({\n eager: true\n});\nconst LAZY_MANAGER = new FunctionBasedModifierManager({\n eager: false\n});\n\n// This type exists to provide a non-user-constructible, non-subclassable\n// type representing the conceptual \"instance type\" of a function modifier.\n// The abstract field of type `never` prevents subclassing in userspace of\n// the value returned from `modifier()`. By extending `Modifier`, any\n// augmentations of the `Modifier` type performed by tools like Glint will\n// also apply to function-based modifiers as well.\n\n// This provides a type whose only purpose here is to represent the runtime\n// type of a function-based modifier: a virtually opaque item. The fact that it's\n// a bare constructor type allows `modifier()` to preserve type parameters from\n// a generic function it's passed, and by making it abstract and impossible to\n// subclass (see above) we prevent users from attempting to instantiate the return\n// value from a `modifier()` call.\n\n/**\n * The (optional) return type for a modifier which needs to perform some kind of\n * cleanup or teardown -- for example, removing an event listener from an\n * element besides the one passed into the modifier.\n */\n\n/**\n * An API for writing simple modifiers.\n *\n * This function runs the first time when the element the modifier was applied\n * to is inserted into the DOM, and it *autotracks* while running. Any values\n * that it accesses will be tracked, and if any of them changes, the function\n * will run again.\n *\n * **Note:** this will rerun if any of its arguments change, *whether or not you\n * access them*. This is legacy behavior and you should switch to using the\n * `{ eager: false }` variant, which has normal auto-tracking semantics.\n *\n * The modifier can also optionally return a *destructor*. The destructor\n * function will be run just before the next update, and when the element is\n * being removed entirely. It should generally clean up the changes that the\n * modifier made in the first place.\n *\n * @deprecated Until 4.0. Calling `modifier()` without an options argument is\n * deprecated. It is supported until 4.0 so that existing modifiers can be\n * migrated individually. Please update your function-based modifiers to pass\n * `{ eager: false }`.\n *\n * @param fn The function which defines the modifier.\n */\n// This overload allows users to write types directly on the callback passed to\n// the `modifier` function and infer the resulting type correctly.\n\n/**\n * An API for writing simple modifiers.\n *\n * This function runs the first time when the element the modifier was applied\n * to is inserted into the DOM, and it *autotracks* while running. Any values\n * that it accesses will be tracked, and if any of them changes, the function\n * will run again.\n *\n * **Note:** this will rerun if any of its arguments change, *whether or not you\n * access them*. This is legacy behavior and you should switch to using the\n * `{ eager: false }` variant, which has normal auto-tracking semantics.\n *\n * The modifier can also optionally return a *destructor*. The destructor\n * function will be run just before the next update, and when the element is\n * being removed entirely. It should generally clean up the changes that the\n * modifier made in the first place.\n *\n * @deprecated Until 4.0. Calling `modifier()` with `{ eager: true }` is\n * deprecated. It is supported until 4.0 so that existing modifiers can be\n * migrated individually. Please update your function-based modifiers to pass\n * `{ eager: false }`.\n *\n * @param fn The function which defines the modifier.\n * @param options Configuration for the modifier.\n */\n// This overload allows users to write types directly on the callback passed to\n// the `modifier` function and infer the resulting type correctly.\n\n/**\n * An API for writing simple modifiers.\n *\n * This function runs the first time when the element the modifier was applied\n * to is inserted into the DOM, and it *autotracks* while running. Any values\n * that it accesses will be tracked, including any of its arguments that it\n * accesses, and if any of them changes, the function will run again.\n *\n * **Note:** this will *not* automatically rerun because an argument changes. It\n * will only rerun if it is *using* that argument (the same as with auto-tracked\n * state in general).\n *\n * The modifier can also optionally return a *destructor*. The destructor\n * function will be run just before the next update, and when the element is\n * being removed entirely. It should generally clean up the changes that the\n * modifier made in the first place.\n *\n * @param fn The function which defines the modifier.\n * @param options Configuration for the modifier.\n */\n// This overload allows users to write types directly on the callback passed to\n// the `modifier` function and infer the resulting type correctly.\n\n/**\n * An API for writing simple modifiers.\n *\n * This function runs the first time when the element the modifier was applied\n * to is inserted into the DOM, and it *autotracks* while running. Any values\n * that it accesses will be tracked, including any of its arguments that it\n * accesses, and if any of them changes, the function will run again.\n *\n * **Note:** this will *not* automatically rerun because an argument changes. It\n * will only rerun if it is *using* that argument (the same as with auto-tracked\n * state in general).\n *\n * The modifier can also optionally return a *destructor*. The destructor\n * function will be run just before the next update, and when the element is\n * being removed entirely. It should generally clean up the changes that the\n * modifier made in the first place.\n *\n * @param fn The function which defines the modifier.\n * @param options Configuration for the modifier.\n */\n// This overload allows users to provide a `Signature` type explicitly at the\n// modifier definition site, e.g. `modifier((el, pos, named) => {...})`.\n// **Note:** this overload must appear second, since TS' inference engine will\n// not correctly infer the type of `S` here from the types on the supplied\n// callback.\n\n// This is the runtime signature; it performs no inference whatsover and just\n// uses the simplest version of the invocation possible since, for the case of\n// setting it on the modifier manager, we don't *need* any of that info, and\n// the two previous overloads capture all invocations from a type perspective.\nexport default function modifier(fn, options = {\n eager: true\n}) {\n deprecate(`ember-modifier (for ${fn.name ?? fn} at ${new Error().stack}): creating a function-based modifier without options is deprecated and will be removed at v4.0`, options !== undefined, {\n id: 'ember-modifier.function-based-options',\n for: 'ember-modifier',\n since: {\n available: '3.2.0',\n enabled: '3.2.0'\n },\n until: '4.0.0'\n });\n deprecate(`ember-modifier (for ${fn.name ?? fn} at ${new Error().stack}): creating a function-based modifier with \\`{ eager: true }\\` is deprecated and will be removed at v4.0`, options?.eager === false, {\n id: 'ember-modifier.function-based-options',\n for: 'ember-modifier',\n since: {\n available: '3.2.0',\n enabled: '3.2.0'\n },\n until: '4.0.0'\n });\n\n // SAFETY: the cast here is a *lie*, but it is a useful one. The actual return\n // type of `setModifierManager` today is `void`; we pretend it actually\n // returns an opaque `Modifier` type so that we can provide a result from this\n // type which is useful to TS-aware tooling (e.g. Glint).\n return setModifierManager(() => options.eager ? EAGER_MANAGER : LAZY_MANAGER, fn);\n}\n\n/**\n * @internal\n */\n\n/**\n * @deprecated Instead of defining a function to match this type, simply define\n * a function-based modifier either using a `Signature` or by defining the\n * types on the callback passed to the `modifier`.\n */","// https://github.com/zeppelin/ember-click-outside/issues/23\n\nconst proto = typeof Element !== 'undefined' ? Element.prototype : {};\nconst vendor = proto.matches || proto.matchesSelector || proto.webkitMatchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector;\nexport function matches(el, selector) {\n if (!el || el.nodeType !== 1) return false;\n if (vendor) return vendor.call(el, selector);\n var nodes = el.parentNode.querySelectorAll(selector);\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i] == el) return true;\n }\n return false;\n}","/* eslint no-console: \"off\" */\nimport { matches } from './-private/matches-selector';\nexport function closest(element, selector) {\n if (matches(element, selector)) {\n return element;\n }\n while (element.parentNode) {\n element = element.parentNode;\n if (matches(element, selector)) {\n return element;\n }\n }\n}\nexport const documentOrBodyContains = element => {\n // https://github.com/zeppelin/ember-click-outside/issues/30\n if (typeof document.contains === 'function') {\n return document.contains(element);\n } else {\n return document.body.contains(element);\n }\n};\nexport const ios = () => {\n return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n};\n\n// https://github.com/mike-north/ember-deprecated/blob/master/addon/utils.js\nexport function printConsoleMessage(msg) {\n if (console.trace) {\n if (console.groupCollapsed) {\n console.groupCollapsed(msg);\n console.trace();\n console.groupEnd();\n } else {\n console.warn(msg);\n console.trace();\n }\n } else {\n console.warn(msg);\n }\n}","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { next, cancel } from '@ember/runloop';\nimport { registerDestructor } from '@ember/destroyable';\nimport Modifier from 'ember-modifier';\nimport { closest, documentOrBodyContains, ios } from './utils';\nexport default class ClickOutsideModifier extends Modifier {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"didSetup\", false);\n _defineProperty(this, \"action\", null);\n _defineProperty(this, \"capture\", null);\n _defineProperty(this, \"eventHandler\", null);\n _defineProperty(this, \"eventType\", 'click');\n _defineProperty(this, \"exceptSelector\", null);\n _defineProperty(this, \"cancelOutsideListenerSetup\", null);\n _defineProperty(this, \"cleanup\", () => {\n this._destroy();\n if (ios()) {\n document.body.style.cursor = '';\n }\n });\n registerDestructor(this, this.cleanup);\n }\n modify(element, [action], {\n capture,\n eventType,\n exceptSelector\n }) {\n if (!this.didSetup) {\n if (ios()) {\n document.body.style.cursor = 'pointer';\n }\n this.didSetup = true;\n } else {\n this._destroy();\n }\n this._init({\n element,\n action,\n capture,\n eventType,\n exceptSelector\n });\n }\n _init({\n element,\n action,\n capture,\n eventType,\n exceptSelector\n }) {\n if (!action) {\n return;\n }\n this.action = action;\n this.exceptSelector = exceptSelector;\n this.capture = capture;\n if (eventType) {\n this.eventType = eventType;\n }\n this.eventHandler = this._createHandler(element, this.action, this.exceptSelector);\n this.cancelOutsideListenerSetup = next(this, this._addClickOutsideListener);\n }\n _destroy() {\n if (!this.action) {\n return;\n }\n cancel(this.cancelOutsideListenerSetup);\n this._removeClickOutsideListener();\n }\n _addClickOutsideListener() {\n let {\n capture,\n eventHandler,\n eventType\n } = this;\n document.addEventListener(eventType, eventHandler, {\n capture\n });\n }\n _removeClickOutsideListener() {\n let {\n capture,\n eventHandler,\n eventType\n } = this;\n document.removeEventListener(eventType, eventHandler, {\n capture\n });\n }\n _createHandler(element, action, exceptSelector) {\n return e => {\n if (exceptSelector && closest(e.target, exceptSelector)) {\n return;\n }\n let path = e.path || e.composedPath && e.composedPath();\n if (path) {\n path.includes(element) || action(e);\n } else {\n // Check if the click target still is in the DOM.\n // If not, there is no way to know if it was inside the element or not.\n let isRemoved = !e.target || !documentOrBodyContains(e.target);\n\n // Check the element is found as a parent of the click target.\n let isInside = element === e.target || element.contains(e.target);\n if (!isRemoved && !isInside) {\n action(e);\n }\n }\n };\n }\n}","import { typeOf, isEmpty } from '@ember/utils';\n\nexport const serializeCookie = (name, value, options = {}) => {\n let cookie = `${name}=${value}`;\n\n if (!isEmpty(options.domain)) {\n cookie = `${cookie}; domain=${options.domain}`;\n }\n if (typeOf(options.expires) === 'date') {\n cookie = `${cookie}; expires=${options.expires.toUTCString()}`;\n }\n if (!isEmpty(options.maxAge)) {\n cookie = `${cookie}; max-age=${options.maxAge}`;\n }\n if (options.secure) {\n cookie = `${cookie}; secure`;\n }\n if (options.httpOnly) {\n cookie = `${cookie}; httpOnly`;\n }\n if (!isEmpty(options.path)) {\n cookie = `${cookie}; path=${options.path}`;\n }\n if (!isEmpty(options.sameSite)) {\n cookie = `${cookie}; SameSite=${options.sameSite}`;\n }\n\n return cookie;\n};\n","import { isNone, isPresent, isEmpty } from '@ember/utils';\nimport { get } from '@ember/object';\nimport { assert } from '@ember/debug';\nimport { getOwner } from '@ember/application';\nimport Service from '@ember/service';\nimport { merge, assign as emberAssign } from '@ember/polyfills';\nimport { serializeCookie } from '../utils/serialize-cookie';\nconst { keys } = Object;\nconst assign = Object.assign || emberAssign || merge;\nconst DEFAULTS = { raw: false };\nconst MAX_COOKIE_BYTE_LENGTH = 4096;\n\nexport default Service.extend({\n init() {\n this._super(...arguments);\n\n this._document = this._document || window.document;\n if (typeof this._fastBoot === 'undefined') {\n let owner = getOwner(this);\n\n this._fastBoot = owner.lookup('service:fastboot');\n }\n },\n\n _getDocumentCookies() {\n let all = this._document.cookie.split(';');\n let filtered = this._filterDocumentCookies(all);\n\n return filtered.reduce((acc, cookie) => {\n if (!isEmpty(cookie)) {\n let [key, value] = cookie;\n acc[key.trim()] = (value || '').trim();\n }\n return acc;\n }, {});\n },\n\n _getFastBootCookies() {\n let fastBootCookies = get(this._fastBoot, 'request.cookies');\n fastBootCookies = keys(fastBootCookies).reduce((acc, name) => {\n let value = fastBootCookies[name];\n acc[name] = { value };\n return acc;\n }, {});\n\n let fastBootCookiesCache = this._fastBootCookiesCache || {};\n fastBootCookies = assign({}, fastBootCookies, fastBootCookiesCache);\n this._fastBootCookiesCache = fastBootCookies;\n\n return this._filterCachedFastBootCookies(fastBootCookies);\n },\n\n read(name, options = {}) {\n options = assign({}, DEFAULTS, options || {});\n assert('Domain, Expires, Max-Age, and Path options cannot be set when reading cookies', isEmpty(options.domain) && isEmpty(options.expires) && isEmpty(options.maxAge) && isEmpty(options.path));\n\n let all;\n if (this._isFastBoot()) {\n all = this._getFastBootCookies();\n } else {\n all = this._getDocumentCookies();\n }\n\n if (name) {\n return this._decodeValue(all[name], options.raw);\n } else {\n keys(all).forEach((name) => (all[name] = this._decodeValue(all[name], options.raw)));\n return all;\n }\n },\n\n write(name, value, options = {}) {\n options = assign({}, DEFAULTS, options || {});\n assert(\"Cookies cannot be set as signed as signed cookies would not be modifyable in the browser as it has no knowledge of the express server's signing key!\", !options.signed);\n assert('Cookies cannot be set with both maxAge and an explicit expiration time!', isEmpty(options.expires) || isEmpty(options.maxAge));\n\n value = this._encodeValue(value, options.raw);\n\n assert(`Cookies larger than ${MAX_COOKIE_BYTE_LENGTH} bytes are not supported by most browsers!`, this._isCookieSizeAcceptable(value));\n\n if (this._isFastBoot()) {\n this._writeFastBootCookie(name, value, options);\n } else {\n assert('Cookies cannot be set to be HTTP-only from a browser!', !options.httpOnly);\n\n options.path = options.path || this._normalizedDefaultPath();\n this._writeDocumentCookie(name, value, options);\n }\n },\n\n clear(name, options = {}) {\n options = assign({}, options || {});\n assert('Expires, Max-Age, and raw options cannot be set when clearing cookies', isEmpty(options.expires) && isEmpty(options.maxAge) && isEmpty(options.raw));\n\n options.expires = new Date('1970-01-01');\n options.path = options.path || this._normalizedDefaultPath();\n this.write(name, null, options);\n },\n\n exists(name) {\n let all;\n if (this._isFastBoot()) {\n all = this._getFastBootCookies();\n } else {\n all = this._getDocumentCookies();\n }\n\n return all.hasOwnProperty(name);\n },\n\n _writeDocumentCookie(name, value, options = {}) {\n let serializedCookie = this._serializeCookie(name, value, options);\n this._document.cookie = serializedCookie;\n },\n\n _writeFastBootCookie(name, value, options = {}) {\n let responseHeaders = get(this._fastBoot, 'response.headers');\n let serializedCookie = this._serializeCookie(...arguments);\n\n if (!isEmpty(options.maxAge)) {\n options.maxAge *= 1000;\n }\n\n this._cacheFastBootCookie(...arguments);\n\n let replaced = false;\n let existing = responseHeaders.getAll('set-cookie');\n\n for (let i = 0; i < existing.length; i++) {\n if (existing[i].startsWith(`${name}=`)) {\n existing[i] = serializedCookie;\n replaced = true;\n break;\n }\n }\n\n if (!replaced) {\n responseHeaders.append('set-cookie', serializedCookie);\n }\n },\n\n _cacheFastBootCookie(name, value, options = {}) {\n let fastBootCache = this._fastBootCookiesCache || {};\n let cachedOptions = assign({}, options);\n\n if (cachedOptions.maxAge) {\n let expires = new Date();\n expires.setSeconds(expires.getSeconds() + options.maxAge);\n cachedOptions.expires = expires;\n delete cachedOptions.maxAge;\n }\n\n fastBootCache[name] = { value, options: cachedOptions };\n this._fastBootCookiesCache = fastBootCache;\n },\n\n _filterCachedFastBootCookies(fastBootCookies) {\n let { path: requestPath, protocol } = get(this._fastBoot, 'request');\n\n // cannot use deconstruct here\n let host = get(this._fastBoot, 'request.host');\n\n return keys(fastBootCookies).reduce((acc, name) => {\n let { value, options } = fastBootCookies[name];\n options = options || {};\n\n let { path: optionsPath, domain, expires, secure } = options;\n\n if (optionsPath && requestPath.indexOf(optionsPath) !== 0) {\n return acc;\n }\n\n if (domain && host.indexOf(domain) + domain.length !== host.length) {\n return acc;\n }\n\n if (expires && expires < new Date()) {\n return acc;\n }\n\n if (secure && !(protocol || '').match(/^https/)) {\n return acc;\n }\n\n acc[name] = value;\n return acc;\n }, {});\n },\n\n _encodeValue(value, raw) {\n if (isNone(value)) {\n return '';\n } else if (raw) {\n return value;\n } else {\n return encodeURIComponent(value);\n }\n },\n\n _decodeValue(value, raw) {\n if (isNone(value) || raw) {\n return value;\n } else {\n return decodeURIComponent(value);\n }\n },\n\n _filterDocumentCookies(unfilteredCookies) {\n return unfilteredCookies.map((c) => {\n let separatorIndex = c.indexOf('=');\n return [c.substring(0, separatorIndex), c.substring(separatorIndex + 1)];\n })\n .filter((c) => c.length === 2 && isPresent(c[0]));\n },\n\n _serializeCookie(name, value, options = {}) {\n return serializeCookie(name, value, options);\n },\n\n _isCookieSizeAcceptable(value) {\n // Counting bytes varies Pre-ES6 and in ES6\n // This snippet counts the bytes in the value\n // about to be stored as the cookie:\n // See https://stackoverflow.com/a/25994411/6657064\n let _byteCount = 0;\n let i = 0;\n let c;\n while ((c = value.charCodeAt(i++))) {\n /* eslint-disable no-bitwise */\n _byteCount += c >> 11 ? 3 : c >> 7 ? 2 : 1;\n /* eslint-enable no-bitwise */\n }\n\n return _byteCount < MAX_COOKIE_BYTE_LENGTH;\n },\n\n _normalizedDefaultPath() {\n if (!this._isFastBoot()) {\n let pathname = window.location.pathname;\n return pathname.substring(0, pathname.lastIndexOf('/'));\n }\n },\n\n _isFastBoot() {\n return this._fastBoot && this._fastBoot.isFastBoot;\n }\n});\n","import CookiesService from 'ember-cookies/services/cookies';\n\nexport default CookiesService;\n","import 'ember-data';\n\nimport setupContainer from 'ember-data/setup-container';\n\n/*\n This code initializes EmberData in an Ember application.\n*/\nexport default {\n name: 'ember-data',\n initialize: setupContainer,\n};\n","/* exists only for things that historically used \"after\" or \"before\" */\nexport default {\n name: 'ember-data',\n initialize() {},\n};\n","export default \"4.6.5\";\n","import Namespace from '@ember/application/namespace';\nimport Ember from 'ember';\nimport VERSION from 'ember-data/version';\nconst DS = Namespace.create({\n VERSION: VERSION,\n name: 'DS'\n});\nif (Ember.libraries) {\n Ember.libraries.registerCoreLibrary('Ember Data', VERSION);\n}\nexport default DS;","import 'ember-inflector';\nimport { dependencySatisfies, importSync, macroCondition } from '@embroider/macros';\nimport Adapter, { BuildURLMixin } from '@ember-data/adapter';\nimport AdapterError, { AbortError, ConflictError, errorsArrayToHash, errorsHashToArray, ForbiddenError, InvalidError, NotFoundError, ServerError, TimeoutError, UnauthorizedError } from '@ember-data/adapter/error';\nimport JSONAPIAdapter from '@ember-data/adapter/json-api';\nimport RESTAdapter from '@ember-data/adapter/rest';\nimport Model, { attr, belongsTo, hasMany } from '@ember-data/model';\nimport Serializer from '@ember-data/serializer';\nimport { BooleanTransform, DateTransform, NumberTransform, StringTransform } from '@ember-data/serializer/-private';\nimport JSONSerializer from '@ember-data/serializer/json';\nimport JSONAPISerializer from '@ember-data/serializer/json-api';\nimport RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\nimport Transform from '@ember-data/serializer/transform';\nimport Store, { normalizeModelName } from '@ember-data/store';\nimport { AdapterPopulatedRecordArray, DS, Errors, InternalModel, ManyArray, PromiseArray, PromiseManyArray, PromiseObject, RecordArray, RecordArrayManager, Relationship, Snapshot } from './-private';\nimport setupContainer from './setup-container';\nDS.Store = Store;\nDS.PromiseArray = PromiseArray;\nDS.PromiseObject = PromiseObject;\nDS.PromiseManyArray = PromiseManyArray;\nDS.Model = Model;\nDS.attr = attr;\nDS.Errors = Errors;\nDS.InternalModel = InternalModel;\nDS.Snapshot = Snapshot;\nDS.Adapter = Adapter;\nDS.AdapterError = AdapterError;\nDS.InvalidError = InvalidError;\nDS.TimeoutError = TimeoutError;\nDS.AbortError = AbortError;\nDS.UnauthorizedError = UnauthorizedError;\nDS.ForbiddenError = ForbiddenError;\nDS.NotFoundError = NotFoundError;\nDS.ConflictError = ConflictError;\nDS.ServerError = ServerError;\nDS.errorsHashToArray = errorsHashToArray;\nDS.errorsArrayToHash = errorsArrayToHash;\nDS.Serializer = Serializer;\nif (macroCondition(dependencySatisfies('@ember-data/debug', '*'))) {\n DS.DebugAdapter = importSync('@ember-data/debug').default;\n}\nDS.RecordArray = RecordArray;\nDS.AdapterPopulatedRecordArray = AdapterPopulatedRecordArray;\nDS.ManyArray = ManyArray;\nDS.RecordArrayManager = RecordArrayManager;\nDS.RESTAdapter = RESTAdapter;\nDS.BuildURLMixin = BuildURLMixin;\nDS.RESTSerializer = RESTSerializer;\nDS.JSONSerializer = JSONSerializer;\nDS.JSONAPIAdapter = JSONAPIAdapter;\nDS.JSONAPISerializer = JSONAPISerializer;\nDS.Transform = Transform;\nDS.DateTransform = DateTransform;\nDS.StringTransform = StringTransform;\nDS.NumberTransform = NumberTransform;\nDS.BooleanTransform = BooleanTransform;\nDS.EmbeddedRecordsMixin = EmbeddedRecordsMixin;\nDS.belongsTo = belongsTo;\nDS.hasMany = hasMany;\nDS.Relationship = Relationship;\nDS._setupContainer = setupContainer;\nObject.defineProperty(DS, 'normalizeModelName', {\n enumerable: true,\n writable: false,\n configurable: false,\n value: normalizeModelName\n});\nexport default DS;","import Store from '@ember-data/store';\nfunction initializeStore(application) {\n application.registerOptionsForType('serializer', {\n singleton: false\n });\n application.registerOptionsForType('adapter', {\n singleton: false\n });\n if (!application.hasRegistration('service:store')) {\n application.register('service:store', Store);\n }\n}\nexport default function setupContainer(application) {\n initializeStore(application);\n}","/* global require */\nimport { getOwnConfig } from '@embroider/macros';\nlet configModulePath = `${getOwnConfig().modulePrefix}/config/environment`;\nexport default require(configModulePath).default;","export default {\n plurals: [\n [/$/, 's'],\n [/s$/i, 's'],\n [/^(ax|test)is$/i, '$1es'],\n [/(octop|vir)us$/i, '$1i'],\n [/(octop|vir)i$/i, '$1i'],\n [/(alias|status|bonus)$/i, '$1es'],\n [/(bu)s$/i, '$1ses'],\n [/(buffal|tomat)o$/i, '$1oes'],\n [/([ti])um$/i, '$1a'],\n [/([ti])a$/i, '$1a'],\n [/sis$/i, 'ses'],\n [/(?:([^f])fe|([lr])f)$/i, '$1$2ves'],\n [/(hive)$/i, '$1s'],\n [/([^aeiouy]|qu)y$/i, '$1ies'],\n [/(x|ch|ss|sh)$/i, '$1es'],\n [/(matr|vert|ind)(?:ix|ex)$/i, '$1ices'],\n [/^(m|l)ouse$/i, '$1ice'],\n [/^(m|l)ice$/i, '$1ice'],\n [/^(ox)$/i, '$1en'],\n [/^(oxen)$/i, '$1'],\n [/(quiz)$/i, '$1zes'],\n ],\n\n singular: [\n [/s$/i, ''],\n [/(ss)$/i, '$1'],\n [/(n)ews$/i, '$1ews'],\n [/([ti])a$/i, '$1um'],\n [\n /((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i,\n '$1sis',\n ],\n [/(^analy)(sis|ses)$/i, '$1sis'],\n [/([^f])ves$/i, '$1fe'],\n [/(hive)s$/i, '$1'],\n [/(tive)s$/i, '$1'],\n [/([lr])ves$/i, '$1f'],\n [/([^aeiouy]|qu)ies$/i, '$1y'],\n [/(s)eries$/i, '$1eries'],\n [/(m)ovies$/i, '$1ovie'],\n [/(x|ch|ss|sh)es$/i, '$1'],\n [/^(m|l)ice$/i, '$1ouse'],\n [/(bus)(es)?$/i, '$1'],\n [/(o)es$/i, '$1'],\n [/(shoe)s$/i, '$1'],\n [/(cris|test)(is|es)$/i, '$1is'],\n [/^(a)x[ie]s$/i, '$1xis'],\n [/(octop|vir)(us|i)$/i, '$1us'],\n [/(alias|status|bonus)(es)?$/i, '$1'],\n [/^(ox)en/i, '$1'],\n [/(vert|ind)ices$/i, '$1ex'],\n [/(matr)ices$/i, '$1ix'],\n [/(quiz)zes$/i, '$1'],\n [/(database)s$/i, '$1'],\n ],\n\n irregularPairs: [\n ['person', 'people'],\n ['man', 'men'],\n ['child', 'children'],\n ['sex', 'sexes'],\n ['move', 'moves'],\n ['cow', 'kine'],\n ['zombie', 'zombies'],\n ],\n\n uncountable: [\n 'equipment',\n 'information',\n 'rice',\n 'money',\n 'species',\n 'series',\n 'fish',\n 'sheep',\n 'jeans',\n 'police',\n ],\n};\n","import defaultRules from './inflections';\n\nconst BLANK_REGEX = /^\\s*$/;\nconst LAST_WORD_DASHED_REGEX = /([\\w/-]+[_/\\s-])([a-z\\d]+$)/;\nconst LAST_WORD_CAMELIZED_REGEX = /([\\w/\\s-]+)([A-Z][a-z\\d]*$)/;\nconst CAMELIZED_REGEX = /[A-Z][a-z\\d]*$/;\nconst CAPITALIZE_REGEX = /(^|\\/)([a-z\\u00C0-\\u024F])/g;\n\nfunction capitalize(str) {\n return str.replace(CAPITALIZE_REGEX, (match) => match.toUpperCase());\n}\n\nfunction loadUncountable(rules, uncountable) {\n for (let i = 0, length = uncountable.length; i < length; i++) {\n rules.uncountable[uncountable[i].toLowerCase()] = true;\n }\n}\n\nfunction loadIrregular(rules, irregularPairs) {\n let pair;\n\n for (let i = 0, length = irregularPairs.length; i < length; i++) {\n pair = irregularPairs[i];\n\n //pluralizing\n rules.irregular[pair[0].toLowerCase()] = pair[1];\n rules.irregular[pair[1].toLowerCase()] = pair[1];\n\n //singularizing\n rules.irregularInverse[pair[1].toLowerCase()] = pair[0];\n rules.irregularInverse[pair[0].toLowerCase()] = pair[0];\n }\n}\n\n/**\n Inflector.Ember provides a mechanism for supplying inflection rules for your\n application. Ember includes a default set of inflection rules, and provides an\n API for providing additional rules.\n\n Examples:\n\n Creating an inflector with no rules.\n\n ```js\n var inflector = new Ember.Inflector();\n ```\n\n Creating an inflector with the default ember ruleset.\n\n ```js\n var inflector = new Ember.Inflector(Ember.Inflector.defaultRules);\n\n inflector.pluralize('cow'); //=> 'kine'\n inflector.singularize('kine'); //=> 'cow'\n ```\n\n Creating an inflector and adding rules later.\n\n ```javascript\n var inflector = Ember.Inflector.inflector;\n\n inflector.pluralize('advice'); // => 'advices'\n inflector.uncountable('advice');\n inflector.pluralize('advice'); // => 'advice'\n\n inflector.pluralize('formula'); // => 'formulas'\n inflector.irregular('formula', 'formulae');\n inflector.pluralize('formula'); // => 'formulae'\n\n // you would not need to add these as they are the default rules\n inflector.plural(/$/, 's');\n inflector.singular(/s$/i, '');\n ```\n\n Creating an inflector with a nondefault ruleset.\n\n ```javascript\n var rules = {\n plurals: [\n [ /$/, 's' ]\n ],\n singular: [\n [ /\\s$/, '' ]\n ],\n irregularPairs: [\n [ 'cow', 'kine' ]\n ],\n uncountable: [ 'fish' ]\n };\n\n var inflector = new Ember.Inflector(rules);\n ```\n\n @class Inflector\n @namespace Ember\n*/\nfunction Inflector(ruleSet) {\n ruleSet = ruleSet || {};\n ruleSet.uncountable = ruleSet.uncountable || makeDictionary();\n ruleSet.irregularPairs = ruleSet.irregularPairs || makeDictionary();\n\n const rules = (this.rules = {\n plurals: ruleSet.plurals || [],\n singular: ruleSet.singular || [],\n irregular: makeDictionary(),\n irregularInverse: makeDictionary(),\n uncountable: makeDictionary(),\n });\n\n loadUncountable(rules, ruleSet.uncountable);\n loadIrregular(rules, ruleSet.irregularPairs);\n\n this.enableCache();\n}\n\nif (!Object.create && !Object.create(null).hasOwnProperty) {\n throw new Error(\n 'This browser does not support Object.create(null), please polyfil with es5-sham: http://git.io/yBU2rg'\n );\n}\n\nfunction makeDictionary() {\n var cache = Object.create(null);\n cache['_dict'] = null;\n delete cache['_dict'];\n return cache;\n}\n\nInflector.prototype = {\n /**\n @public\n\n As inflections can be costly, and commonly the same subset of words are repeatedly\n inflected an optional cache is provided.\n\n @method enableCache\n */\n enableCache() {\n this.purgeCache();\n\n this.singularize = function (word) {\n this._cacheUsed = true;\n return (\n this._sCache[word] || (this._sCache[word] = this._singularize(word))\n );\n };\n\n this.pluralize = function (numberOrWord, word, options = {}) {\n this._cacheUsed = true;\n var cacheKey = [numberOrWord, word, options.withoutCount];\n return (\n this._pCache[cacheKey] ||\n (this._pCache[cacheKey] = this._pluralize(numberOrWord, word, options))\n );\n };\n },\n\n /**\n @public\n\n @method purgeCache\n */\n purgeCache() {\n this._cacheUsed = false;\n this._sCache = makeDictionary();\n this._pCache = makeDictionary();\n },\n\n /**\n @public\n disable caching\n\n @method disableCache;\n */\n disableCache() {\n this._sCache = null;\n this._pCache = null;\n this.singularize = function (word) {\n return this._singularize(word);\n };\n\n this.pluralize = function () {\n return this._pluralize(...arguments);\n };\n },\n\n /**\n @method plural\n @param {RegExp} regex\n @param {String} string\n */\n plural(regex, string) {\n if (this._cacheUsed) {\n this.purgeCache();\n }\n this.rules.plurals.push([regex, string.toLowerCase()]);\n },\n\n /**\n @method singular\n @param {RegExp} regex\n @param {String} string\n */\n singular(regex, string) {\n if (this._cacheUsed) {\n this.purgeCache();\n }\n this.rules.singular.push([regex, string.toLowerCase()]);\n },\n\n /**\n @method uncountable\n @param {String} regex\n */\n uncountable(string) {\n if (this._cacheUsed) {\n this.purgeCache();\n }\n loadUncountable(this.rules, [string.toLowerCase()]);\n },\n\n /**\n @method irregular\n @param {String} singular\n @param {String} plural\n */\n irregular(singular, plural) {\n if (this._cacheUsed) {\n this.purgeCache();\n }\n loadIrregular(this.rules, [[singular, plural]]);\n },\n\n /**\n @method pluralize\n @param {String} word\n */\n pluralize() {\n return this._pluralize(...arguments);\n },\n\n _pluralize(wordOrCount, word, options = {}) {\n if (word === undefined) {\n return this.inflect(\n wordOrCount,\n this.rules.plurals,\n this.rules.irregular\n );\n }\n\n if (parseFloat(wordOrCount) !== 1) {\n word = this.inflect(word, this.rules.plurals, this.rules.irregular);\n }\n\n return options.withoutCount ? word : `${wordOrCount} ${word}`;\n },\n\n /**\n @method singularize\n @param {String} word\n */\n singularize(word) {\n return this._singularize(word);\n },\n\n _singularize(word) {\n return this.inflect(word, this.rules.singular, this.rules.irregularInverse);\n },\n\n /**\n @protected\n\n @method inflect\n @param {String} word\n @param {Object} typeRules\n @param {Object} irregular\n */\n inflect(word, typeRules, irregular) {\n let inflection,\n substitution,\n result,\n lowercase,\n wordSplit,\n lastWord,\n isBlank,\n isCamelized,\n rule,\n isUncountable;\n\n isBlank = !word || BLANK_REGEX.test(word);\n isCamelized = CAMELIZED_REGEX.test(word);\n\n if (isBlank) {\n return word;\n }\n\n lowercase = word.toLowerCase();\n wordSplit =\n LAST_WORD_DASHED_REGEX.exec(word) || LAST_WORD_CAMELIZED_REGEX.exec(word);\n\n if (wordSplit) {\n lastWord = wordSplit[2].toLowerCase();\n }\n\n isUncountable =\n this.rules.uncountable[lowercase] || this.rules.uncountable[lastWord];\n\n if (isUncountable) {\n return word;\n }\n\n for (rule in irregular) {\n if (lowercase.match(rule + '$')) {\n substitution = irregular[rule];\n\n if (isCamelized && irregular[lastWord]) {\n substitution = capitalize(substitution);\n rule = capitalize(rule);\n }\n\n return word.replace(new RegExp(rule, 'i'), substitution);\n }\n }\n\n for (var i = typeRules.length, min = 0; i > min; i--) {\n inflection = typeRules[i - 1];\n rule = inflection[0];\n\n if (rule.test(word)) {\n break;\n }\n }\n\n inflection = inflection || [];\n\n rule = inflection[0];\n substitution = inflection[1];\n\n result = word.replace(rule, substitution);\n\n return result;\n },\n};\n\nInflector.defaultRules = defaultRules;\nInflector.inflector = new Inflector(defaultRules);\n\nexport default Inflector;\n","import Inflector from './inflector';\n\nfunction pluralize() {\n return Inflector.inflector.pluralize(...arguments);\n}\n\nfunction singularize(word) {\n return Inflector.inflector.singularize(word);\n}\n\nexport { pluralize, singularize };\n","var _class, _descriptor;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport Helper from '@ember/component/helper';\nimport { inject as service } from '@ember/service';\nimport { isEmpty } from '@ember/utils';\nlet FormatDateHelper = (_class = class FormatDateHelper extends Helper {\n constructor() {\n // eslint-disable-next-line prefer-rest-params\n super(...arguments);\n\n // @ts-expect-error: Property 'onLocaleChanged' is private and only accessible within class 'IntlService'.\n _initializerDefineProperty(this, \"intl\", _descriptor, this);\n _defineProperty(this, \"allowEmpty\", true);\n this.intl.onLocaleChanged(this.recompute, this);\n }\n compute([value, positionalOptions], namedOptions) {\n const options = positionalOptions ? Object.assign({}, positionalOptions, namedOptions) : namedOptions;\n if (isEmpty(value)) {\n if (options?.allowEmpty ?? this.allowEmpty) {\n return '';\n }\n\n /*\n TODO: {{format-date}} is the only helper that always allows\n an undefined value. That is, it can never throw an error.\n For ember-intl@v7, unify the options of all helpers.\n */\n // if (typeof value === 'undefined') {\n // throw new Error('{{format-date}} helper requires a value.');\n // }\n }\n return this.intl.formatDate(value, options);\n }\n}, _descriptor = _applyDecoratedDescriptor(_class.prototype, \"intl\", [service], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _class);\nexport { FormatDateHelper as default };","var _class, _descriptor;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport Helper from '@ember/component/helper';\nimport { inject as service } from '@ember/service';\nimport { isEmpty } from '@ember/utils';\nlet THelper = (_class = class THelper extends Helper {\n constructor() {\n // eslint-disable-next-line prefer-rest-params\n super(...arguments);\n\n // @ts-expect-error: Property 'onLocaleChanged' is private and only accessible within class 'IntlService'.\n _initializerDefineProperty(this, \"intl\", _descriptor, this);\n _defineProperty(this, \"allowEmpty\", false);\n this.intl.onLocaleChanged(this.recompute, this);\n }\n compute([value, positionalOptions], namedOptions) {\n const options = positionalOptions ? Object.assign({}, positionalOptions, namedOptions) : namedOptions;\n if (isEmpty(value)) {\n if (options?.allowEmpty ?? this.allowEmpty) {\n return '';\n }\n if (typeof value === 'undefined') {\n throw new Error('{{t}} helper requires a value.');\n }\n }\n return this.intl.t(value, options);\n }\n}, _descriptor = _applyDecoratedDescriptor(_class.prototype, \"intl\", [service], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _class);\nexport { THelper as default };","import { warn } from '@ember/debug';\nimport { isEmpty } from '@ember/utils';\n\n/**\n * @private\n * @hide\n */\nexport default function missingMessage(key, locales) {\n if (isEmpty(locales)) {\n warn(`[ember-intl] no locale has been set! See: https://ember-intl.github.io/ember-intl/docs/quickstart#4-configure-ember-intl`, false, {\n id: 'ember-intl-no-locale-set'\n });\n return `No locale defined. Unable to resolve translation: \"${key}\"`;\n }\n const localeNames = locales.join(', ');\n warn(`[ember-intl] translation: \"${key}\" on locale: \"${localeNames}\" was not found.`, false, {\n id: 'ember-intl-missing-translation'\n });\n return `Missing translation \"${key}\" for locale \"${localeNames}\"`;\n}","export var ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `foo) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (ErrorKind = {}));\n","export var TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (TYPE = {}));\nexport var SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nexport function isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nexport function isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nexport function isNumberElement(el) {\n return el.type === TYPE.number;\n}\nexport function isDateElement(el) {\n return el.type === TYPE.date;\n}\nexport function isTimeElement(el) {\n return el.type === TYPE.time;\n}\nexport function isSelectElement(el) {\n return el.type === TYPE.select;\n}\nexport function isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nexport function isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nexport function isTagElement(el) {\n return el.type === TYPE.tag;\n}\nexport function isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nexport function isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nexport function createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nexport function createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","// @generated from regex-gen.ts\nexport var SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: milliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}\n","// @generated from regex-gen.ts\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","import { __assign } from \"tslib\";\nimport { WHITE_SPACE_REGEX } from './regex.generated';\nexport function parseNumberSkeletonFromString(skeleton) {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty');\n }\n // Parse the skeleton\n var stringTokens = skeleton\n .split(WHITE_SPACE_REGEX)\n .filter(function (x) { return x.length > 0; });\n var tokens = [];\n for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {\n var stringToken = stringTokens_1[_i];\n var stemAndOptions = stringToken.split('/');\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n var stem = stemAndOptions[0], options = stemAndOptions.slice(1);\n for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {\n var option = options_1[_a];\n if (option.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n }\n tokens.push({ stem: stem, options: options });\n }\n return tokens;\n}\nfunction icuUnitToEcma(unit) {\n return unit.replace(/^(.*?)-/, '');\n}\nvar FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g;\nvar SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g;\nvar INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g;\nvar CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;\nfunction parseSignificantPrecision(str) {\n var result = {};\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision';\n }\n else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision';\n }\n str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits = g1.length;\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length;\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length;\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0);\n }\n return '';\n });\n return result;\n}\nfunction parseSign(str) {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n };\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n };\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n };\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n };\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n };\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n };\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n };\n }\n}\nfunction parseConciseScientificAndEngineeringStem(stem) {\n // Engineering\n var result;\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n };\n stem = stem.slice(2);\n }\n else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n };\n stem = stem.slice(1);\n }\n if (result) {\n var signDisplay = stem.slice(0, 2);\n if (signDisplay === '+!') {\n result.signDisplay = 'always';\n stem = stem.slice(2);\n }\n else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero';\n stem = stem.slice(2);\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation');\n }\n result.minimumIntegerDigits = stem.length;\n }\n return result;\n}\nfunction parseNotationOptions(opt) {\n var result = {};\n var signOpts = parseSign(opt);\n if (signOpts) {\n return signOpts;\n }\n return result;\n}\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nexport function parseNumberSkeleton(tokens) {\n var result = {};\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent';\n continue;\n case '%x100':\n result.style = 'percent';\n result.scale = 100;\n continue;\n case 'currency':\n result.style = 'currency';\n result.currency = token.options[0];\n continue;\n case 'group-off':\n case ',_':\n result.useGrouping = false;\n continue;\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0;\n continue;\n case 'measure-unit':\n case 'unit':\n result.style = 'unit';\n result.unit = icuUnitToEcma(token.options[0]);\n continue;\n case 'compact-short':\n case 'K':\n result.notation = 'compact';\n result.compactDisplay = 'short';\n continue;\n case 'compact-long':\n case 'KK':\n result.notation = 'compact';\n result.compactDisplay = 'long';\n continue;\n case 'scientific':\n result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'engineering':\n result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'notation-simple':\n result.notation = 'standard';\n continue;\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol';\n result.unitDisplay = 'narrow';\n continue;\n case 'unit-width-short':\n result.currencyDisplay = 'code';\n result.unitDisplay = 'short';\n continue;\n case 'unit-width-full-name':\n result.currencyDisplay = 'name';\n result.unitDisplay = 'long';\n continue;\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol';\n continue;\n case 'scale':\n result.scale = parseFloat(token.options[0]);\n continue;\n case 'rounding-mode-floor':\n result.roundingMode = 'floor';\n continue;\n case 'rounding-mode-ceiling':\n result.roundingMode = 'ceil';\n continue;\n case 'rounding-mode-down':\n result.roundingMode = 'trunc';\n continue;\n case 'rounding-mode-up':\n result.roundingMode = 'expand';\n continue;\n case 'rounding-mode-half-even':\n result.roundingMode = 'halfEven';\n continue;\n case 'rounding-mode-half-down':\n result.roundingMode = 'halfTrunc';\n continue;\n case 'rounding-mode-half-up':\n result.roundingMode = 'halfExpand';\n continue;\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError('integer-width stems only accept a single optional option');\n }\n token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {\n if (g1) {\n result.minimumIntegerDigits = g2.length;\n }\n else if (g3 && g4) {\n throw new Error('We currently do not support maximum integer digits');\n }\n else if (g5) {\n throw new Error('We currently do not support exact integer digits');\n }\n return '';\n });\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length;\n continue;\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError('Fraction-precision stems only accept a single optional option');\n }\n token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length;\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length;\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length;\n result.maximumFractionDigits = g4.length + g5.length;\n }\n else {\n result.minimumFractionDigits = g1.length;\n result.maximumFractionDigits = g1.length;\n }\n return '';\n });\n var opt = token.options[0];\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });\n }\n else if (opt) {\n result = __assign(__assign({}, result), parseSignificantPrecision(opt));\n }\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));\n continue;\n }\n var signOpts = parseSign(token.stem);\n if (signOpts) {\n result = __assign(__assign({}, result), signOpts);\n }\n var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);\n if (conciseScientificAndEngineeringOpts) {\n result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);\n }\n }\n return result;\n}\n","// @generated from time-data-gen.ts\n// prettier-ignore \nexport var timeData = {\n \"001\": [\n \"H\",\n \"h\"\n ],\n \"AC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AD\": [\n \"H\",\n \"hB\"\n ],\n \"AE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"AF\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"AG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AL\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"AM\": [\n \"H\",\n \"hB\"\n ],\n \"AO\": [\n \"H\",\n \"hB\"\n ],\n \"AR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"AS\": [\n \"h\",\n \"H\"\n ],\n \"AT\": [\n \"H\",\n \"hB\"\n ],\n \"AU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AW\": [\n \"H\",\n \"hB\"\n ],\n \"AX\": [\n \"H\"\n ],\n \"AZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BD\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"BE\": [\n \"H\",\n \"hB\"\n ],\n \"BF\": [\n \"H\",\n \"hB\"\n ],\n \"BG\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"BI\": [\n \"H\",\n \"h\"\n ],\n \"BJ\": [\n \"H\",\n \"hB\"\n ],\n \"BL\": [\n \"H\",\n \"hB\"\n ],\n \"BM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BN\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"BO\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"BQ\": [\n \"H\"\n ],\n \"BR\": [\n \"H\",\n \"hB\"\n ],\n \"BS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BT\": [\n \"h\",\n \"H\"\n ],\n \"BW\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BY\": [\n \"H\",\n \"h\"\n ],\n \"BZ\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CA\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"CC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CD\": [\n \"hB\",\n \"H\"\n ],\n \"CF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CG\": [\n \"H\",\n \"hB\"\n ],\n \"CH\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"CI\": [\n \"H\",\n \"hB\"\n ],\n \"CK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CL\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CN\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"CO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CP\": [\n \"H\"\n ],\n \"CR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CU\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CV\": [\n \"H\",\n \"hB\"\n ],\n \"CW\": [\n \"H\",\n \"hB\"\n ],\n \"CX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CY\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"CZ\": [\n \"H\"\n ],\n \"DE\": [\n \"H\",\n \"hB\"\n ],\n \"DG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"DJ\": [\n \"h\",\n \"H\"\n ],\n \"DK\": [\n \"H\"\n ],\n \"DM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"DO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"DZ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"EC\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"EE\": [\n \"H\",\n \"hB\"\n ],\n \"EG\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ER\": [\n \"h\",\n \"H\"\n ],\n \"ES\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"ET\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"FI\": [\n \"H\"\n ],\n \"FJ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"FM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FO\": [\n \"H\",\n \"h\"\n ],\n \"FR\": [\n \"H\",\n \"hB\"\n ],\n \"GA\": [\n \"H\",\n \"hB\"\n ],\n \"GB\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GD\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GE\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"GF\": [\n \"H\",\n \"hB\"\n ],\n \"GG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GH\": [\n \"h\",\n \"H\"\n ],\n \"GI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GL\": [\n \"H\",\n \"h\"\n ],\n \"GM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GN\": [\n \"H\",\n \"hB\"\n ],\n \"GP\": [\n \"H\",\n \"hB\"\n ],\n \"GQ\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"GR\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"GT\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"GU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GW\": [\n \"H\",\n \"hB\"\n ],\n \"GY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"HK\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"HN\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"HR\": [\n \"H\",\n \"hB\"\n ],\n \"HU\": [\n \"H\",\n \"h\"\n ],\n \"IC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ID\": [\n \"H\"\n ],\n \"IE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IL\": [\n \"H\",\n \"hB\"\n ],\n \"IM\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IN\": [\n \"h\",\n \"H\"\n ],\n \"IO\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IQ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"IR\": [\n \"hB\",\n \"H\"\n ],\n \"IS\": [\n \"H\"\n ],\n \"IT\": [\n \"H\",\n \"hB\"\n ],\n \"JE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"JM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"JO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"JP\": [\n \"H\",\n \"K\",\n \"h\"\n ],\n \"KE\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"KG\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KH\": [\n \"hB\",\n \"h\",\n \"H\",\n \"hb\"\n ],\n \"KI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KM\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KN\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KP\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KW\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"KY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KZ\": [\n \"H\",\n \"hB\"\n ],\n \"LA\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"LB\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LI\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"LK\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"LR\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LS\": [\n \"h\",\n \"H\"\n ],\n \"LT\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"LU\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"LV\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"LY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MC\": [\n \"H\",\n \"hB\"\n ],\n \"MD\": [\n \"H\",\n \"hB\"\n ],\n \"ME\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"MF\": [\n \"H\",\n \"hB\"\n ],\n \"MG\": [\n \"H\",\n \"h\"\n ],\n \"MH\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ML\": [\n \"H\"\n ],\n \"MM\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"MN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MP\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MQ\": [\n \"H\",\n \"hB\"\n ],\n \"MR\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MS\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MT\": [\n \"H\",\n \"h\"\n ],\n \"MU\": [\n \"H\",\n \"h\"\n ],\n \"MV\": [\n \"H\",\n \"h\"\n ],\n \"MW\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MX\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MY\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"MZ\": [\n \"H\",\n \"hB\"\n ],\n \"NA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NC\": [\n \"H\",\n \"hB\"\n ],\n \"NE\": [\n \"H\"\n ],\n \"NF\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NI\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"NL\": [\n \"H\",\n \"hB\"\n ],\n \"NO\": [\n \"H\",\n \"h\"\n ],\n \"NP\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"NR\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NU\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"OM\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PE\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"PF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"PG\": [\n \"h\",\n \"H\"\n ],\n \"PH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PK\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"PL\": [\n \"H\",\n \"h\"\n ],\n \"PM\": [\n \"H\",\n \"hB\"\n ],\n \"PN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"PR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PS\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PT\": [\n \"H\",\n \"hB\"\n ],\n \"PW\": [\n \"h\",\n \"H\"\n ],\n \"PY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"QA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"RE\": [\n \"H\",\n \"hB\"\n ],\n \"RO\": [\n \"H\",\n \"hB\"\n ],\n \"RS\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"RU\": [\n \"H\"\n ],\n \"RW\": [\n \"H\",\n \"h\"\n ],\n \"SA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SC\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SD\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SE\": [\n \"H\"\n ],\n \"SG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SH\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SI\": [\n \"H\",\n \"hB\"\n ],\n \"SJ\": [\n \"H\"\n ],\n \"SK\": [\n \"H\"\n ],\n \"SL\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SN\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SO\": [\n \"h\",\n \"H\"\n ],\n \"SR\": [\n \"H\",\n \"hB\"\n ],\n \"SS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ST\": [\n \"H\",\n \"hB\"\n ],\n \"SV\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"SX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"TC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TD\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"TF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"TG\": [\n \"H\",\n \"hB\"\n ],\n \"TH\": [\n \"H\",\n \"h\"\n ],\n \"TJ\": [\n \"H\",\n \"h\"\n ],\n \"TL\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"TM\": [\n \"H\",\n \"h\"\n ],\n \"TN\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"TO\": [\n \"h\",\n \"H\"\n ],\n \"TR\": [\n \"H\",\n \"hB\"\n ],\n \"TT\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TW\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"TZ\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UG\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"US\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"UY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"UZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"VA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"VC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"VG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VN\": [\n \"H\",\n \"h\"\n ],\n \"VU\": [\n \"h\",\n \"H\"\n ],\n \"WF\": [\n \"H\",\n \"hB\"\n ],\n \"WS\": [\n \"h\",\n \"H\"\n ],\n \"XK\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"YE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"YT\": [\n \"H\",\n \"hB\"\n ],\n \"ZA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ZM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ZW\": [\n \"H\",\n \"h\"\n ],\n \"af-ZA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ar-001\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ca-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"en-001\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"es-BO\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-BR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-EC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-ES\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-GQ\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-PE\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"fr-CA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gl-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gu-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"hi-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"it-CH\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-IT\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"kn-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ml-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"mr-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"pa-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"ta-IN\": [\n \"hB\",\n \"h\",\n \"hb\",\n \"H\"\n ],\n \"te-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"zu-ZA\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ]\n};\n","var _a;\nimport { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { SKELETON_TYPE, TYPE, } from './types';\nimport { SPACE_SEPARATOR_REGEX } from './regex.generated';\nimport { parseNumberSkeleton, parseNumberSkeletonFromString, parseDateTimeSkeleton, } from '@formatjs/icu-skeleton-parser';\nimport { getBestPattern } from './date-time-pattern-generator';\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith && '_a'.startsWith('a', 1);\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('')) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = getBestPattern(skeleton, this.locale);\n }\n var style = {\n type: SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? parseDateTimeSkeleton(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? TYPE.date : TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? TYPE.number\n : argType === 'date'\n ? TYPE.date\n : TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = parseNumberSkeletonFromString(skeleton);\n }\n catch (e) {\n return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? parseNumberSkeleton(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexport { Parser };\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","import { timeData } from './time-data.generated';\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nexport function getBestPattern(skeleton, locale) {\n var skeletonCopy = '';\n for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {\n var patternChar = skeleton.charAt(patternPos);\n if (patternChar === 'j') {\n var extraLength = 0;\n while (patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar) {\n extraLength++;\n patternPos++;\n }\n var hourLen = 1 + (extraLength & 1);\n var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);\n var dayPeriodChar = 'a';\n var hourChar = getDefaultHourSymbolFromLocale(locale);\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0;\n }\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar;\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy;\n }\n }\n else if (patternChar === 'J') {\n skeletonCopy += 'H';\n }\n else {\n skeletonCopy += patternChar;\n }\n }\n return skeletonCopy;\n}\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-ignore hourCycle(s) is not identified yet\n locale.hourCycles &&\n // @ts-ignore\n locale.hourCycles.length) {\n // @ts-ignore\n hourCycle = locale.hourCycles[0];\n }\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k';\n case 'h23':\n return 'H';\n case 'h12':\n return 'h';\n case 'h11':\n return 'K';\n default:\n throw new Error('Invalid hourCycle');\n }\n }\n // TODO: Once hourCycle is fully supported remove the following with data generation\n var languageTag = locale.language;\n var regionTag;\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region;\n }\n var hourCycles = timeData[regionTag || ''] ||\n timeData[languageTag || ''] ||\n timeData[\"\".concat(languageTag, \"-001\")] ||\n timeData['001'];\n return hourCycles[0];\n}\n","import { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { Parser } from './parser';\nimport { isDateElement, isDateTimeSkeleton, isNumberElement, isNumberSkeleton, isPluralElement, isSelectElement, isTagElement, isTimeElement, } from './types';\nfunction pruneLocation(els) {\n els.forEach(function (el) {\n delete el.location;\n if (isSelectElement(el) || isPluralElement(el)) {\n for (var k in el.options) {\n delete el.options[k].location;\n pruneLocation(el.options[k].value);\n }\n }\n else if (isNumberElement(el) && isNumberSkeleton(el.style)) {\n delete el.style.location;\n }\n else if ((isDateElement(el) || isTimeElement(el)) &&\n isDateTimeSkeleton(el.style)) {\n delete el.style.location;\n }\n else if (isTagElement(el)) {\n pruneLocation(el.children);\n }\n });\n}\nexport function parse(message, opts) {\n if (opts === void 0) { opts = {}; }\n opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);\n var result = new Parser(message, opts).parse();\n if (result.err) {\n var error = SyntaxError(ErrorKind[result.err.kind]);\n // @ts-expect-error Assign to error object\n error.location = result.err.location;\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message;\n throw error;\n }\n if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {\n pruneLocation(result.val);\n }\n return result.val;\n}\nexport * from './types';\n// only for testing\nexport var _Parser = Parser;\n","//\n// Main\n//\nexport function memoize(fn, options) {\n var cache = options && options.cache ? options.cache : cacheDefault;\n var serializer = options && options.serializer ? options.serializer : serializerDefault;\n var strategy = options && options.strategy ? options.strategy : strategyDefault;\n return strategy(fn, {\n cache: cache,\n serializer: serializer,\n });\n}\n//\n// Strategy\n//\nfunction isPrimitive(value) {\n return (value == null || typeof value === 'number' || typeof value === 'boolean'); // || typeof value === \"string\" 'unsafe' primitive for our needs\n}\nfunction monadic(fn, cache, serializer, arg) {\n var cacheKey = isPrimitive(arg) ? arg : serializer(arg);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.call(this, arg);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction variadic(fn, cache, serializer) {\n var args = Array.prototype.slice.call(arguments, 3);\n var cacheKey = serializer(args);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.apply(this, args);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction assemble(fn, context, strategy, cache, serialize) {\n return strategy.bind(context, fn, cache, serialize);\n}\nfunction strategyDefault(fn, options) {\n var strategy = fn.length === 1 ? monadic : variadic;\n return assemble(fn, this, strategy, options.cache.create(), options.serializer);\n}\nfunction strategyVariadic(fn, options) {\n return assemble(fn, this, variadic, options.cache.create(), options.serializer);\n}\nfunction strategyMonadic(fn, options) {\n return assemble(fn, this, monadic, options.cache.create(), options.serializer);\n}\n//\n// Serializer\n//\nvar serializerDefault = function () {\n return JSON.stringify(arguments);\n};\n//\n// Cache\n//\nfunction ObjectWithoutPrototypeCache() {\n this.cache = Object.create(null);\n}\nObjectWithoutPrototypeCache.prototype.get = function (key) {\n return this.cache[key];\n};\nObjectWithoutPrototypeCache.prototype.set = function (key, value) {\n this.cache[key] = value;\n};\nvar cacheDefault = {\n create: function create() {\n // @ts-ignore\n return new ObjectWithoutPrototypeCache();\n },\n};\nexport var strategies = {\n variadic: strategyVariadic,\n monadic: strategyMonadic,\n};\n","import { __extends } from \"tslib\";\nexport var ErrorCode;\n(function (ErrorCode) {\n // When we have a placeholder but no value to format\n ErrorCode[\"MISSING_VALUE\"] = \"MISSING_VALUE\";\n // When value supplied is invalid\n ErrorCode[\"INVALID_VALUE\"] = \"INVALID_VALUE\";\n // When we need specific Intl API but it's not available\n ErrorCode[\"MISSING_INTL_API\"] = \"MISSING_INTL_API\";\n})(ErrorCode || (ErrorCode = {}));\nvar FormatError = /** @class */ (function (_super) {\n __extends(FormatError, _super);\n function FormatError(msg, code, originalMessage) {\n var _this = _super.call(this, msg) || this;\n _this.code = code;\n _this.originalMessage = originalMessage;\n return _this;\n }\n FormatError.prototype.toString = function () {\n return \"[formatjs Error: \".concat(this.code, \"] \").concat(this.message);\n };\n return FormatError;\n}(Error));\nexport { FormatError };\nvar InvalidValueError = /** @class */ (function (_super) {\n __extends(InvalidValueError, _super);\n function InvalidValueError(variableId, value, options, originalMessage) {\n return _super.call(this, \"Invalid values for \\\"\".concat(variableId, \"\\\": \\\"\").concat(value, \"\\\". Options are \\\"\").concat(Object.keys(options).join('\", \"'), \"\\\"\"), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueError;\n}(FormatError));\nexport { InvalidValueError };\nvar InvalidValueTypeError = /** @class */ (function (_super) {\n __extends(InvalidValueTypeError, _super);\n function InvalidValueTypeError(value, type, originalMessage) {\n return _super.call(this, \"Value for \\\"\".concat(value, \"\\\" must be of type \").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueTypeError;\n}(FormatError));\nexport { InvalidValueTypeError };\nvar MissingValueError = /** @class */ (function (_super) {\n __extends(MissingValueError, _super);\n function MissingValueError(variableId, originalMessage) {\n return _super.call(this, \"The intl string context variable \\\"\".concat(variableId, \"\\\" was not provided to the string \\\"\").concat(originalMessage, \"\\\"\"), ErrorCode.MISSING_VALUE, originalMessage) || this;\n }\n return MissingValueError;\n}(FormatError));\nexport { MissingValueError };\n","import { isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isTimeElement, isTagElement, } from '@formatjs/icu-messageformat-parser';\nimport { MissingValueError, InvalidValueError, ErrorCode, FormatError, InvalidValueTypeError, } from './error';\nexport var PART_TYPE;\n(function (PART_TYPE) {\n PART_TYPE[PART_TYPE[\"literal\"] = 0] = \"literal\";\n PART_TYPE[PART_TYPE[\"object\"] = 1] = \"object\";\n})(PART_TYPE || (PART_TYPE = {}));\nfunction mergeLiteral(parts) {\n if (parts.length < 2) {\n return parts;\n }\n return parts.reduce(function (all, part) {\n var lastPart = all[all.length - 1];\n if (!lastPart ||\n lastPart.type !== PART_TYPE.literal ||\n part.type !== PART_TYPE.literal) {\n all.push(part);\n }\n else {\n lastPart.value += part.value;\n }\n return all;\n }, []);\n}\nexport function isFormatXMLElementFn(el) {\n return typeof el === 'function';\n}\n// TODO(skeleton): add skeleton support\nexport function formatToParts(els, locales, formatters, formats, values, currentPluralValue, \n// For debugging\noriginalMessage) {\n // Hot path for straight simple msg translations\n if (els.length === 1 && isLiteralElement(els[0])) {\n return [\n {\n type: PART_TYPE.literal,\n value: els[0].value,\n },\n ];\n }\n var result = [];\n for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {\n var el = els_1[_i];\n // Exit early for string parts.\n if (isLiteralElement(el)) {\n result.push({\n type: PART_TYPE.literal,\n value: el.value,\n });\n continue;\n }\n // TODO: should this part be literal type?\n // Replace `#` in plural rules with the actual numeric value.\n if (isPoundElement(el)) {\n if (typeof currentPluralValue === 'number') {\n result.push({\n type: PART_TYPE.literal,\n value: formatters.getNumberFormat(locales).format(currentPluralValue),\n });\n }\n continue;\n }\n var varName = el.value;\n // Enforce that all required values are provided by the caller.\n if (!(values && varName in values)) {\n throw new MissingValueError(varName, originalMessage);\n }\n var value = values[varName];\n if (isArgumentElement(el)) {\n if (!value || typeof value === 'string' || typeof value === 'number') {\n value =\n typeof value === 'string' || typeof value === 'number'\n ? String(value)\n : '';\n }\n result.push({\n type: typeof value === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: value,\n });\n continue;\n }\n // Recursively format plural and select parts' option — which can be a\n // nested pattern structure. The choosing of the option to use is\n // abstracted-by and delegated-to the part helper object.\n if (isDateElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.date[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTimeElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.time[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : formats.time.medium;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isNumberElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.number[el.style]\n : isNumberSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n if (style && style.scale) {\n value =\n value *\n (style.scale || 1);\n }\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getNumberFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTagElement(el)) {\n var children = el.children, value_1 = el.value;\n var formatFn = values[value_1];\n if (!isFormatXMLElementFn(formatFn)) {\n throw new InvalidValueTypeError(value_1, 'function', originalMessage);\n }\n var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);\n var chunks = formatFn(parts.map(function (p) { return p.value; }));\n if (!Array.isArray(chunks)) {\n chunks = [chunks];\n }\n result.push.apply(result, chunks.map(function (c) {\n return {\n type: typeof c === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: c,\n };\n }));\n }\n if (isSelectElement(el)) {\n var opt = el.options[value] || el.options.other;\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));\n continue;\n }\n if (isPluralElement(el)) {\n var opt = el.options[\"=\".concat(value)];\n if (!opt) {\n if (!Intl.PluralRules) {\n throw new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API, originalMessage);\n }\n var rule = formatters\n .getPluralRules(locales, { type: el.pluralType })\n .select(value - (el.offset || 0));\n opt = el.options[rule] || el.options.other;\n }\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));\n continue;\n }\n }\n return mergeLiteral(result);\n}\n","/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\nimport { __assign, __rest, __spreadArray } from \"tslib\";\nimport { parse, } from '@formatjs/icu-messageformat-parser';\nimport { memoize, strategies } from '@formatjs/fast-memoize';\nimport { formatToParts, PART_TYPE, } from './formatters';\n// -- MessageFormat --------------------------------------------------------\nfunction mergeConfig(c1, c2) {\n if (!c2) {\n return c1;\n }\n return __assign(__assign(__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {\n all[k] = __assign(__assign({}, c1[k]), (c2[k] || {}));\n return all;\n }, {}));\n}\nfunction mergeConfigs(defaultConfig, configs) {\n if (!configs) {\n return defaultConfig;\n }\n return Object.keys(defaultConfig).reduce(function (all, k) {\n all[k] = mergeConfig(defaultConfig[k], configs[k]);\n return all;\n }, __assign({}, defaultConfig));\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\nfunction createDefaultFormatters(cache) {\n if (cache === void 0) { cache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n }; }\n return {\n getNumberFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n }),\n getDateTimeFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n }),\n };\n}\nvar IntlMessageFormat = /** @class */ (function () {\n function IntlMessageFormat(message, locales, overrideFormats, opts) {\n var _this = this;\n if (locales === void 0) { locales = IntlMessageFormat.defaultLocale; }\n this.formatterCache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n };\n this.format = function (values) {\n var parts = _this.formatToParts(values);\n // Hot path for straight simple msg translations\n if (parts.length === 1) {\n return parts[0].value;\n }\n var result = parts.reduce(function (all, part) {\n if (!all.length ||\n part.type !== PART_TYPE.literal ||\n typeof all[all.length - 1] !== 'string') {\n all.push(part.value);\n }\n else {\n all[all.length - 1] += part.value;\n }\n return all;\n }, []);\n if (result.length <= 1) {\n return result[0] || '';\n }\n return result;\n };\n this.formatToParts = function (values) {\n return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message);\n };\n this.resolvedOptions = function () {\n var _a;\n return ({\n locale: ((_a = _this.resolvedLocale) === null || _a === void 0 ? void 0 : _a.toString()) ||\n Intl.NumberFormat.supportedLocalesOf(_this.locales)[0],\n });\n };\n this.getAst = function () { return _this.ast; };\n // Defined first because it's used to build the format pattern.\n this.locales = locales;\n this.resolvedLocale = IntlMessageFormat.resolveLocale(locales);\n if (typeof message === 'string') {\n this.message = message;\n if (!IntlMessageFormat.__parse) {\n throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');\n }\n var _a = opts || {}, formatters = _a.formatters, parseOpts = __rest(_a, [\"formatters\"]);\n // Parse string messages into an AST.\n this.ast = IntlMessageFormat.__parse(message, __assign(__assign({}, parseOpts), { locale: this.resolvedLocale }));\n }\n else {\n this.ast = message;\n }\n if (!Array.isArray(this.ast)) {\n throw new TypeError('A message must be provided as a String or AST.');\n }\n // Creates a new object with the specified `formats` merged with the default\n // formats.\n this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);\n this.formatters =\n (opts && opts.formatters) || createDefaultFormatters(this.formatterCache);\n }\n Object.defineProperty(IntlMessageFormat, \"defaultLocale\", {\n get: function () {\n if (!IntlMessageFormat.memoizedDefaultLocale) {\n IntlMessageFormat.memoizedDefaultLocale =\n new Intl.NumberFormat().resolvedOptions().locale;\n }\n return IntlMessageFormat.memoizedDefaultLocale;\n },\n enumerable: false,\n configurable: true\n });\n IntlMessageFormat.memoizedDefaultLocale = null;\n IntlMessageFormat.resolveLocale = function (locales) {\n if (typeof Intl.Locale === 'undefined') {\n return;\n }\n var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);\n if (supportedLocales.length > 0) {\n return new Intl.Locale(supportedLocales[0]);\n }\n return new Intl.Locale(typeof locales === 'string' ? locales : locales[0]);\n };\n IntlMessageFormat.__parse = parse;\n // Default format options used as the prototype of the `formats` provided to the\n // constructor. These are used when constructing the internal Intl.NumberFormat\n // and Intl.DateTimeFormat instances.\n IntlMessageFormat.formats = {\n number: {\n integer: {\n maximumFractionDigits: 0,\n },\n currency: {\n style: 'currency',\n },\n percent: {\n style: 'percent',\n },\n },\n date: {\n short: {\n month: 'numeric',\n day: 'numeric',\n year: '2-digit',\n },\n medium: {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n },\n long: {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n full: {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n },\n time: {\n short: {\n hour: 'numeric',\n minute: 'numeric',\n },\n medium: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n long: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n full: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n },\n };\n return IntlMessageFormat;\n}());\nexport { IntlMessageFormat };\n","import { __assign, __spreadArray } from \"tslib\";\nimport { IntlMessageFormat } from 'intl-messageformat';\nimport { memoize, strategies } from '@formatjs/fast-memoize';\nimport { UnsupportedFormatterError } from './error';\nexport function filterProps(props, allowlist, defaults) {\n if (defaults === void 0) { defaults = {}; }\n return allowlist.reduce(function (filtered, name) {\n if (name in props) {\n filtered[name] = props[name];\n }\n else if (name in defaults) {\n filtered[name] = defaults[name];\n }\n return filtered;\n }, {});\n}\nvar defaultErrorHandler = function (error) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.error(error);\n }\n};\nvar defaultWarnHandler = function (warning) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n};\nexport var DEFAULT_INTL_CONFIG = {\n formats: {},\n messages: {},\n timeZone: undefined,\n defaultLocale: 'en',\n defaultFormats: {},\n fallbackOnEmptyString: true,\n onError: defaultErrorHandler,\n onWarn: defaultWarnHandler,\n};\nexport function createIntlCache() {\n return {\n dateTime: {},\n number: {},\n message: {},\n relativeTime: {},\n pluralRules: {},\n list: {},\n displayNames: {},\n };\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\n/**\n * Create intl formatters and populate cache\n * @param cache explicit cache to prevent leaking memory\n */\nexport function createFormatters(cache) {\n if (cache === void 0) { cache = createIntlCache(); }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n var ListFormat = Intl.ListFormat;\n var DisplayNames = Intl.DisplayNames;\n var getDateTimeFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n });\n var getNumberFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n });\n var getPluralRules = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n });\n return {\n getDateTimeFormat: getDateTimeFormat,\n getNumberFormat: getNumberFormat,\n getMessageFormat: memoize(function (message, locales, overrideFormats, opts) {\n return new IntlMessageFormat(message, locales, overrideFormats, __assign({ formatters: {\n getNumberFormat: getNumberFormat,\n getDateTimeFormat: getDateTimeFormat,\n getPluralRules: getPluralRules,\n } }, (opts || {})));\n }, {\n cache: createFastMemoizeCache(cache.message),\n strategy: strategies.variadic,\n }),\n getRelativeTimeFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.relativeTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: getPluralRules,\n getListFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.list),\n strategy: strategies.variadic,\n }),\n getDisplayNames: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.displayNames),\n strategy: strategies.variadic,\n }),\n };\n}\nexport function getNamedFormat(formats, type, name, onError) {\n var formatType = formats && formats[type];\n var format;\n if (formatType) {\n format = formatType[name];\n }\n if (format) {\n return format;\n }\n onError(new UnsupportedFormatterError(\"No \".concat(type, \" format named: \").concat(name)));\n}\n","import { IntlFormatError } from './error';\nimport { filterProps, getNamedFormat } from './utils';\nvar NUMBER_FORMAT_OPTIONS = [\n 'style',\n 'currency',\n 'unit',\n 'unitDisplay',\n 'useGrouping',\n 'minimumIntegerDigits',\n 'minimumFractionDigits',\n 'maximumFractionDigits',\n 'minimumSignificantDigits',\n 'maximumSignificantDigits',\n // ES2020 NumberFormat\n 'compactDisplay',\n 'currencyDisplay',\n 'currencySign',\n 'notation',\n 'signDisplay',\n 'unit',\n 'unitDisplay',\n 'numberingSystem',\n // ES2023 NumberFormat\n 'trailingZeroDisplay',\n 'roundingPriority',\n 'roundingIncrement',\n 'roundingMode',\n];\nexport function getFormatter(_a, getNumberFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = ((format &&\n getNamedFormat(formats, 'number', format, onError)) ||\n {});\n var filteredOptions = filterProps(options, NUMBER_FORMAT_OPTIONS, defaults);\n return getNumberFormat(locale, filteredOptions);\n}\nexport function formatNumber(config, getNumberFormat, value, options) {\n if (options === void 0) { options = {}; }\n try {\n return getFormatter(config, getNumberFormat, options).format(value);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting number.', config.locale, e));\n }\n return String(value);\n}\nexport function formatNumberToParts(config, getNumberFormat, value, options) {\n if (options === void 0) { options = {}; }\n try {\n return getFormatter(config, getNumberFormat, options).formatToParts(value);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting number.', config.locale, e));\n }\n return [];\n}\n","import { getNamedFormat, filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlFormatError } from './error';\nvar RELATIVE_TIME_FORMAT_OPTIONS = ['numeric', 'style'];\nfunction getFormatter(_a, getRelativeTimeFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = (!!format && getNamedFormat(formats, 'relative', format, onError)) || {};\n var filteredOptions = filterProps(options, RELATIVE_TIME_FORMAT_OPTIONS, defaults);\n return getRelativeTimeFormat(locale, filteredOptions);\n}\nexport function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options) {\n if (options === void 0) { options = {}; }\n if (!unit) {\n unit = 'second';\n }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n if (!RelativeTimeFormat) {\n config.onError(new FormatError(\"Intl.RelativeTimeFormat is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-relativetimeformat\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n try {\n return getFormatter(config, getRelativeTimeFormat, options).format(value, unit);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting relative time.', config.locale, e));\n }\n return String(value);\n}\n","import { __assign } from \"tslib\";\nimport { filterProps, getNamedFormat } from './utils';\nimport { IntlFormatError } from './error';\nvar DATE_TIME_FORMAT_OPTIONS = [\n 'formatMatcher',\n 'timeZone',\n 'hour12',\n 'weekday',\n 'era',\n 'year',\n 'month',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'timeZoneName',\n 'hourCycle',\n 'dateStyle',\n 'timeStyle',\n 'calendar',\n // 'dayPeriod',\n 'numberingSystem',\n 'fractionalSecondDigits',\n];\nexport function getFormatter(_a, type, getDateTimeFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError, timeZone = _a.timeZone;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = __assign(__assign({}, (timeZone && { timeZone: timeZone })), (format && getNamedFormat(formats, type, format, onError)));\n var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);\n if (type === 'time' &&\n !filteredOptions.hour &&\n !filteredOptions.minute &&\n !filteredOptions.second &&\n !filteredOptions.timeStyle &&\n !filteredOptions.dateStyle) {\n // Add default formatting options if hour, minute, or second isn't defined.\n filteredOptions = __assign(__assign({}, filteredOptions), { hour: 'numeric', minute: 'numeric' });\n }\n return getDateTimeFormat(locale, filteredOptions);\n}\nexport function formatDate(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'date', getDateTimeFormat, options).format(date);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting date.', config.locale, e));\n }\n return String(date);\n}\nexport function formatTime(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'time', getDateTimeFormat, options).format(date);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting time.', config.locale, e));\n }\n return String(date);\n}\nexport function formatDateTimeRange(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var from = _a[0], to = _a[1], _b = _a[2], options = _b === void 0 ? {} : _b;\n var timeZone = config.timeZone, locale = config.locale, onError = config.onError;\n var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, timeZone ? { timeZone: timeZone } : {});\n try {\n return getDateTimeFormat(locale, filteredOptions).formatRange(from, to);\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting date time range.', config.locale, e));\n }\n return String(from);\n}\nexport function formatDateToParts(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'date', getDateTimeFormat, options).formatToParts(date); // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting date.', config.locale, e));\n }\n return [];\n}\nexport function formatTimeToParts(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'time', getDateTimeFormat, options).formatToParts(date); // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting time.', config.locale, e));\n }\n return [];\n}\n","import { filterProps } from './utils';\nimport { IntlFormatError } from './error';\nimport { ErrorCode, FormatError } from 'intl-messageformat';\nvar PLURAL_FORMAT_OPTIONS = ['type'];\nexport function formatPlural(_a, getPluralRules, value, options) {\n var locale = _a.locale, onError = _a.onError;\n if (options === void 0) { options = {}; }\n if (!Intl.PluralRules) {\n onError(new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, PLURAL_FORMAT_OPTIONS);\n try {\n return getPluralRules(locale, filteredOptions).select(value);\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting plural.', locale, e));\n }\n return 'other';\n}\n","import { __assign } from \"tslib\";\nimport { invariant } from '@formatjs/ecma402-abstract';\nimport { IntlMessageFormat, } from 'intl-messageformat';\nimport { MissingTranslationError, MessageFormatError } from './error';\nimport { TYPE } from '@formatjs/icu-messageformat-parser';\nfunction setTimeZoneInOptions(opts, timeZone) {\n return Object.keys(opts).reduce(function (all, k) {\n all[k] = __assign({ timeZone: timeZone }, opts[k]);\n return all;\n }, {});\n}\nfunction deepMergeOptions(opts1, opts2) {\n var keys = Object.keys(__assign(__assign({}, opts1), opts2));\n return keys.reduce(function (all, k) {\n all[k] = __assign(__assign({}, (opts1[k] || {})), (opts2[k] || {}));\n return all;\n }, {});\n}\nfunction deepMergeFormatsAndSetTimeZone(f1, timeZone) {\n if (!timeZone) {\n return f1;\n }\n var mfFormats = IntlMessageFormat.formats;\n return __assign(__assign(__assign({}, mfFormats), f1), { date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)), time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone)) });\n}\nexport var formatMessage = function (_a, state, messageDescriptor, values, opts) {\n var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats, fallbackOnEmptyString = _a.fallbackOnEmptyString, onError = _a.onError, timeZone = _a.timeZone, defaultRichTextElements = _a.defaultRichTextElements;\n if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }\n var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;\n // `id` is a required field of a Message Descriptor.\n invariant(!!msgId, \"[@formatjs/intl] An `id` must be provided to format a message. You can either:\\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\\nto autofix this issue\");\n var id = String(msgId);\n var message = \n // In case messages is Object.create(null)\n // e.g import('foo.json') from webpack)\n // See https://github.com/formatjs/formatjs/issues/1914\n messages &&\n Object.prototype.hasOwnProperty.call(messages, id) &&\n messages[id];\n // IMPORTANT: Hot path if `message` is AST with a single literal node\n if (Array.isArray(message) &&\n message.length === 1 &&\n message[0].type === TYPE.literal) {\n return message[0].value;\n }\n // IMPORTANT: Hot path straight lookup for performance\n if (!values &&\n message &&\n typeof message === 'string' &&\n !defaultRichTextElements) {\n return message.replace(/'\\{(.*?)\\}'/gi, \"{$1}\");\n }\n values = __assign(__assign({}, defaultRichTextElements), (values || {}));\n formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);\n defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);\n if (!message) {\n if (fallbackOnEmptyString === false && message === '') {\n return message;\n }\n if (!defaultMessage ||\n (locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {\n // This prevents warnings from littering the console in development\n // when no `messages` are passed into the for the\n // default locale.\n onError(new MissingTranslationError(messageDescriptor, locale));\n }\n if (defaultMessage) {\n try {\n var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting default message for: \\\"\".concat(id, \"\\\", rendering default message verbatim\"), locale, messageDescriptor, e));\n return typeof defaultMessage === 'string' ? defaultMessage : id;\n }\n }\n return id;\n }\n // We have the translated message\n try {\n var formatter = state.getMessageFormat(message, locale, formats, __assign({ formatters: state }, (opts || {})));\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting message: \\\"\".concat(id, \"\\\", using \").concat(defaultMessage ? 'default message' : 'id', \" as fallback.\"), locale, messageDescriptor, e));\n }\n if (defaultMessage) {\n try {\n var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting the default message for: \\\"\".concat(id, \"\\\", rendering message verbatim\"), locale, messageDescriptor, e));\n }\n }\n if (typeof message === 'string') {\n return message;\n }\n if (typeof defaultMessage === 'string') {\n return defaultMessage;\n }\n return id;\n};\n","/**\n * Cannot do Math.log(x) / Math.log(10) bc if IEEE floating point issue\n * @param x number\n */\nexport function getMagnitude(x) {\n // Cannot count string length via Number.toString because it may use scientific notation\n // for very small or very large numbers.\n return Math.floor(Math.log(x) * Math.LOG10E);\n}\nexport function repeat(s, times) {\n if (typeof s.repeat === 'function') {\n return s.repeat(times);\n }\n var arr = new Array(times);\n for (var i = 0; i < arr.length; i++) {\n arr[i] = s;\n }\n return arr.join('');\n}\nexport function setInternalSlot(map, pl, field, value) {\n if (!map.get(pl)) {\n map.set(pl, Object.create(null));\n }\n var slots = map.get(pl);\n slots[field] = value;\n}\nexport function setMultiInternalSlots(map, pl, props) {\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\n var k = _a[_i];\n setInternalSlot(map, pl, k, props[k]);\n }\n}\nexport function getInternalSlot(map, pl, field) {\n return getMultiInternalSlots(map, pl, field)[field];\n}\nexport function getMultiInternalSlots(map, pl) {\n var fields = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n fields[_i - 2] = arguments[_i];\n }\n var slots = map.get(pl);\n if (!slots) {\n throw new TypeError(\"\".concat(pl, \" InternalSlot has not been initialized\"));\n }\n return fields.reduce(function (all, f) {\n all[f] = slots[f];\n return all;\n }, Object.create(null));\n}\nexport function isLiteralPart(patternPart) {\n return patternPart.type === 'literal';\n}\n/*\n 17 ECMAScript Standard Built-in Objects:\n Every built-in Function object, including constructors, that is not\n identified as an anonymous function has a name property whose value\n is a String.\n\n Unless otherwise specified, the name property of a built-in Function\n object, if it exists, has the attributes { [[Writable]]: false,\n [[Enumerable]]: false, [[Configurable]]: true }.\n*/\nexport function defineProperty(target, name, _a) {\n var value = _a.value;\n Object.defineProperty(target, name, {\n configurable: true,\n enumerable: false,\n writable: true,\n value: value,\n });\n}\n/**\n * 7.3.5 CreateDataProperty\n * @param target\n * @param name\n * @param value\n */\nexport function createDataProperty(target, name, value) {\n Object.defineProperty(target, name, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: value,\n });\n}\nexport var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;\nexport function invariant(condition, message, Err) {\n if (Err === void 0) { Err = Error; }\n if (!condition) {\n throw new Err(message);\n }\n}\n","import { __assign } from \"tslib\";\nimport { filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlFormatError } from './error';\nvar LIST_FORMAT_OPTIONS = [\n 'type',\n 'style',\n];\nvar now = Date.now();\nfunction generateToken(i) {\n return \"\".concat(now, \"_\").concat(i, \"_\").concat(now);\n}\nexport function formatList(opts, getListFormat, values, options) {\n if (options === void 0) { options = {}; }\n var results = formatListToParts(opts, getListFormat, values, options).reduce(function (all, el) {\n var val = el.value;\n if (typeof val !== 'string') {\n all.push(val);\n }\n else if (typeof all[all.length - 1] === 'string') {\n all[all.length - 1] += val;\n }\n else {\n all.push(val);\n }\n return all;\n }, []);\n return results.length === 1 ? results[0] : results.length === 0 ? '' : results;\n}\nexport function formatListToParts(_a, getListFormat, values, options) {\n var locale = _a.locale, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var ListFormat = Intl.ListFormat;\n if (!ListFormat) {\n onError(new FormatError(\"Intl.ListFormat is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-listformat\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, LIST_FORMAT_OPTIONS);\n try {\n var richValues_1 = {};\n var serializedValues = values.map(function (v, i) {\n if (typeof v === 'object') {\n var id = generateToken(i);\n richValues_1[id] = v;\n return id;\n }\n return String(v);\n });\n return getListFormat(locale, filteredOptions)\n .formatToParts(serializedValues)\n .map(function (part) {\n return part.type === 'literal'\n ? part\n : __assign(__assign({}, part), { value: richValues_1[part.value] || part.value });\n });\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting list.', locale, e));\n }\n // @ts-ignore\n return values;\n}\n","import { filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlFormatError } from './error';\nvar DISPLAY_NAMES_OPTONS = [\n 'style',\n 'type',\n 'fallback',\n 'languageDisplay',\n];\nexport function formatDisplayName(_a, getDisplayNames, value, options) {\n var locale = _a.locale, onError = _a.onError;\n var DisplayNames = Intl.DisplayNames;\n if (!DisplayNames) {\n onError(new FormatError(\"Intl.DisplayNames is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-displaynames\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, DISPLAY_NAMES_OPTONS);\n try {\n return getDisplayNames(locale, filteredOptions).of(value);\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting display name.', locale, e));\n }\n}\n","import { __assign } from \"tslib\";\nimport { createFormatters, DEFAULT_INTL_CONFIG } from './utils';\nimport { InvalidConfigError, MissingDataError } from './error';\nimport { formatNumber, formatNumberToParts } from './number';\nimport { formatRelativeTime } from './relativeTime';\nimport { formatDate, formatDateToParts, formatTime, formatTimeToParts, formatDateTimeRange, } from './dateTime';\nimport { formatPlural } from './plural';\nimport { formatMessage } from './message';\nimport { formatList, formatListToParts } from './list';\nimport { formatDisplayName } from './displayName';\nfunction messagesContainString(messages) {\n var firstMessage = messages ? messages[Object.keys(messages)[0]] : undefined;\n return typeof firstMessage === 'string';\n}\nfunction verifyConfigMessages(config) {\n if (config.onWarn &&\n config.defaultRichTextElements &&\n messagesContainString(config.messages || {})) {\n config.onWarn(\"[@formatjs/intl] \\\"defaultRichTextElements\\\" was specified but \\\"message\\\" was not pre-compiled. \\nPlease consider using \\\"@formatjs/cli\\\" to pre-compile your messages for performance.\\nFor more details see https://formatjs.io/docs/getting-started/message-distribution\");\n }\n}\n/**\n * Create intl object\n * @param config intl config\n * @param cache cache for formatter instances to prevent memory leak\n */\nexport function createIntl(config, cache) {\n var formatters = createFormatters(cache);\n var resolvedConfig = __assign(__assign({}, DEFAULT_INTL_CONFIG), config);\n var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;\n if (!locale) {\n if (onError) {\n onError(new InvalidConfigError(\"\\\"locale\\\" was not configured, using \\\"\".concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details\")));\n }\n // Since there's no registered locale data for `locale`, this will\n // fallback to the `defaultLocale` to make sure things can render.\n // The `messages` are overridden to the `defaultProps` empty object\n // to maintain referential equality across re-renders. It's assumed\n // each contains a `defaultMessage` prop.\n resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';\n }\n else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {\n onError(new MissingDataError(\"Missing locale data for locale: \\\"\".concat(locale, \"\\\" in Intl.NumberFormat. Using default locale: \\\"\").concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details\")));\n }\n else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length &&\n onError) {\n onError(new MissingDataError(\"Missing locale data for locale: \\\"\".concat(locale, \"\\\" in Intl.DateTimeFormat. Using default locale: \\\"\").concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details\")));\n }\n verifyConfigMessages(resolvedConfig);\n return __assign(__assign({}, resolvedConfig), { formatters: formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateTimeRange: formatDateTimeRange.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), \n // @ts-expect-error TODO: will get to this later\n formatMessage: formatMessage.bind(null, resolvedConfig, formatters), \n // @ts-expect-error TODO: will get to this later\n $t: formatMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatListToParts: formatListToParts.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) });\n}\n","import EventEmitter from './index.js'\n\nexport { EventEmitter }\nexport default EventEmitter\n","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/**\n * @private\n * @hide\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport default class FormatterBase {\n get options() {\n return [];\n }\n}\n_defineProperty(FormatterBase, \"type\", void 0);","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport Formatter from './-base';\n/**\n * @private\n * @hide\n */\nexport default class FormatDate extends Formatter {\n format(intl, ...[value, opts]) {\n return intl.formatDate(value, opts);\n }\n}\n_defineProperty(FormatDate, \"type\", 'date');","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport Formatter from './-base';\n\n/**\n * @private\n * @hide\n */\nexport default class FormatList extends Formatter {\n format(intl, ...[value, opts]) {\n return intl.formatList(value, opts);\n }\n}\n_defineProperty(FormatList, \"type\", 'list');","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport { htmlSafe, isHTMLSafe } from '@ember/template';\nimport Ember from 'ember';\nimport Formatter from './-base';\nconst {\n Handlebars: {\n // @ts-ignore: Upstream types are incomplete.\n Utils: {\n escapeExpression\n }\n }\n} = Ember;\nfunction escapeOptions(object) {\n if (typeof object !== 'object') {\n return;\n }\n const escapedOpts = {};\n Object.keys(object).forEach(key => {\n const val = object[key];\n if (isHTMLSafe(val)) {\n // If the option is an instance of Ember SafeString,\n // we don't want to pass it into the formatter, since the\n // formatter won't know what to do with it. Instead, we cast\n // the SafeString to a regular string using `toHTML`.\n // Since it was already marked as safe we should *not* escape it.\n // @ts-ignore: see comment above\n escapedOpts[key] = val.toHTML();\n } else if (typeof val === 'string') {\n // @ts-ignore: see comment above\n escapedOpts[key] = escapeExpression(val);\n } else {\n // @ts-ignore: see comment above\n escapedOpts[key] = val; // copy as-is\n }\n });\n return escapedOpts;\n}\n/**\n * @private\n * @hide\n */\nexport default class FormatMessage extends Formatter {\n // ! Function overloads are not passed through generic types for reasons that\n // evade my knowledge. ¯\\_(ツ)_/¯\n // For this reason these types need to be manually copied over to the\n // `IntlService#formatMessage`.\n\n format(intl, stringOrDesc, options) {\n const isHTMLSafe = options && options.htmlSafe;\n // Empty string is considered an err in ember-intl\n // if (typeof stringOrDesc === 'string' && !stringOrDesc) {\n // return stringOrDesc;\n // }\n const escapedOptions = isHTMLSafe ? escapeOptions(options) : options;\n const desc = stringOrDesc && typeof stringOrDesc === 'object' ? stringOrDesc : {\n id: stringOrDesc,\n defaultMessage: stringOrDesc\n };\n const result = intl.formatMessage(desc, escapedOptions, {\n ignoreTag: true\n });\n return isHTMLSafe ? htmlSafe(result) : result;\n }\n}\n_defineProperty(FormatMessage, \"type\", 'message');","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport Formatter from './-base';\n\n/**\n * @private\n * @hide\n */\nexport default class FormatNumber extends Formatter {\n format(intl, ...[value, opts]) {\n return intl.formatNumber(value, opts);\n }\n}\n_defineProperty(FormatNumber, \"type\", 'number');","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { assert } from '@ember/debug';\nimport Formatter from './-base';\n\n/**\n * An object with some or all of properties of `options` parameter\n * of `Intl.RelativeTimeFormat` constructor.\n *\n * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters).\n *\n * [Specification](https://tc39.es/ecma402/#sec-InitializeRelativeTimeFormat).\n */\n\n/**\n * @private\n * @hide\n */\nexport default class FormatRelative extends Formatter {\n format(intl, value, formatOptions) {\n assert(`[ember-intl] FormatRelative: Missing option`, formatOptions);\n const {\n format\n } = formatOptions;\n let unit = formatOptions.unit;\n let opts = formatOptions;\n if (!unit && format && intl.formats.relative && (opts = intl.formats.relative[format])) {\n unit = opts.unit;\n }\n assert(`[ember-intl] FormatRelative: 'formatOptions' are missing a 'unit'. ${JSON.stringify(formatOptions)}`, unit);\n return intl.formatRelativeTime(value, unit, opts);\n }\n}\n_defineProperty(FormatRelative, \"type\", 'relative');","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport Formatter from './-base';\n\n/**\n * @private\n * @hide\n */\nexport default class FormatTime extends Formatter {\n format(intl, ...[value, opts]) {\n return intl.formatTime(value, opts);\n }\n}\n_defineProperty(FormatTime, \"type\", 'time');","/**\n * @private\n * @hide\n */\nconst proto = Object.create(null, {\n constructor: {\n value: undefined,\n enumerable: false,\n writable: true\n }\n});\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction EmptyObject() {}\nEmptyObject.prototype = proto;\n\n/**\n * @private\n * @hide\n */\nexport default EmptyObject;","import EmptyObject from './empty-object';\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n/**\n * @private\n * @hide\n */\nexport default function flatten(src) {\n const result = new EmptyObject();\n for (const key in src) {\n if (!hasOwnProperty.call(src, key)) {\n continue;\n }\n const value = src[key];\n if (typeof value === 'object' && value) {\n const hash = flatten(value);\n for (const suffix in hash) {\n const hasSuffix = hash[suffix];\n if (typeof hasSuffix !== 'undefined') {\n result[`${key}.${suffix}`] = hasSuffix;\n }\n }\n } else {\n if (typeof value !== 'undefined') {\n result[key] = value;\n }\n }\n }\n return result;\n}","export default [[\"en-us\", {\n \"@adc/ui-components\": {\n \"add\": \"Add\",\n \"addItems\": \"Add {itemsText}\",\n \"additionalResults\": \"{count} additional searchable results...\",\n \"all\": \"All\",\n \"allItems\": \"All {items}\",\n \"am\": \"AM\",\n \"apply\": \"Apply\",\n \"aurora\": \"Aurora\",\n \"beginText\": \"Starting at\",\n \"cancel\": \"Cancel\",\n \"canyon\": \"Canyon\",\n \"changeColorSection\": \"Change color section\",\n \"changeColorSelector\": \"Use arrows to change the color\",\n \"cherryBlossom\": \"Cherry blossom\",\n \"clearSearch\": \"Clear search\",\n \"close\": \"Close\",\n \"collapse\": \"Collapse\",\n \"colonSeparatedText\": \"{first}: {second}\",\n \"color\": \"Color\",\n \"colors\": \"Colors\",\n \"components\": {\n \"adc-banner\": {\n \"infoMessage\": \"Info: {message}\",\n \"issueMessage\": \"Issue: {message}\"\n },\n \"date-range-picker\": {\n \"selectDate\": \"Select a Date\",\n \"selectDateRange\": \"Select Date Range\"\n },\n \"multi-schedule-view\": {\n \"allDay\": \"All Day\"\n },\n \"spinner-svg\": {\n \"loading\": \"Loading...\"\n },\n \"week-view\": {\n \"dayAriaLabel\": \"To select {dayName}, press space or enter.\"\n }\n },\n \"confirm\": \"Confirm\",\n \"confirmPasswordLabel\": \"Confirm Password\",\n \"coolWhite\": \"Cool White\",\n \"currentPasswordLabel\": \"Current Password\",\n \"dayWhite\": \"Day White\",\n \"daybreak\": \"Daybreak\",\n \"delete\": \"Delete\",\n \"deleteMessage\": \"Are you sure you want to delete?\",\n \"dimmerSlider\": \"Dimmer slider\",\n \"dropdownTitle\": \"Actions\",\n \"dusk\": \"Dusk\",\n \"edit\": \"Edit\",\n \"emptyPasswordStrengthText\": \"No Password\",\n \"endText\": \"Ending at\",\n \"error\": \"Error\",\n \"expand\": \"Expand\",\n \"expectedFormat\": \"Expected format: {format}\",\n \"fairPasswordStrengthText\": \"Fair\",\n \"fiji\": \"Fiji\",\n \"generate\": \"Generate\",\n \"goodPasswordStrengthText\": \"Good\",\n \"hidePassword\": \"Hide Password\",\n \"hueSlider\": \"Hue slider\",\n \"info\": \"Info\",\n \"issue\": \"Issue\",\n \"lettersRequired\": \"{count, plural,\\n =0 {No letter requirement.}\\n =1 {Must contain at least # letter.}\\n other {Must contain at least # letters.}\\n}\",\n \"lightOff\": \"Turn the light off\",\n \"lightOn\": \"Turn the light on\",\n \"loading\": \"Loading...\",\n \"luminosity\": \"Luminosity\",\n \"navModalSubMenu\": \"{parentMenuName} submenu\",\n \"nebula\": \"Nebula\",\n \"newPasswordLabel\": \"New Password\",\n \"nextDayText\": \"(next day)\",\n \"noItems\": \"No {itemsText} have been selected. Click \\\"Add {itemsText}\\\" to get started.\",\n \"noResults\": \"No results\",\n \"noSearchResults\": \"No search results\",\n \"none\": \"None\",\n \"numbersRequired\": \"{count, plural,\\n =0 {No number requirement.}\\n =1 {Must contain at least # number.}\\n other {Must contain at least # numbers.}\\n}\",\n \"off\": \"Off\",\n \"ok\": \"Ok\",\n \"on\": \"On\",\n \"openList\": \"Open list\",\n \"pacific\": \"Pacific\",\n \"passwordConfirmationError\": \"Password doesn't match.\",\n \"passwordStrengthLabel\": \"Password Strength\",\n \"passwordTipsLabel\": \"Tips to make a strong password\",\n \"picker\": \"Picker\",\n \"pleaseSelect\": \"Please Select\",\n \"pm\": \"PM\",\n \"presets\": \"Presets\",\n \"promiseFailed\": \"The following error occurred: {error}\",\n \"removeAll\": \"Remove All\",\n \"rename\": \"Rename\",\n \"requiredLength\": \"{count, plural,\\n =0 {No character requirement.}\\n =1 {Must contain at least # character.}\\n other {Must contain at least # characters.}\\n}\",\n \"requirementLabel\": \"Minimum Requirements\",\n \"revealPassword\": \"Reveal Password\",\n \"scannerBar\": \"Scan a Barcode\",\n \"scannerBoth\": \"Scan a Barcode or QR code\",\n \"scannerQR\": \"Scan a QR code\",\n \"search\": \"Search\",\n \"selected\": \"Selected\",\n \"selectedItems\": \"Selected {itemsText}\",\n \"sessionEnded\": \"Session ended\",\n \"softWhite\": \"Soft White\",\n \"some\": \"Some\",\n \"specifyDateAndTime\": \"Specify the Date and Time\",\n \"startTime\": \"Start Time\",\n \"strongPasswordStrengthText\": \"Strong\",\n \"success\": \"Success\",\n \"suggestedSearches\": \"Suggested Searches\",\n \"symbolsRequired\": \"{count, plural,\\n =0 {No symbol requirement.}\\n =1 {Must contain at least # symbol.}\\n other {Must contain at least # symbols.}\\n}\",\n \"temperature\": \"Temperature\",\n \"timeFormat\": \"Please adhere to this time format \\\"{format}\\\"\",\n \"timeInvalidMax\": \"Value must be {time} or earlier\",\n \"timeInvalidMin\": \"Value must be {time} or later\",\n \"triggerDropdown\": \"Press ENTER, SPACE, UP ARROW or DOWN ARROW to trigger list\",\n \"triggerSelect\": \"Press ENTER, SPACE, UP ARROW + ALT or DOWN ARROW + ALT to trigger select\",\n \"turnOff\": \"Turn off\",\n \"turnOn\": \"Turn on\",\n \"viewMore\": \"View more\",\n \"warmWhite\": \"Warm White\",\n \"warning\": \"Warning\",\n \"weakPasswordStrengthText\": \"Weak\"\n },\n \"generic\": {\n \"back\": \"Back\",\n \"cancel\": \"Cancel\",\n \"hide\": \"Hide\",\n \"ok\": \"Ok\",\n \"show\": \"Show\"\n }\n}]];","/**\n * @private\n * @hide\n */\nexport default function normalizeLocale(localeName) {\n if (typeof localeName === 'string') {\n return localeName.replace(/_/g, '-').toLowerCase();\n }\n}","var _class, _descriptor, _descriptor2;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nimport { getOwner } from '@ember/application';\nimport { makeArray } from '@ember/array';\nimport { assert } from '@ember/debug';\nimport { registerDestructor } from '@ember/destroyable';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { cancel, next } from '@ember/runloop';\nimport Service from '@ember/service';\nimport { createIntl, createIntlCache, IntlErrorCode } from '@formatjs/intl';\nimport { tracked } from '@glimmer/tracking';\nimport EventEmitter from 'eventemitter3';\nimport { FormatDate, FormatList, FormatMessage, FormatNumber, FormatRelative, FormatTime } from '../-private/formatters';\nimport flatten from '../-private/utils/flatten';\nimport getDOM from '../-private/utils/get-dom';\nimport hydrate from '../-private/utils/hydrate';\nimport isArrayEqual from '../-private/utils/is-array-equal';\nimport normalizeLocale from '../-private/utils/normalize-locale';\nlet IntlService = (_class = class IntlService extends Service {\n /**\n * Returns an array of registered locale names\n *\n */\n get locales() {\n return Object.keys(this._intls);\n }\n\n /** @public **/\n set locale(localeName) {\n const proposed = makeArray(localeName).map(normalizeLocale);\n if (!isArrayEqual(proposed, this._locale)) {\n this._locale = proposed;\n cancel(this._timer);\n this._timer = next(() => {\n this._ee.emit('localeChanged');\n this._updateDocumentLanguage(this._locale);\n });\n }\n }\n get locale() {\n return this._locale;\n }\n\n /**\n * Returns the first locale of the currently active locales\n *\n */\n get primaryLocale() {\n return this.locale[0];\n }\n\n /** @public **/\n\n /** @public **/\n constructor() {\n super(...arguments);\n _defineProperty(this, \"formatRelative\", createFormatterProxy('relative'));\n /** @public **/\n _defineProperty(this, \"formatMessage\", createFormatterProxy('message'));\n /** @public **/\n _defineProperty(this, \"formatNumber\", createFormatterProxy('number'));\n /** @public **/\n _defineProperty(this, \"formatTime\", createFormatterProxy('time'));\n /** @public **/\n _defineProperty(this, \"formatDate\", createFormatterProxy('date'));\n /** @public **/\n _defineProperty(this, \"formatList\", createFormatterProxy('list'));\n /** @private **/\n _initializerDefineProperty(this, \"_locale\", _descriptor, this);\n /** @private **/\n _defineProperty(this, \"_timer\", null);\n /** @private **/\n _defineProperty(this, \"_formats\", null);\n /** @private **/\n _defineProperty(this, \"_formatters\", null);\n /** @private */\n _initializerDefineProperty(this, \"_intls\", _descriptor2, this);\n /**\n * @private\n * @type {EventEmitter}\n */\n _defineProperty(this, \"_ee\", null);\n _defineProperty(this, \"_cache\", createIntlCache());\n const initialLocale = this.locale || ['en-us'];\n this._intls = {};\n this._ee = new EventEmitter();\n this.setLocale(initialLocale);\n this._owner = getOwner(this);\n this._formatters = this._createFormatters();\n if (!this._formats) {\n this._formats = this._owner.resolveRegistration('formats:main') || {};\n }\n this.onIntlError = this.onIntlError.bind(this);\n this.getIntl = this.getIntl.bind(this);\n this.getOrCreateIntl = this.getOrCreateIntl.bind(this);\n hydrate(this);\n }\n willDestroy() {\n super.willDestroy(...arguments);\n cancel(this._timer);\n }\n onIntlError(err) {\n if (err.code !== IntlErrorCode.MISSING_TRANSLATION) {\n throw err;\n }\n }\n\n /** @private **/\n onError({\n /* kind, */error\n }) {\n throw error;\n }\n\n /** @public **/\n lookup(key, localeName, options = {}) {\n const localeNames = this._localeWithDefault(localeName);\n let translation;\n for (let i = 0; i < localeNames.length; i++) {\n const messages = this.translationsFor(localeNames[i]);\n if (!messages) {\n continue;\n }\n translation = messages[key];\n if (translation !== undefined) {\n break;\n }\n }\n if (translation === undefined && options.resilient !== true) {\n const missingMessage = this._owner.resolveRegistration('util:intl/missing-message');\n return missingMessage.call(this, key, localeNames, options);\n }\n return translation;\n }\n\n /**\n * @private\n */\n getIntl(locale) {\n const resolvedLocale = Array.isArray(locale) ? locale[0] : locale;\n return this._intls[resolvedLocale];\n }\n getOrCreateIntl(locale, messages) {\n const resolvedLocale = Array.isArray(locale) ? locale[0] : locale;\n const existingIntl = this._intls[resolvedLocale];\n if (!existingIntl) {\n this._intls = {\n ...this._intls,\n [resolvedLocale]: this.createIntl(resolvedLocale, messages)\n };\n } else if (messages) {\n this._intls = {\n ...this._intls,\n [resolvedLocale]: this.createIntl(resolvedLocale, {\n ...(existingIntl.messages || {}),\n ...messages\n })\n };\n }\n return this._intls[resolvedLocale];\n }\n\n /**\n * @private\n * @param {String} locale Locale of intl obj to create\n */\n createIntl(locale, messages = {}) {\n const resolvedLocale = Array.isArray(locale) ? locale[0] : locale;\n return createIntl({\n locale: resolvedLocale,\n defaultLocale: resolvedLocale,\n formats: this._formats,\n defaultFormats: this._formats,\n onError: this.onIntlError,\n messages\n }, this._cache);\n }\n validateKeys(keys) {\n return keys.forEach(key => {\n assert(`[ember-intl] expected translation key \"${key}\" to be of type String but received: \"${typeof key}\"`, typeof key === 'string');\n });\n }\n\n /** @public **/\n t(key, options = {}) {\n let keys = [key];\n if (options.default) {\n if (Array.isArray(options.default)) {\n keys = [...keys, ...options.default];\n } else if (typeof options.default === 'string') {\n keys = [...keys, options.default];\n }\n }\n this.validateKeys(keys);\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n const message = this.lookup(key, options.locale, {\n ...options,\n // Note: last iteration will throw with the last key that was missing\n // in the future maybe the thrown error should include all the keys to help debugging\n resilient: keys.length - 1 !== index\n });\n\n // @formatjs/intl consider empty message to be an error\n if (message === '' || typeof message === 'number') {\n return message;\n }\n if (message) {\n return this.formatMessage({\n id: key,\n defaultMessage: message\n }, options);\n }\n }\n }\n\n /** @public **/\n exists(key, localeName) {\n const localeNames = this._localeWithDefault(localeName);\n assert(`[ember-intl] locale is unset, cannot lookup '${key}'`, Array.isArray(localeNames) && localeNames.length);\n return localeNames.some(localeName => key in (this.getIntl(localeName)?.messages || {}));\n }\n\n /** @public */\n setLocale(locale) {\n assert(`[ember-intl] no locale has been set! See: https://ember-intl.github.io/ember-intl/docs/quickstart#4-configure-ember-intl`, locale);\n this.locale = locale;\n this.getOrCreateIntl(locale);\n }\n\n /** @public **/\n addTranslations(localeName, payload) {\n const locale = normalizeLocale(localeName);\n this.getOrCreateIntl(locale, flatten(payload));\n }\n\n /** @public **/\n translationsFor(localeName) {\n const locale = normalizeLocale(localeName);\n return this.getIntl(locale)?.messages;\n }\n\n /** @private **/\n _localeWithDefault(localeName) {\n if (!localeName) {\n return this._locale || [];\n }\n if (typeof localeName === 'string') {\n return makeArray(localeName).map(normalizeLocale);\n }\n if (Array.isArray(localeName)) {\n return localeName.map(normalizeLocale);\n }\n }\n\n /** @private **/\n _updateDocumentLanguage(locales) {\n const dom = getDOM(this);\n if (dom) {\n const [primaryLocale] = locales;\n const html = dom.documentElement;\n html.setAttribute('lang', primaryLocale);\n }\n }\n\n /** @private */\n _createFormatters() {\n return {\n message: new FormatMessage(),\n relative: new FormatRelative(),\n number: new FormatNumber(),\n time: new FormatTime(),\n date: new FormatDate(),\n list: new FormatList()\n };\n }\n /**\n * @private\n * @param fn\n * @param context\n */\n onLocaleChanged(fn, context) {\n this._ee.on('localeChanged', fn, context);\n registerDestructor(this, () => {\n this._ee.off('localeChanged', fn, context);\n });\n }\n}, _applyDecoratedDescriptor(_class.prototype, \"locale\", [dependentKeyCompat], Object.getOwnPropertyDescriptor(_class.prototype, \"locale\"), _class.prototype), _descriptor = _applyDecoratedDescriptor(_class.prototype, \"_locale\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return null;\n }\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"_intls\", [tracked], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function () {\n return null;\n }\n}), _class);\nexport { IntlService as default };\nfunction createFormatterProxy(name) {\n return function serviceFormatterProxy(value, formatOptions) {\n let locale;\n let intl;\n if (formatOptions && formatOptions.locale) {\n locale = this._localeWithDefault(formatOptions.locale);\n // Cannot use getOrCreateIntl since it triggers a re-render which\n // might cause infinite loop\n // This is also a case we're not optimizing for so let it take\n // the slow path\n intl = this.createIntl(locale);\n } else {\n locale = this.locale;\n intl = this.getIntl(locale);\n }\n return this._formatters[name].format(intl, value, formatOptions);\n };\n}","import { isArray } from '@ember/array';\n\n/**\n * @private\n * @hide\n */\nexport default function isArrayEqual(a, b) {\n if (!isArray(a) || !isArray(b)) {\n return false;\n }\n if (a === b) {\n return true;\n }\n return a.toString() === b.toString();\n}","import translations from '../../translations';\n\n/**\n * @private\n * @hide\n */\nexport default function hydrate(service) {\n translations.forEach(([locale, translations]) => {\n service.addTranslations(locale, translations);\n });\n}","import { getOwner } from '@ember/application';\n\n// adjusted from https://github.com/yapplabs/ember-wormhole/blob/0.5.4/addon/utils/dom.js#L45-L63\n//\n// Private Ember API usage. Get the dom implementation used by the current\n// renderer, be it native browser DOM or Fastboot SimpleDOM\n/**\n * @private\n * @hide\n */\nexport default function getDOM(context) {\n let {\n renderer\n } = context;\n if (!renderer || !renderer._dom) {\n // pre glimmer2\n let container = getOwner ? getOwner(context) : context.container;\n let documentService = container.lookup('service:-document');\n if (documentService) {\n return documentService;\n }\n renderer = container.lookup('renderer:-dom');\n }\n if (renderer._dom && renderer._dom.document) {\n // pre Ember 2.6\n return renderer._dom.document;\n }\n return null;\n}","import { isPresent } from '@ember/utils';\n/**\n * Present config options\n * @see {@link https://api.emberjs.com/ember/3.28/functions/@ember%2Futils/isPresent|isPresent}\n * @param {Options} opts\n * @returns {Options}\n */\nexport function compact(opts) {\n return includeKeys(opts, key => isPresent(opts[key]));\n}\n\n/**\n * Config options without `excludedKeys`\n * @param {Options} opts\n * @param {string[]} excludedKeys\n * @returns {Options}\n */\nexport function without(opts, excludedKeys) {\n return includeKeys(opts, key => !excludedKeys.includes(key));\n}\n\n/**\n * Config options with allowed keys\n * @param {Options} opts\n * @param {(key:string) => boolean} include\n * @returns {Options}\n */\nfunction includeKeys(opts, include) {\n const newOpts = {};\n for (const key in opts) {\n if (include(key)) newOpts[key] = opts[key];\n }\n return newOpts;\n}\n\n/**\n * Check if given object has any own properties\n * @param {Record} obj\n * @returns {boolean}\n */\nexport function hasOwnProperties(obj) {\n return Object.getOwnPropertyNames(obj).length > 0;\n}\nexport default {\n compact,\n without,\n hasOwnProperties\n};","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { isPresent } from '@ember/utils';\nimport { assert } from '@ember/debug';\nimport { capitalize } from '@ember/string';\nimport { compact } from 'ember-metrics/-private/utils/object-transforms';\nimport removeFromDOM from 'ember-metrics/-private/utils/remove-from-dom';\nimport BaseAdapter from './base';\nexport default class GoogleAnalytics extends BaseAdapter {\n constructor(...args) {\n super(...args);\n _defineProperty(this, \"gaSendKey\", 'send');\n }\n toStringExtension() {\n return 'GoogleAnalytics';\n }\n\n // eslint-disable-next-line ember/classic-decorator-hooks\n init() {\n const config = {\n ...this.config\n };\n const {\n id,\n sendHitTask,\n trace,\n require,\n debug,\n trackerName\n } = config;\n if (trackerName) {\n this.gaSendKey = `${trackerName}.send`;\n }\n assert(`[ember-metrics] You must pass a valid \\`id\\` to the ${this.toString()} adapter`, id);\n delete config.id;\n delete config.require;\n delete config.debug;\n delete config.sendHitTask;\n delete config.trace;\n delete config.trackerName;\n const hasOptions = isPresent(Object.keys(config));\n this._injectScript(debug);\n if (trace === true) {\n window.ga_debug = {\n trace: true\n };\n }\n window.ga('create', id, hasOptions ? config : 'auto', trackerName);\n if (require) {\n require.forEach(plugin => {\n window.ga('require', plugin);\n });\n }\n if (sendHitTask === false) {\n window.ga('set', 'sendHitTask', null);\n }\n }\n\n /* eslint-disable */\n // prettier-ignore\n _injectScript(debug) {\n (function (i, s, o, g, r, a, m) {\n i['GoogleAnalyticsObject'] = r;\n i[r] = i[r] || function () {\n (i[r].q = i[r].q || []).push(arguments);\n }, i[r].l = 1 * new Date();\n a = s.createElement(o), m = s.getElementsByTagName(o)[0];\n a.async = 1;\n a.src = g;\n m.parentNode.insertBefore(a, m);\n })(window, document, 'script', `https://www.google-analytics.com/analytics${debug ? '_debug' : ''}.js`, 'ga');\n }\n /* eslint-enable */\n\n identify(options = {}) {\n const compactedOptions = compact(options);\n const {\n distinctId\n } = compactedOptions;\n window.ga('set', 'userId', distinctId);\n }\n trackEvent(options = {}) {\n const compactedOptions = compact(options);\n const sendEvent = {\n hitType: 'event'\n };\n const eventKeys = ['category', 'action', 'label', 'value'];\n let gaEvent = {};\n if (compactedOptions.nonInteraction) {\n gaEvent.nonInteraction = compactedOptions.nonInteraction;\n delete compactedOptions.nonInteraction;\n }\n for (let key in compactedOptions) {\n if (eventKeys.includes(key)) {\n const capitalizedKey = capitalize(key);\n gaEvent[`event${capitalizedKey}`] = compactedOptions[key];\n } else {\n gaEvent[key] = compactedOptions[key];\n }\n }\n const event = {\n ...sendEvent,\n ...gaEvent\n };\n const gaSendKey = this.gaSendKey;\n window.ga(gaSendKey, event);\n return event;\n }\n trackPage(options = {}) {\n const compactedOptions = compact(options);\n const sendEvent = {\n hitType: 'pageview'\n };\n const event = {\n ...sendEvent,\n ...compactedOptions\n };\n for (let key in compactedOptions) {\n // eslint-disable-next-line\n if (compactedOptions.hasOwnProperty(key)) {\n window.ga('set', key, compactedOptions[key]);\n }\n }\n const gaSendKey = this.gaSendKey;\n window.ga(gaSendKey, event);\n return event;\n }\n willDestroy() {\n removeFromDOM('script[src*=\"google-analytics\"]');\n delete window.ga;\n }\n}","/**\n * Remove scripts defined by selectors from DOM.\n *\n * @param selectors One or more DOM selectors to match against.\n */\nexport default function removeFromDOM(selectors) {\n document.querySelectorAll(selectors).forEach(el => {\n el.parentElement?.removeChild(el);\n });\n}","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport Service from '@ember/service';\nimport { assert } from '@ember/debug';\nimport { dasherize } from '@ember/string';\nimport { getOwner } from '@ember/application';\nexport default class Metrics extends Service {\n /**\n * When the Service is created, activate adapters that were specified in the\n * configuration. This config is injected into the Service as `options`.\n */\n constructor() {\n super(...arguments);\n /**\n * Cached adapters to reduce multiple expensive lookups.\n *\n * @property _adapters\n * @private\n * @type Object\n * @default null\n */\n _defineProperty(this, \"_adapters\", {});\n /**\n * Contextual information attached to each call to an adapter. Often you'll\n * want to include things like `currentUser.name` with every event or page\n * view that's tracked. Any properties that you bind to `metrics.context`\n * will be merged into the options for every service call.\n *\n * @property context\n * @type Object\n * @default null\n */\n _defineProperty(this, \"context\", {});\n /**\n * Indicates whether calls to the service will be forwarded to the adapters.\n * This is determined by investigating the user's doNotTrack settings.\n *\n * Note that the doNotTrack specification is deprecated, and could stop\n * working at any minute. As such should this feature not be detected we\n * presume tracking is permitted.\n *\n * @property enabled\n * @type Boolean\n */\n _defineProperty(this, \"enabled\", typeof navigator !== 'undefined' && navigator.doNotTrack !== '1');\n /**\n * Environment the host application is running in (e.g. development or production).\n */\n _defineProperty(this, \"appEnvironment\", null);\n const owner = getOwner(this);\n owner.registerOptionsForType('ember-metrics@metrics-adapter', {\n instantiate: false\n });\n owner.registerOptionsForType('metrics-adapter', {\n instantiate: false\n });\n const config = owner.factoryFor('config:environment').class;\n const {\n metricsAdapters = []\n } = config;\n const {\n environment = 'development'\n } = config;\n this._options = {\n metricsAdapters,\n environment\n };\n this.appEnvironment = environment;\n this.activateAdapters(metricsAdapters);\n }\n\n /**\n * Instantiates adapters from passed adapter options and caches them for future retrieval.\n *\n * @method activateAdapters\n * @param {Array} adapterOptions\n * @return {Object} instantiated adapters\n */\n activateAdapters(adapterOptions = []) {\n if (!this.enabled) {\n return;\n }\n const adaptersForEnv = this._adaptersForEnv(adapterOptions);\n const activeAdapters = {};\n for (let {\n name,\n config\n } of adaptersForEnv) {\n let adapterClass = this._lookupAdapter(name);\n if (typeof FastBoot === 'undefined' || adapterClass.supportsFastBoot) {\n activeAdapters[name] = this._adapters[name] || this._activateAdapter({\n adapterClass,\n config\n });\n }\n }\n this._adapters = activeAdapters;\n return this._adapters;\n }\n\n /**\n * Returns all adapterOptions that should be activated in the current application environment.\n * Defaults to all environments if the option is `all` or undefined.\n *\n * @method adaptersForEnv\n * @param {Array} adapterOptions\n * @private\n * @return {Array} - adapter options in the current environment\n */\n _adaptersForEnv(adapterOptions = []) {\n return adapterOptions.filter(({\n environments = ['all']\n }) => {\n return environments.includes('all') || environments.includes(this.appEnvironment);\n });\n }\n\n /**\n * Looks up the adapter from the container. Prioritizes the consuming app's\n * adapters over the addon's adapters.\n *\n * @method _lookupAdapter\n * @param {String} adapterName\n * @private\n * @return {Adapter} a local adapter or an adapter from the addon\n */\n _lookupAdapter(adapterName) {\n assert('[ember-metrics] Could not find metrics adapter without a name.', adapterName);\n const availableAdapter = getOwner(this).lookup(`ember-metrics@metrics-adapter:${dasherize(adapterName)}`);\n const localAdapter = getOwner(this).lookup(`metrics-adapter:${dasherize(adapterName)}`);\n const adapter = localAdapter || availableAdapter;\n assert(`[ember-metrics] Could not find metrics adapter ${adapterName}.`, adapter);\n return adapter;\n }\n\n /**\n * Instantiates an adapter.\n *\n * @method _activateAdapter\n * @param {Object}\n * @private\n * @return {Adapter}\n */\n _activateAdapter({\n adapterClass,\n config\n }) {\n const decoratedClass = class decoratedClass extends adapterClass {\n constructor(...args) {\n super(...args);\n _defineProperty(this, \"identify\", this.identify);\n _defineProperty(this, \"alias\", this.alias);\n _defineProperty(this, \"trackEvent\", this.trackEvent);\n _defineProperty(this, \"trackPage\", this.trackPage);\n }\n };\n return new decoratedClass(config, getOwner(this));\n }\n identify() {\n this.invoke('identify', ...arguments);\n }\n alias() {\n this.invoke('alias', ...arguments);\n }\n trackEvent() {\n this.invoke('trackEvent', ...arguments);\n }\n trackPage() {\n this.invoke('trackPage', ...arguments);\n }\n\n /**\n * Invokes a method on the passed adapter, or across all activated adapters if not passed.\n *\n * @method invoke\n * @param {String} methodName\n * @param {Rest} args\n * @return {Void}\n */\n invoke(methodName, ...args) {\n if (!this.enabled) {\n return;\n }\n let selectedAdapterNames, options;\n if (args.length > 1) {\n selectedAdapterNames = makeArray(args[0]);\n options = args[1];\n } else {\n selectedAdapterNames = Object.keys(this._adapters);\n options = args[0];\n }\n for (let adapterName of selectedAdapterNames) {\n let adapter = this._adapters[adapterName];\n adapter && adapter[methodName]({\n ...this.context,\n ...options\n });\n }\n }\n\n /**\n * On teardown, destroy cached adapters together with the Service.\n *\n * @method willDestroy\n * @return {Void}\n */\n willDestroy() {\n Object.values(this._adapters).forEach(adapter => adapter.destroy());\n }\n}\nfunction makeArray(maybeArray) {\n return Array.isArray(maybeArray) ? Array.from(maybeArray) : Array(maybeArray);\n}","function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport emberObject from '@ember/object';\nimport { assert, deprecate } from '@ember/debug';\nimport { guidFor } from '@ember/object/internals';\nimport { typeOf } from '@ember/utils';\nimport { setOwner } from '@ember/application';\nfunction makeToString(ret) {\n return () => ret;\n}\nexport default class BaseAdapter extends emberObject {\n constructor(config, owner) {\n super(...arguments);\n _defineProperty(this, \"metrics\", null);\n _defineProperty(this, \"config\", null);\n setOwner(this, owner);\n this.config = config;\n this.init();\n }\n\n // eslint-disable-next-line ember/classic-decorator-hooks\n init() {\n assert(`[ember-metrics] ${this.toString()} must implement the init hook!`);\n }\n willDestroy() {\n assert(`[ember-metrics] ${this.toString()} must implement the willDestroy hook!`);\n }\n get() {\n deprecate('Metrics Adapters must not use EmberObject methods as they will be implemented as native classes in the next major release', false, {\n id: 'ember-metrics-issue-287',\n for: 'ember-metrics',\n url: 'https://github.com/adopted-ember-addons/ember-metrics/issues/287',\n since: '1.4.0',\n until: '2.0.0'\n });\n super.get(...arguments);\n }\n set() {\n deprecate('Metrics Adapters must not use EmberObject methods as they will be implemented as native classes in the next major release', false, {\n id: 'ember-metrics.issue-287',\n for: 'ember-metrics',\n url: 'https://github.com/adopted-ember-addons/ember-metrics/issues/287',\n since: '1.4.0',\n until: '2.0.0'\n });\n super.set(...arguments);\n }\n toString() {\n const hasToStringExtension = typeOf(this.toStringExtension) === 'function';\n const extension = hasToStringExtension ? ':' + this.toStringExtension() : '';\n const ret = `ember-metrics@metrics-adapter:${extension}:${guidFor(this)}`;\n this.toString = makeToString(ret);\n return ret;\n }\n identify() {}\n trackEvent() {}\n trackPage() {}\n alias() {}\n}\n_defineProperty(BaseAdapter, \"supportsFastBoot\", false);","import { helper } from '@ember/component/helper';\nexport function noop() {\n return () => {};\n}\nexport default helper(noop);","import AwaitHelper from 'ember-promise-helpers/helpers/await';\nexport default class extends AwaitHelper {\n compute(params) {\n const maybePromise = params[0];\n return this.ensureLatestPromise(maybePromise, async promise => {\n try {\n await promise;\n this.setValue(true, maybePromise);\n } catch (_err) {\n this.setValue(false, maybePromise);\n }\n });\n }\n}","import AwaitHelper from 'ember-promise-helpers/helpers/await';\nexport default class extends AwaitHelper {\n constructor(...args) {\n super(...args);\n this.valueBeforeSettled = true;\n }\n compute(params) {\n const maybePromise = params[0];\n return this.ensureLatestPromise(maybePromise, async promise => {\n try {\n await promise;\n /* eslint-disable-next-line no-empty */\n } catch (_err) {} finally {\n this.setValue(false, maybePromise);\n }\n });\n }\n}","import Helper from '@ember/component/helper';\nimport { Promise } from 'rsvp';\nexport default class extends Helper {\n /**\n * @property valueBeforeSettled\n * @default null\n *\n * This is the value that gets returned synchronously as the helper's return\n * value before the promise is settled. For example `{{async promise}}` will return\n * null, before the promise is resolved or rejected.\n */\n constructor(...args) {\n super(...args);\n this.valueBeforeSettled = null;\n }\n\n /**\n * @method compute\n * @public\n * @param params Array a list of arguments passed to the Helper.\n * @param hash Object a list of configuration options passed to the helper.\n * This parameter is currently unused by Await.\n */\n compute([maybePromise]) {\n if (!maybePromise || typeof maybePromise.then !== 'function') {\n return maybePromise;\n }\n return this.ensureLatestPromise(maybePromise, async promise => {\n try {\n const value = await promise;\n this.setValue(value, maybePromise);\n } catch (_error) {\n this.setValue(null, maybePromise);\n }\n });\n }\n\n /**\n * @method ensureLatestPromise\n * @public\n * @param promise Promise the new promise coming\n * @param callback Function function to be called with a wrapped promise\n *\n * Method to set the latest promise. This gets called by `compute` (which in\n * turn gets called by `recompute`). If the promise being passed in is the\n * same as before, then just return the value to `compute`. Otherwise, call\n * the callback so the user can call `then`, `catch`, or `finally` on the\n * promise to update the value using `setValue` later.\n */\n ensureLatestPromise(promise, callback) {\n if (this._wasSettled && promise === this._promise) {\n return this._value;\n } else {\n this._unsettle();\n }\n this._promise = promise;\n callback.call(this, Promise.resolve(promise));\n return this.valueBeforeSettled;\n }\n\n /**\n * @method _settle\n * @private\n */\n _settle(promise) {\n if (this.allowUpdates(promise)) {\n this._wasSettled = true;\n this.recompute();\n }\n }\n\n /**\n * @private\n * @method _unsettle\n *\n * Resets the promise to null and calls recompute. Designed to be used\n * when a new promise is passed to the `compute` method. This would happen\n * when the value changes in Handlebars.\n */\n _unsettle() {\n this._wasSettled = false;\n this._promise = null;\n }\n\n /**\n * @method setValue\n * @public\n * @param value Any the value to return to the helper\n * @param promise Promise the promise the `setValue` call is coming from.\n *\n * `setValue` is how you should set the value to be returned to the helper\n * in the app. It exists to prevent race conditions between promises.\n * For example, you may have two promises:\n *\n * ```javascript\n * let promise1 = new Ember.RSVP.Promise((resolve, reject) => {resolve(\"hello\");});\n * let promise2 = new Ember.RSVP.Promise((resolve, reject) => {(resolve(\"goodbye\")});\n * ```\n *\n * And a template:\n *\n * ```handlebars\n * {{await promise}}\n * ```\n *\n * If you set the value of `promise` to be `promise1` via your component,\n * controller, or route, when the promise resolves, it will render the value\n * of `promise1`, which is \"hello\".\n *\n * If you set the avlue of `promise` to `promise2`, you would see \"goodbye\".\n *\n * But what happens if `promise1` resolves asynchronously, e.g., using `Ember.run.later`?\n *\n * ```javascript\n * Ember.run.later(function() {\n * resolve(\"hello\");\n * }, 200);\n * ```\n *\n * Even though `promise2` already resolved with \"goodbye\", the template would\n * render \"hello\", which is not the intended behavior. So, `setValue` makes you pass\n * the promise so the internal book-keeping can ensure the last-set promise always wins.\n */\n setValue(value, promise) {\n if (this.allowUpdates(promise)) {\n this._value = value;\n this._settle(promise);\n }\n }\n allowUpdates(promise) {\n return this._promise === promise;\n }\n}","import { A } from '@ember/array';\nimport ContainerDebugAdapter from '@ember/debug/container-debug-adapter';\nimport { ModuleRegistry } from './index';\nimport { getOwner } from '@ember/application';\n\nfunction getPod(type, key, prefix) {\n let match = key.match(new RegExp('^/?' + prefix + '/(.+)/' + type + '$'));\n if (match !== null) {\n return match[1];\n }\n}\n\n/*\n * This module defines a subclass of Ember.ContainerDebugAdapter that adds\n * support for resolving from modules.\n *\n */\n\n/* eslint-disable ember/no-classic-classes */\nexport default ContainerDebugAdapter.extend({\n _moduleRegistry: null,\n\n init() {\n this._super(...arguments);\n this.namespace = getOwner(this).lookup('application:main');\n\n if (!this._moduleRegistry) {\n this._moduleRegistry = new ModuleRegistry();\n }\n },\n\n /**\n The container of the application being debugged.\n This property will be injected\n on creation.\n\n @property container\n @default null\n */\n\n /**\n The resolver instance of the application\n being debugged. This property will be injected\n on creation.\n\n @property resolver\n @default null\n */\n\n /**\n Returns true if it is possible to catalog a list of available\n classes in the resolver for a given type.\n\n @method canCatalogEntriesByType\n @param {string} type The type. e.g. \"model\", \"controller\", \"route\"\n @return {boolean} whether a list is available for this type.\n */\n canCatalogEntriesByType(type) {\n if (type === 'model') { return true; }\n return this._super(...arguments);\n },\n\n /**\n Returns the available classes a given type.\n\n @method catalogEntriesByType\n @param {string} type The type. e.g. \"model\", \"controller\", \"route\"\n @return {Array} An array of classes.\n */\n catalogEntriesByType(type) {\n let moduleNames = this._moduleRegistry.moduleNames();\n let types = A();\n\n let prefix = this.namespace.modulePrefix;\n\n for (let i = 0, l = moduleNames.length; i < l; i++) {\n let key = moduleNames[i];\n\n if(key.indexOf(type) !== -1) {\n // Check if it's a pod module\n let name = getPod(type, key, this.namespace.podModulePrefix || prefix);\n if (!name) {\n // Not pod\n name = key.split(type + 's/').pop();\n\n // Support for different prefix (such as ember-cli addons).\n // Uncomment the code below when\n // https://github.com/ember-cli/ember-resolver/pull/80 is merged.\n\n //let match = key.match('^/?(.+)/' + type);\n //if (match && match[1] !== prefix) {\n // Different prefix such as an addon\n //name = match[1] + '@' + name;\n //}\n }\n types.addObject(name);\n }\n }\n return types;\n }\n});\n\n","import ContainerDebugAdapter from 'ember-resolver/resolvers/classic/container-debug-adapter';\n\nexport default {\n name: 'container-debug-adapter',\n\n initialize() {\n let app = arguments[1] || arguments[0];\n\n app.register('container-debug-adapter:main', ContainerDebugAdapter);\n }\n};\n","/* globals requirejs, require */\n\n/* eslint-disable ember/no-classic-classes */\n\nimport Ember from 'ember';\nimport { assert, deprecate, warn } from '@ember/debug';\nimport EmberObject from '@ember/object';\nimport { dasherize, classify, underscore } from '@ember/string';\nimport { DEBUG } from '@glimmer/env';\nimport classFactory from '../../utils/class-factory';\n\nif (typeof requirejs.entries === 'undefined') {\n requirejs.entries = requirejs._eak_seen;\n}\n\nexport class ModuleRegistry {\n constructor(entries) {\n this._entries = entries || requirejs.entries;\n }\n moduleNames() {\n return Object.keys(this._entries);\n }\n has(moduleName) {\n return moduleName in this._entries;\n }\n get(...args) {\n return require(...args);\n }\n}\n\n/**\n * This module defines a subclass of Ember.DefaultResolver that adds two\n * important features:\n *\n * 1) The resolver makes the container aware of es6 modules via the AMD\n * output. The loader's _moduleEntries is consulted so that classes can be\n * resolved directly via the module loader, without needing a manual\n * `import`.\n * 2) is able to provide injections to classes that implement `extend`\n * (as is typical with Ember).\n */\n\nfunction parseName(fullName) {\n if (fullName.parsedName === true) { return fullName; }\n\n let prefix, type, name;\n let fullNameParts = fullName.split('@');\n\n if (fullNameParts.length === 3) {\n if (fullNameParts[0].length === 0) {\n // leading scoped namespace: `@scope/pkg@type:name`\n prefix = `@${fullNameParts[1]}`;\n let prefixParts = fullNameParts[2].split(':');\n type = prefixParts[0];\n name = prefixParts[1];\n } else {\n // interweaved scoped namespace: `type:@scope/pkg@name`\n prefix = `@${fullNameParts[1]}`;\n type = fullNameParts[0].slice(0, -1);\n name = fullNameParts[2];\n }\n\n if (type === 'template:components') {\n name = `components/${name}`;\n type = 'template';\n }\n } else if (fullNameParts.length === 2) {\n let prefixParts = fullNameParts[0].split(':');\n\n if (prefixParts.length === 2) {\n if (prefixParts[1].length === 0) {\n type = prefixParts[0];\n name = `@${fullNameParts[1]}`;\n } else {\n prefix = prefixParts[1];\n type = prefixParts[0];\n name = fullNameParts[1];\n }\n } else {\n let nameParts = fullNameParts[1].split(':');\n\n prefix = fullNameParts[0];\n type = nameParts[0];\n name = nameParts[1];\n }\n\n if (type === 'template' && prefix.lastIndexOf('components/', 0) === 0) {\n name = `components/${name}`;\n prefix = prefix.slice(11);\n }\n } else {\n fullNameParts = fullName.split(':');\n type = fullNameParts[0];\n name = fullNameParts[1];\n }\n\n let fullNameWithoutType = name;\n let namespace = this.namespace;\n let root = namespace;\n\n return {\n parsedName: true,\n fullName: fullName,\n prefix: prefix || this.prefix({type: type}),\n type: type,\n fullNameWithoutType: fullNameWithoutType,\n name: name,\n root: root,\n resolveMethodName: \"resolve\" + classify(type)\n };\n}\n\nfunction resolveOther(parsedName) {\n assert('`modulePrefix` must be defined', this.namespace.modulePrefix);\n\n let normalizedModuleName = this.findModuleName(parsedName);\n\n if (normalizedModuleName) {\n let defaultExport = this._extractDefaultExport(normalizedModuleName, parsedName);\n\n if (defaultExport === undefined) {\n throw new Error(` Expected to find: '${parsedName.fullName}' within '${normalizedModuleName}' but got 'undefined'. Did you forget to 'export default' within '${normalizedModuleName}'?`);\n }\n\n if (this.shouldWrapInClassFactory(defaultExport, parsedName)) {\n defaultExport = classFactory(defaultExport);\n }\n\n return defaultExport;\n }\n}\n\nconst Resolver = EmberObject.extend({\n resolveOther,\n parseName,\n pluralizedTypes: null,\n moduleRegistry: null,\n\n makeToString(factory, fullName) {\n return '' + this.namespace.modulePrefix + '@' + fullName + ':';\n },\n\n shouldWrapInClassFactory(/* module, parsedName */){\n return false;\n },\n\n init() {\n this._super();\n this.moduleBasedResolver = true;\n\n if (!this._moduleRegistry) {\n this._moduleRegistry = new ModuleRegistry();\n }\n\n this._normalizeCache = Object.create(null);\n\n this.pluralizedTypes = this.pluralizedTypes || Object.create(null);\n\n if (!this.pluralizedTypes.config) {\n this.pluralizedTypes.config = 'config';\n }\n this._deprecatedPodModulePrefix = false;\n\n /**\n\n A listing of functions to test for moduleName's based on the provided\n `parsedName`. This allows easy customization of additional module based\n lookup patterns.\n\n @property moduleNameLookupPatterns\n @returns {Ember.Array}\n */\n this.moduleNameLookupPatterns = [\n this.podBasedModuleName,\n this.podBasedComponentsInSubdir,\n this.mainModuleName,\n this.defaultModuleName,\n this.nestedColocationComponentModuleName,\n ];\n },\n\n normalize(fullName) {\n return this._normalizeCache[fullName] || (this._normalizeCache[fullName] = this._normalize(fullName));\n },\n\n resolve(fullName) {\n let parsedName = this.parseName(fullName);\n let resolveMethodName = parsedName.resolveMethodName;\n let resolved;\n\n if (typeof this[resolveMethodName] === 'function') {\n resolved = this[resolveMethodName](parsedName);\n }\n\n if (resolved == null) {\n resolved = this.resolveOther(parsedName);\n }\n\n return resolved;\n },\n\n _normalize(fullName) {\n // A) Convert underscores to dashes\n // B) Convert camelCase to dash-case, except for components (their\n // templates) and helpers where we want to avoid shadowing camelCase\n // expressions\n // C) replace `.` with `/` in order to make nested controllers work in the following cases\n // 1. `needs: ['posts/post']`\n // 2. `{{render \"posts/post\"}}`\n // 3. `this.render('posts/post')` from Route\n\n let split = fullName.split(':');\n if (split.length > 1) {\n let type = split[0];\n\n if (\n type === 'component' ||\n type === 'helper' ||\n type === 'modifier' ||\n (type === 'template' && split[1].indexOf('components/') === 0)\n ) {\n return type + ':' + split[1].replace(/_/g, '-');\n } else {\n return type + ':' + dasherize(split[1].replace(/\\./g, '/'));\n }\n } else {\n return fullName;\n }\n },\n\n pluralize(type) {\n return this.pluralizedTypes[type] || (this.pluralizedTypes[type] = type + 's');\n },\n\n podBasedLookupWithPrefix(podPrefix, parsedName) {\n let fullNameWithoutType = parsedName.fullNameWithoutType;\n\n if (parsedName.type === 'template') {\n fullNameWithoutType = fullNameWithoutType.replace(/^components\\//, '');\n }\n\n return podPrefix + '/' + fullNameWithoutType + '/' + parsedName.type;\n },\n\n podBasedModuleName(parsedName) {\n let podPrefix = this.namespace.podModulePrefix || this.namespace.modulePrefix;\n\n return this.podBasedLookupWithPrefix(podPrefix, parsedName);\n },\n\n podBasedComponentsInSubdir(parsedName) {\n let podPrefix = this.namespace.podModulePrefix || this.namespace.modulePrefix;\n podPrefix = podPrefix + '/components';\n\n if (parsedName.type === 'component' || /^components/.test(parsedName.fullNameWithoutType)) {\n return this.podBasedLookupWithPrefix(podPrefix, parsedName);\n }\n },\n\n resolveEngine(parsedName) {\n let engineName = parsedName.fullNameWithoutType;\n let engineModule = engineName + '/engine';\n\n if (this._moduleRegistry.has(engineModule)) {\n return this._extractDefaultExport(engineModule);\n }\n },\n\n resolveRouteMap(parsedName) {\n let engineName = parsedName.fullNameWithoutType;\n let engineRoutesModule = engineName + '/routes';\n\n if (this._moduleRegistry.has(engineRoutesModule)) {\n let routeMap = this._extractDefaultExport(engineRoutesModule);\n\n assert(`The route map for ${engineName} should be wrapped by 'buildRoutes' before exporting.` , routeMap.isRouteMap);\n\n return routeMap;\n }\n },\n\n resolveTemplate(parsedName) {\n let resolved = this.resolveOther(parsedName);\n if (resolved == null) {\n resolved = Ember.TEMPLATES[parsedName.fullNameWithoutType];\n }\n return resolved;\n },\n\n mainModuleName(parsedName) {\n if (parsedName.fullNameWithoutType === 'main') {\n // if router:main or adapter:main look for a module with just the type first\n return parsedName.prefix + '/' + parsedName.type;\n }\n },\n\n defaultModuleName(parsedName) {\n return parsedName.prefix + '/' + this.pluralize(parsedName.type) + '/' + parsedName.fullNameWithoutType;\n },\n\n nestedColocationComponentModuleName(parsedName) {\n if (parsedName.type === 'component') {\n return parsedName.prefix + '/' + this.pluralize(parsedName.type) + '/' + parsedName.fullNameWithoutType + '/index';\n }\n },\n\n prefix(parsedName) {\n let tmpPrefix = this.namespace.modulePrefix;\n\n if (this.namespace[parsedName.type + 'Prefix']) {\n tmpPrefix = this.namespace[parsedName.type + 'Prefix'];\n }\n\n return tmpPrefix;\n },\n\n findModuleName(parsedName, loggingDisabled){\n let moduleNameLookupPatterns = this.moduleNameLookupPatterns;\n let moduleName;\n\n for (let index = 0, length = moduleNameLookupPatterns.length; index < length; index++) {\n let item = moduleNameLookupPatterns[index];\n\n let tmpModuleName = item.call(this, parsedName);\n\n // allow treat all dashed and all underscored as the same thing\n // supports components with dashes and other stuff with underscores.\n if (tmpModuleName) {\n tmpModuleName = this.chooseModuleName(tmpModuleName, parsedName);\n }\n\n if (tmpModuleName && this._moduleRegistry.has(tmpModuleName)) {\n moduleName = tmpModuleName;\n }\n\n if (!loggingDisabled) {\n this._logLookup(moduleName, parsedName, tmpModuleName);\n }\n\n if (moduleName) {\n return moduleName;\n }\n }\n },\n\n chooseModuleName(moduleName, parsedName) {\n let underscoredModuleName = underscore(moduleName);\n\n if (moduleName !== underscoredModuleName && this._moduleRegistry.has(moduleName) && this._moduleRegistry.has(underscoredModuleName)) {\n throw new TypeError(`Ambiguous module names: '${ moduleName}' and '${underscoredModuleName }'`);\n }\n\n if (this._moduleRegistry.has(moduleName)) {\n return moduleName;\n } else if (this._moduleRegistry.has(underscoredModuleName)) {\n return underscoredModuleName;\n }\n // workaround for dasherized partials:\n // something/something/-something => something/something/_something\n let partializedModuleName = moduleName.replace(/\\/-([^/]*)$/, '/_$1');\n\n if (this._moduleRegistry.has(partializedModuleName)) {\n deprecate('Modules should not contain underscores. ' +\n 'Attempted to lookup \"'+moduleName+'\" which ' +\n 'was not found. Please rename \"'+partializedModuleName+'\" '+\n 'to \"'+moduleName+'\" instead.', false,\n {\n id: 'ember-resolver.underscored-modules',\n until: '3.0.0',\n for: 'ember-resolver',\n since: '0.1.0'\n });\n\n return partializedModuleName;\n }\n\n if (DEBUG) {\n let isCamelCaseHelper = parsedName.type === 'helper' && /[a-z]+[A-Z]+/.test(moduleName);\n if (isCamelCaseHelper) {\n this._camelCaseHelperWarnedNames = this._camelCaseHelperWarnedNames || [];\n let alreadyWarned = this._camelCaseHelperWarnedNames.indexOf(parsedName.fullName) > -1;\n if (!alreadyWarned && this._moduleRegistry.has(dasherize(moduleName))) {\n this._camelCaseHelperWarnedNames.push(parsedName.fullName);\n warn('Attempted to lookup \"' + parsedName.fullName + '\" which ' +\n 'was not found. In previous versions of ember-resolver, a bug would have ' +\n 'caused the module at \"' + dasherize(moduleName) + '\" to be ' +\n 'returned for this camel case helper name. This has been fixed. ' +\n 'Use the dasherized name to resolve the module that would have been ' +\n 'returned in previous versions.',\n false,\n { id: 'ember-resolver.camelcase-helper-names', until: '3.0.0' });\n }\n }\n }\n },\n\n // used by Ember.DefaultResolver.prototype._logLookup\n lookupDescription(fullName) {\n let parsedName = this.parseName(fullName);\n\n let moduleName = this.findModuleName(parsedName, true);\n\n return moduleName;\n },\n\n // only needed until 1.6.0-beta.2 can be required\n _logLookup(found, parsedName, description) {\n if (!Ember.ENV.LOG_MODULE_RESOLVER && !parsedName.root.LOG_RESOLVER) {\n return;\n }\n\n let padding;\n let symbol = found ? '[✓]' : '[ ]';\n\n if (parsedName.fullName.length > 60) {\n padding = '.';\n } else {\n padding = new Array(60 - parsedName.fullName.length).join('.');\n }\n\n if (!description) {\n description = this.lookupDescription(parsedName);\n }\n\n /* eslint-disable no-console */\n if (console && console.info) {\n console.info(symbol, parsedName.fullName, padding, description);\n }\n },\n\n knownForType(type) {\n let moduleKeys = this._moduleRegistry.moduleNames();\n\n let items = Object.create(null);\n for (let index = 0, length = moduleKeys.length; index < length; index++) {\n let moduleName = moduleKeys[index];\n let fullname = this.translateToContainerFullname(type, moduleName);\n\n if (fullname) {\n items[fullname] = true;\n }\n }\n\n return items;\n },\n\n translateToContainerFullname(type, moduleName) {\n let prefix = this.prefix({ type });\n\n // Note: using string manipulation here rather than regexes for better performance.\n // pod modules\n // '^' + prefix + '/(.+)/' + type + '$'\n let podPrefix = prefix + '/';\n let podSuffix = '/' + type;\n let start = moduleName.indexOf(podPrefix);\n let end = moduleName.indexOf(podSuffix);\n\n if (start === 0 && end === (moduleName.length - podSuffix.length) &&\n moduleName.length > (podPrefix.length + podSuffix.length)) {\n return type + ':' + moduleName.slice(start + podPrefix.length, end);\n }\n\n // non-pod modules\n // '^' + prefix + '/' + pluralizedType + '/(.+)$'\n let pluralizedType = this.pluralize(type);\n let nonPodPrefix = prefix + '/' + pluralizedType + '/';\n\n if (moduleName.indexOf(nonPodPrefix) === 0 && moduleName.length > nonPodPrefix.length) {\n return type + ':' + moduleName.slice(nonPodPrefix.length);\n }\n },\n\n _extractDefaultExport(normalizedModuleName) {\n let module = this._moduleRegistry.get(normalizedModuleName, null, null, true /* force sync */);\n\n if (module && module['default']) {\n module = module['default'];\n }\n\n return module;\n }\n});\n\nResolver.reopenClass({\n moduleBasedResolver: true\n});\n\nexport default Resolver;\n","export default function classFactory(klass) {\n return {\n create(injections) {\n if (typeof klass.extend === 'function') {\n return klass.extend(injections);\n } else {\n return klass;\n }\n }\n };\n}\n","export default {\n mobile: '(max-width: 767px)',\n tablet: '(min-width: 768px) and (max-width: 991px)',\n desktop: '(min-width: 992px) and (max-width: 1200px)',\n jumbo: '(min-width: 1201px)'\n};\n","import Helper from '@ember/component/helper';\nimport { inject as service } from '@ember/service';\nimport { get } from '@ember/object';\n\nexport default class MediaHelper extends Helper {\n @service() media;\n\n constructor() {\n super(...arguments);\n\n this.media.on('mediaChanged', () => {\n this.recompute();\n });\n }\n\n compute([prop]) {\n return get(this, `media.${prop}`);\n }\n}\n","/**\n * Ember responsive initializer\n *\n * Supports auto injecting media service app-wide.\n * Generated by the ember-responsive addon.\n */\nexport function initialize(application) {\n application.registerOptionsForType('breakpoints', { instantiate: false });\n}\n\nexport default {\n name: 'ember-responsive-breakpoints',\n initialize\n};\n","import ResponsiveInitializer from 'ember-responsive/initializers/responsive';\nexport default ResponsiveInitializer;\n","/**\n * Stub function that is `matchMedia` API compatible but always returns\n * `false`. Useful for server-side environments like FastBoot where there\n * is no viewport.\n */\nexport default function() {\n return {\n matches: false\n };\n}\n","import Media from 'ember-responsive/services/media';\nexport default Media;\n","import Ember from 'ember';\nimport { tracked } from '@glimmer/tracking'\nimport { run, once } from '@ember/runloop';\nimport { set, defineProperty } from '@ember/object';\nimport Service from '@ember/service';\nimport { classify, dasherize } from '@ember/string';\nimport nullMatchMedia from '../null-match-media';\nimport { getOwner } from '@ember/application'\nimport Evented from '@ember/object/evented';\nimport { dependentKeyCompat } from '@ember/object/compat';\n\n/**\n* Handles detecting and responding to media queries.\n*\n* **Adding media query matchers**\n*\n* The first step to using the class is to add media queries that you\n* want it to listen to. Each media query has a name that you can\n* use to reference it by.\n*\n* ```javascript\n* media = Ember.Responsive.Media.create();\n* media.match('mobile', '(max-width: 767px)');\n* media.match('desktop', '(min-width: 768px)');\n* ```\n*\n* **Testing the media query matchers**\n*\n* Now that you've added a few matchers, you can access those media queries as\n* if they were properties on your object. The nice thing is that whenever the\n* media queries change, this class will automatically update the relevant\n* properties (and so will the rest of your application, thanks to the power\n* of two-way data-binding).\n*\n* ```javascript\n* media = Ember.Responsive.Media.create();\n* media.match('mobile', '(max-width: 767px)');\n* media.match('desktop', '(min-width: 768px)');\n*\n* // There are convenient \"isser\" properties defined...\n* if (media.get('isMobile')) {\n* console.log('mobile!');\n* }\n*\n* // As well as access to the matchMedia API...\n* if (media.get('desktop.matches')) {\n* console.log('desktop!');\n* }\n* ```\n*\n* **Retrieving a list of matching media queries**\n*\n* It's also nice to be able to see which media queries are matching, since\n* some applications might have many matches at the same time.\n*\n* ```javascript\n* media = Ember.Responsive.Media.create();\n* media.match('desktop', 'all');\n* media.match('mobile', 'all');\n*\n* console.log(media.matches);\n* // => Ember.Set(['desktop', 'mobile']);\n* ```\n*\n* This class can also return that list as a string of dasherized class names,\n* which is useful for placing on your app's rootElement. By default, these\n* class names are prefixed with `media-`, so as not to clash with any other\n* classes your app might use.\n*\n* ```javascript\n* App.ApplicationView = Ember.View.extend({\n* classNameBindings: ['media.classNames']\n* });\n* ```\n*\n* @module ember-responsive\n* @namespace Ember.Responsive\n* @class Media\n* @extends Ember.Object\n*/\nexport default class MediaService extends Service.extend(Evented) {\n // Ember only sets Ember.testing when tests are starting\n // eslint-disable-next-line ember/no-ember-testing-in-module-scope\n _mocked = Ember.testing;\n _mockedBreakpoint = 'desktop';\n\n /**\n * @property _matches\n * @type Array\n */\n @tracked _matches;\n\n /**\n * A set of matching matchers.\n *\n * @property matches\n * @type Array\n */\n get matches() {\n if (this._matches) {\n return this._matches\n }\n\n return (Ember.testing && this._mocked) ? [this._mockedBreakpoint] : [];\n }\n\n set matches(value) {\n this._matches = value;\n }\n\n /**\n * A hash of listeners indexed by their matcher's names\n *\n * @property\n * @type Object\n */\n listeners = {};\n\n /**\n * A hash of matchers by breakpoint name\n */\n matchers = {};\n\n /**\n * The matcher to use for testing media queries.\n *\n * @property matcher\n * @type matchMedia\n * @default window.matchMedia\n * @private\n */\n mql = detectMatchMedia();\n\n /**\n * Initialize the service based on the breakpoints config\n *\n * @method init\n *\n */\n constructor() {\n super(...arguments);\n\n const breakpoints = getOwner(this).lookup('breakpoints:main');\n if (breakpoints) {\n Object.keys(breakpoints).forEach((name) => {\n const cpName = `is${classify(name)}`;\n defineProperty(\n this,\n cpName,\n dependentKeyCompat({\n get() {\n return this.matches.indexOf(name) > -1;\n },\n })\n );\n\n defineProperty(\n this,\n name,\n dependentKeyCompat({\n get() {\n return this[cpName];\n },\n })\n );\n\n this.match(name, breakpoints[name]);\n });\n }\n }\n\n /**\n * A string composed of all the matching matchers' names, turned into\n * friendly, dasherized class-names that are prefixed with `media-`.\n *\n * @property classNames\n * @type string\n */\n get classNames() {\n return this.matches.map(function(name) {\n return `media-${dasherize(name)}`;\n }).join(' ');\n }\n\n _triggerMediaChanged() {\n this.trigger('mediaChanged', {});\n }\n\n _triggerEvent() {\n once(this, this._triggerMediaChanged);\n }\n\n /**\n * Adds a new matcher to the list.\n *\n * After this method is called, you will be able to access the result\n * of the matcher as a property on this object.\n *\n * **Adding a new matcher**\n *\n * ```javascript\n * media = Ember.Responsive.Media.create();\n * media.match('all', 'all');\n * media.get('all');\n * // => instanceof window.matchMedia\n * media.get('all.matches');\n * // => true\n * ```\n *\n * @param string name The name of the matcher\n * @param string query The media query to match against\n * @method match\n */\n match(name, query) {\n // see https://github.com/ember-cli/eslint-plugin-ember/pull/272\n if (Ember.testing && this._mocked) {\n return;\n }\n\n const mql = this.mql;\n const matcher = mql(query);\n\n const listener = (matcher) => {\n if (this.isDestroyed) {\n return;\n }\n\n set(this, `matchers.${name}`, matcher);\n\n if (matcher.matches) {\n this.matches = Array.from(new Set([...this.matches, name]));\n } else {\n this.matches = Array.from(new Set(this.matches.filter(key => key !== name)));\n }\n\n this._triggerEvent();\n };\n this.listeners[name] = listener;\n\n if (matcher.addListener) {\n matcher.addListener(function(matcher){\n run(null, listener, matcher);\n });\n }\n listener(matcher);\n }\n}\n\nfunction detectMatchMedia() {\n if (typeof window === 'object' && window.matchMedia) {\n return window.matchMedia;\n }\n\n return nullMatchMedia;\n}\n","import { assign } from '@ember/polyfills';\n\nexport default Object.assign || assign;\n","import Ember from 'ember';\nimport RSVP from 'rsvp';\nimport { isEmpty, isNone } from '@ember/utils';\nimport ObjectProxy from '@ember/object/proxy';\nimport Evented from '@ember/object/evented';\nimport assign from 'ember-simple-auth/utils/assign';\nimport { set } from '@ember/object';\nimport { debug, assert } from '@ember/debug';\nimport { getOwner, setOwner } from '@ember/application';\n\nexport default ObjectProxy.extend(Evented, {\n authenticator: null,\n store: null,\n isAuthenticated: false,\n attemptedTransition: null,\n\n init() {\n this._super(...arguments);\n this.set('content', { authenticated: {} });\n let storeFactory = 'session-store:application';\n if (Ember.testing) {\n storeFactory = 'session-store:test';\n }\n\n this.set('store', getOwner(this).lookup(storeFactory));\n this._busy = false;\n this._bindToStoreEvents();\n },\n\n authenticate(authenticatorFactory, ...args) {\n this._busy = true;\n assert(`Session#authenticate requires the authenticator to be specified, was \"${authenticatorFactory}\"!`, !isEmpty(authenticatorFactory));\n const authenticator = this._lookupAuthenticator(authenticatorFactory);\n\n return authenticator.authenticate(...args).then((content) => {\n this._busy = false;\n return this._setup(authenticatorFactory, content, true);\n }, (error) => {\n const rejectWithError = () => RSVP.Promise.reject(error);\n\n this._busy = false;\n return this._clear().then(rejectWithError, rejectWithError);\n });\n },\n\n invalidate() {\n this._busy = true;\n this.set('attemptedTransition', null);\n\n if (!this.get('isAuthenticated')) {\n this._busy = false;\n return RSVP.Promise.resolve();\n }\n\n let authenticator = this._lookupAuthenticator(this.authenticator);\n return authenticator.invalidate(this.content.authenticated, ...arguments).then(() => {\n authenticator.off('sessionDataUpdated', this, this._onSessionDataUpdated);\n this._busy = false;\n return this._clear(true);\n }, (error) => {\n this.trigger('sessionInvalidationFailed', error);\n this._busy = false;\n return RSVP.Promise.reject(error);\n });\n },\n\n restore() {\n this._busy = true;\n const reject = () => RSVP.Promise.reject();\n\n return this.store.restore().then((restoredContent) => {\n let { authenticator: authenticatorFactory } = restoredContent.authenticated || {};\n if (authenticatorFactory) {\n delete restoredContent.authenticated.authenticator;\n const authenticator = this._lookupAuthenticator(authenticatorFactory);\n return authenticator.restore(restoredContent.authenticated).then((content) => {\n this.set('content', restoredContent);\n this._busy = false;\n return this._setup(authenticatorFactory, content);\n }, (err) => {\n debug(`The authenticator \"${authenticatorFactory}\" rejected to restore the session - invalidating…`);\n if (err) {\n debug(err);\n }\n this._busy = false;\n return this._clearWithContent(restoredContent).then(reject, reject);\n });\n } else {\n delete (restoredContent || {}).authenticated;\n this._busy = false;\n return this._clearWithContent(restoredContent).then(reject, reject);\n }\n }, () => {\n this._busy = false;\n return this._clear().then(reject, reject);\n });\n },\n\n _setup(authenticator, authenticatedContent, trigger) {\n trigger = Boolean(trigger) && !this.get('isAuthenticated');\n this.setProperties({\n isAuthenticated: true,\n authenticator,\n 'content.authenticated': authenticatedContent\n });\n this._bindToAuthenticatorEvents();\n\n return this._updateStore()\n .then(() => {\n if (trigger) {\n this.trigger('authenticationSucceeded');\n }\n }, () => {\n this.setProperties({\n isAuthenticated: false,\n authenticator: null,\n 'content.authenticated': {}\n });\n });\n },\n\n _clear(trigger) {\n trigger = Boolean(trigger) && this.get('isAuthenticated');\n this.setProperties({\n isAuthenticated: false,\n authenticator: null,\n 'content.authenticated': {}\n });\n\n return this._updateStore().then(() => {\n if (trigger) {\n this.trigger('invalidationSucceeded');\n }\n });\n },\n\n _clearWithContent(content, trigger) {\n this.set('content', content);\n return this._clear(trigger);\n },\n\n setUnknownProperty(key, value) {\n assert('\"authenticated\" is a reserved key used by Ember Simple Auth!', key !== 'authenticated');\n let result = this._super(key, value);\n if (!(/^_/).test(key)) {\n this._updateStore();\n }\n return result;\n },\n\n _updateStore() {\n let data = this.content;\n if (!isEmpty(this.authenticator)) {\n set(data, 'authenticated', assign({ authenticator: this.authenticator }, data.authenticated || {}));\n }\n return this.store.persist(data);\n },\n\n _bindToAuthenticatorEvents() {\n const authenticator = this._lookupAuthenticator(this.authenticator);\n authenticator.on('sessionDataUpdated', this, this._onSessionDataUpdated);\n authenticator.on('sessionDataInvalidated', this, this._onSessionDataInvalidated);\n },\n\n _onSessionDataUpdated(content) {\n this._setup(this.authenticator, content);\n },\n\n _onSessionDataInvalidated() {\n this._clear(true);\n },\n\n _bindToStoreEvents() {\n this.store.on('sessionDataUpdated', (content) => {\n if (!this._busy) {\n this._busy = true;\n let { authenticator: authenticatorFactory } = (content.authenticated || {});\n if (authenticatorFactory) {\n delete content.authenticated.authenticator;\n const authenticator = this._lookupAuthenticator(authenticatorFactory);\n authenticator.restore(content.authenticated).then((authenticatedContent) => {\n this.set('content', content);\n this._busy = false;\n this._setup(authenticatorFactory, authenticatedContent, true);\n }, (err) => {\n debug(`The authenticator \"${authenticatorFactory}\" rejected to restore the session - invalidating…`);\n if (err) {\n debug(err);\n }\n this._busy = false;\n this._clearWithContent(content, true);\n });\n } else {\n this._busy = false;\n this._clearWithContent(content, true);\n }\n }\n });\n },\n\n _lookupAuthenticator(authenticatorName) {\n let owner = getOwner(this);\n let authenticator = owner.lookup(authenticatorName);\n assert(`No authenticator for factory \"${authenticatorName}\" could be found!`, !isNone(authenticator));\n setOwner(authenticator, owner);\n return authenticator;\n }\n});\n","import RSVP from 'rsvp';\nimport BaseStore from './base';\n\n/**\n Session store that __persists data in memory and thus is not actually\n persistent__. It does also not synchronize the session's state across\n multiple tabs or windows as those cannot share memory. __This store is mainly\n useful for testing and will automatically be used when running tests.__\n\n @class EphemeralStore\n @module ember-simple-auth/session-stores/ephemeral\n @extends BaseStore\n @public\n*/\nexport default BaseStore.extend({\n init() {\n this._super(...arguments);\n this.clear();\n },\n\n /**\n Persists `data`. This replaces all currently stored data.\n\n @method persist\n @param {Object} data The data to persist\n @return {Ember.RSVP.Promise} A promise that resolves when the data has successfully been persisted and rejects otherwise.\n @public\n */\n persist(data) {\n this._data = JSON.stringify(data || {});\n\n return RSVP.resolve();\n },\n\n /**\n Returns all data currently stored as a plain object.\n\n @method restore\n @return {Ember.RSVP.Promise} A promise that resolves with the data currently persisted in the store when the data has been restored successfully and rejects otherwise.\n @public\n */\n restore() {\n const data = JSON.parse(this._data) || {};\n\n return RSVP.resolve(data);\n },\n\n /**\n Clears the store.\n\n @method clear\n @return {Ember.RSVP.Promise} A promise that resolves when the store has been cleared successfully and rejects otherwise.\n @public\n */\n clear() {\n delete this._data;\n this._data = '{}';\n\n return RSVP.resolve();\n }\n});\n","import { computed } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { getOwner } from '@ember/application';\nimport Base from 'ember-simple-auth/session-stores/base';\n\nconst LOCAL_STORAGE_TEST_KEY = '_ember_simple_auth_test_key';\n\nconst proxyToInternalStore = function() {\n return computed({\n get(key) {\n return this.get(`_${key}`);\n },\n set(key, value) {\n this.set(`_${key}`, value);\n let _store = this.get('_store');\n if (_store) {\n _store.set(key, value);\n }\n return value;\n }\n });\n};\n\n/**\n Session store that persists data in the browser's `localStorage` (see\n {{#crossLink \"LocalStorageStore\"}}{{/crossLink}}) if that is available or in\n a cookie (see {{#crossLink \"CookieStore\"}}{{/crossLink}}) if it is not.\n\n __This is the default store that Ember Simple Auth will use when the\n application doesn't define a custom store.__\n\n __This session store does not work with FastBoot. In order to use Ember\n Simple Auth with FastBoot, configure the\n {{#crossLink \"CookieStore\"}}{{/crossLink}} as the application's session\n store.__\n\n @class AdaptiveStore\n @module ember-simple-auth/session-stores/adaptive\n @extends BaseStore\n @public\n*/\nexport default Base.extend({\n /**\n The `localStorage` key the store persists data in if `localStorage` is\n available.\n\n @property localStorageKey\n @type String\n @default 'ember_simple_auth-session'\n @public\n */\n localStorageKey: 'ember_simple_auth-session',\n\n /**\n The domain to use for the cookie if `localStorage` is not available, e.g.,\n \"example.com\", \".example.com\" (which includes all subdomains) or\n \"subdomain.example.com\". If not explicitly set, the cookie domain defaults\n to the domain the session was authenticated on.\n\n @property cookieDomain\n @type String\n @default null\n @public\n */\n _cookieDomain: null,\n cookieDomain: proxyToInternalStore(),\n\n /**\n The name of the cookie to use if `localStorage` is not available.\n\n @property cookieName\n @type String\n @default ember_simple_auth-session\n @public\n */\n _cookieName: 'ember_simple_auth-session',\n cookieName: proxyToInternalStore(),\n\n /**\n The path to use for the cookie, e.g., \"/\", \"/something\".\n\n @property cookiePath\n @type String\n @default '/'\n @public\n */\n _cookiePath: '/',\n cookiePath: proxyToInternalStore(),\n\n /**\n The expiration time for the cookie in seconds if `localStorage` is not\n available. A value of `null` will make the cookie a session cookie that\n expires and gets deleted when the browser is closed.\n\n @property cookieExpirationTime\n @default null\n @type Integer\n @public\n */\n _cookieExpirationTime: null,\n cookieExpirationTime: proxyToInternalStore(),\n\n _sameSite: null,\n sameSite: proxyToInternalStore(),\n\n _cookies: service('cookies'),\n\n _isLocalStorageAvailable: computed({\n get() {\n return testLocalStorageAvailable();\n },\n\n set(key, value) {\n return value;\n }\n }),\n\n init() {\n this._super(...arguments);\n\n let owner = getOwner(this);\n if (owner && !this.hasOwnProperty('_fastboot')) {\n this._fastboot = owner.lookup('service:fastboot');\n }\n\n let store;\n if (this.get('_isLocalStorageAvailable')) {\n const localStorage = owner.lookup('session-store:local-storage');\n const options = { key: this.get('localStorageKey') };\n\n options._isFastBoot = false;\n localStorage.setProperties(options);\n\n store = localStorage;\n } else {\n const cookieStorage = owner.lookup('session-store:cookie');\n const options = this.getProperties('sameSite', 'cookieDomain', 'cookieName', 'cookieExpirationTime', 'cookiePath');\n\n cookieStorage.setProperties(options);\n this.set('cookieExpirationTime', cookieStorage.get('cookieExpirationTime'));\n\n store = cookieStorage;\n }\n\n this.set('_store', store);\n this._setupStoreEvents(store);\n },\n\n _setupStoreEvents(store) {\n store.on('sessionDataUpdated', (data) => {\n this.trigger('sessionDataUpdated', data);\n });\n return store;\n },\n\n /**\n Persists the `data` in the `localStorage` if it is available or in a cookie\n if it is not.\n\n @method persist\n @param {Object} data The data to persist\n @return {Ember.RSVP.Promise} A promise that resolves when the data has successfully been persisted and rejects otherwise.\n @public\n */\n persist() {\n return this.get('_store').persist(...arguments);\n },\n\n /**\n Returns all data currently stored in the `localStorage` if that is\n available - or if it is not, in the cookie - as a plain object.\n\n @method restore\n @return {Ember.RSVP.Promise} A promise that resolves with the data currently persisted in the store when the data has been restored successfully and rejects otherwise.\n @public\n */\n restore() {\n return this.get('_store').restore();\n },\n\n /**\n Clears the store by deleting the\n {{#crossLink \"LocalStorageStore/key:property\"}}{{/crossLink}} from\n `localStorage` if that is available or by deleting the cookie if it is not.\n\n @method clear\n @return {Ember.RSVP.Promise} A promise that resolves when the store has been cleared successfully and rejects otherwise.\n @public\n */\n clear() {\n return this.get('_store').clear();\n }\n});\n\nfunction testLocalStorageAvailable() {\n try {\n localStorage.setItem(LOCAL_STORAGE_TEST_KEY, true);\n localStorage.removeItem(LOCAL_STORAGE_TEST_KEY);\n return true;\n } catch (e) {\n return false;\n }\n}\n","import RSVP from 'rsvp';\n\nimport { bind } from '@ember/runloop';\nimport { getOwner } from '@ember/application';\nimport BaseStore from './base';\nimport objectsAreEqual from '../utils/objects-are-equal';\nimport isFastBoot from 'ember-simple-auth/utils/is-fastboot';\n\n/**\n Session store that persists data in the browser's `localStorage`.\n\n __`localStorage` is not available in Safari when running in private mode. In\n general it is better to use the\n {{#crossLink \"AdaptiveStore\"}}{{/crossLink}} that automatically falls back to\n the {{#crossLink \"CookieStore\"}}{{/crossLink}} when `localStorage` is not\n available.__\n\n __This session store does not work with FastBoot. In order to use Ember\n Simple Auth with FastBoot, configure the\n {{#crossLink \"CookieStore\"}}{{/crossLink}} as the application's session\n store.__\n\n @class LocalStorageStore\n @module ember-simple-auth/session-stores/local-storage\n @extends BaseStore\n @public\n*/\nexport default BaseStore.extend({\n /**\n The `localStorage` key the store persists data in.\n\n @property key\n @type String\n @default 'ember_simple_auth-session'\n @public\n */\n key: 'ember_simple_auth-session',\n\n init() {\n this._super(...arguments);\n\n this._isFastBoot = this.hasOwnProperty('_isFastBoot') ? this._isFastBoot : isFastBoot(getOwner(this));\n this._boundHandler = bind(this, this._handleStorageEvent);\n if (!this.get('_isFastBoot')) {\n window.addEventListener('storage', this._boundHandler);\n }\n },\n\n willDestroy() {\n if (!this.get('_isFastBoot')) {\n window.removeEventListener('storage', this._boundHandler);\n }\n },\n\n /**\n Persists the `data` in the `localStorage`.\n\n @method persist\n @param {Object} data The data to persist\n @return {Ember.RSVP.Promise} A promise that resolves when the data has successfully been persisted and rejects otherwise.\n @public\n */\n persist(data) {\n this._lastData = data;\n data = JSON.stringify(data || {});\n localStorage.setItem(this.key, data);\n\n return RSVP.resolve();\n },\n\n /**\n Returns all data currently stored in the `localStorage` as a plain object.\n\n @method restore\n @return {Ember.RSVP.Promise} A promise that resolves with the data currently persisted in the store when the data has been restored successfully and rejects otherwise.\n @public\n */\n restore() {\n let data = localStorage.getItem(this.key);\n\n return RSVP.resolve(JSON.parse(data) || {});\n },\n\n /**\n Clears the store by deleting the\n {{#crossLink \"LocalStorageStore/key:property\"}}{{/crossLink}} from\n `localStorage`.\n\n @method clear\n @return {Ember.RSVP.Promise} A promise that resolves when the store has been cleared successfully and rejects otherwise.\n @public\n */\n clear() {\n localStorage.removeItem(this.key);\n this._lastData = {};\n\n return RSVP.resolve();\n },\n\n _handleStorageEvent(e) {\n if (e.key === this.get('key')) {\n this.restore().then((data) => {\n if (!objectsAreEqual(data, this._lastData)) {\n this._lastData = data;\n this.trigger('sessionDataUpdated', data);\n }\n });\n }\n }\n});\n","import ENV from '../config/environment';\nimport Configuration from 'ember-simple-auth/configuration';\nimport setupSession from 'ember-simple-auth/initializers/setup-session';\nimport setupSessionRestoration from 'ember-simple-auth/initializers/setup-session-restoration';\nimport Adaptive from 'ember-simple-auth/session-stores/adaptive';\nimport LocalStorage from 'ember-simple-auth/session-stores/local-storage';\nimport Cookie from 'ember-simple-auth/session-stores/cookie';\n\nexport default {\n name: 'ember-simple-auth',\n\n initialize(registry) {\n const config = ENV['ember-simple-auth'] || {};\n config.rootURL = ENV.rootURL || ENV.baseURL;\n Configuration.load(config);\n\n registry.register('session-store:adaptive', Adaptive);\n registry.register('session-store:cookie', Cookie);\n registry.register('session-store:local-storage', LocalStorage);\n\n setupSession(registry);\n setupSessionRestoration(registry);\n }\n};\n","import Ember from 'ember';\nimport InternalSession from '../internal-session';\nimport Ephemeral from '../session-stores/ephemeral';\n\nexport default function setupSession(registry) {\n registry.register('session:main', InternalSession);\n\n if (Ember.testing) {\n registry.register('session-store:test', Ephemeral);\n }\n}\n","import { getOwner } from '@ember/application';\nimport Configuration from '../configuration';\nimport { deprecate } from '@ember/debug';\n\nexport default function setupSessionRestoration(registry) {\n if (Configuration.useSessionSetupMethod) {\n // return early in case users chose to opt out of initializer behavior.\n return;\n }\n\n deprecate('Ember Simple Auth: The automatic session initialization is deprecated. Please inject session service in your application route and call the setup method manually.', false, {\n id: 'ember-simple-auth.initializer.setup-session-restoration',\n until: '5.0.0',\n for: 'ember-simple-auth',\n since: {\n enabled: '4.1.0'\n }\n });\n\n const ApplicationRoute = registry.resolveRegistration\n ? registry.resolveRegistration('route:application')\n : registry.resolve('route:application');\n\n ApplicationRoute.reopen({\n init() {\n this._super(...arguments);\n\n const originalBeforeModel = this.beforeModel;\n this.beforeModel = function() {\n if (!this.__usesApplicationRouteMixn__) {\n const sessionService = getOwner(this).lookup('service:session');\n sessionService._setupHandlers();\n }\n\n const session = getOwner(this).lookup('session:main');\n return session.restore().then(\n () => originalBeforeModel.apply(this, arguments),\n () => originalBeforeModel.apply(this, arguments)\n );\n };\n },\n });\n}\n","// This is only needed for backwards compatibility and will be removed in the\n// next major release of ember-simple-auth. Unfortunately, there is no way to\n// deprecate this without hooking into Ember's internals…\nexport default {\n name: 'ember-simple-auth',\n\n initialize() {}\n};\n","import SessionService from 'ember-simple-auth/services/session';\n\nexport default SessionService;\n","export default true;","import useSessionSetupMethod from 'ember-simple-auth/use-session-setup-method';\n\nconst DEFAULTS = {\n rootURL: '',\n routeAfterAuthentication: 'index',\n};\n\n/**\n Ember Simple Auth's configuration object.\n\n @class Configuration\n @extends Object\n @module ember-simple-auth/configuration\n @public\n*/\nexport default {\n /**\n The root URL of the application as configured in `config/environment.js`.\n\n @property rootURL\n @readOnly\n @static\n @type String\n @default ''\n @public\n */\n rootURL: DEFAULTS.rootURL,\n\n /**\n The route to transition to after successful authentication.\n\n @property routeAfterAuthentication\n @readOnly\n @static\n @type String\n @default 'index'\n @public\n */\n routeAfterAuthentication: DEFAULTS.routeAfterAuthentication,\n\n /**\n Flag used to determine whether users have decided to setup session service themselves.\n This lets us to return early from initializer which would setup the service automatically.\n\n This will be the default behavior in the future.\n\n @property useSessionSetupMethod\n @default false\n @private\n */\n useSessionSetupMethod,\n\n load(config) {\n this.rootURL = config.rootURL !== undefined ? config.rootURL : DEFAULTS.rootURL;\n this.routeAfterAuthentication =\n config.routeAfterAuthentication !== undefined\n ? config.routeAfterAuthentication\n : DEFAULTS.routeAfterAuthentication;\n },\n};\n","import { alias, readOnly } from '@ember/object/computed';\nimport { A } from '@ember/array';\nimport Service from '@ember/service';\nimport Evented from '@ember/object/evented';\nimport { getOwner } from '@ember/application';\nimport { assert, deprecate } from '@ember/debug';\nimport Configuration from '../configuration';\n\nimport {\n requireAuthentication,\n triggerAuthentication,\n prohibitAuthentication,\n handleSessionAuthenticated,\n handleSessionInvalidated\n} from '../-internals/routing';\n\nconst SESSION_DATA_KEY_PREFIX = /^data\\./;\n\nlet enableEventsDeprecation = true;\nfunction deprecateSessionEvents() {\n if (enableEventsDeprecation) {\n deprecate(\"Ember Simple Auth: The session service's events API is deprecated; to add custom behavior to the authentication or invalidation handling, override the handleAuthentication or handleInvalidation methods.\", false, {\n id: 'ember-simple-auth.events.session-service',\n until: '4.0.0',\n for: 'ember-simple-auth',\n since: {\n enabled: '3.1.0'\n }\n });\n }\n}\n\nfunction assertSetupHasBeenCalled(isSetupCalled) {\n if (!isSetupCalled && Configuration.useSessionSetupMethod) {\n assert(\"Ember Simple Auth: session#setup wasn't called. Make sure to call session#setup in your application route's beforeModel hook.\", false);\n }\n}\n\n/**\n __The session service provides access to the current session as well as\n methods to authenticate it, invalidate it, etc.__ It is the main interface for\n the application to Ember Simple Auth's functionality. It can be injected via\n\n ```js\n // app/components/login-form.js\n import Component from '@ember/component';\n import { inject as service } from '@ember/service';\n\n export default class LoginFormComponent extends Component {\n @service session;\n }\n ```\n\n @class SessionService\n @module ember-simple-auth/services/session\n @extends Ember.Service\n @uses Ember.Evented\n @public\n*/\nexport default Service.extend(Evented, {\n /**\n Triggered whenever the session is successfully authenticated. This happens\n when the session gets authenticated via\n {{#crossLink \"SessionService/authenticate:method\"}}{{/crossLink}} but also\n when the session is authenticated in another tab or window of the same\n application and the session state gets synchronized across tabs or windows\n via the store (see\n {{#crossLink \"BaseStore/sessionDataUpdated:event\"}}{{/crossLink}}).\n\n When using the {{#crossLink \"ApplicationRouteMixin\"}}{{/crossLink}} this\n event will automatically get handled (see\n {{#crossLink \"ApplicationRouteMixin/sessionAuthenticated:method\"}}{{/crossLink}}).\n\n @event authenticationSucceeded\n @public\n */\n\n /**\n Triggered whenever the session is successfully invalidated. This happens\n when the session gets invalidated via\n {{#crossLink \"SessionService/invalidate:method\"}}{{/crossLink}} but also\n when the session is invalidated in another tab or window of the same\n application and the session state gets synchronized across tabs or windows\n via the store (see\n {{#crossLink \"BaseStore/sessionDataUpdated:event\"}}{{/crossLink}}).\n\n When using the {{#crossLink \"ApplicationRouteMixin\"}}{{/crossLink}} this\n event will automatically get handled (see\n {{#crossLink \"ApplicationRouteMixin/sessionInvalidated:method\"}}{{/crossLink}}).\n\n @event invalidationSucceeded\n @public\n */\n\n /**\n Returns whether the session is currently authenticated.\n\n @property isAuthenticated\n @type Boolean\n @readOnly\n @default false\n @public\n */\n isAuthenticated: readOnly('session.isAuthenticated'),\n\n /**\n The current session data as a plain object. The\n `authenticated` key holds the session data that the authenticator resolved\n with when the session was authenticated (see\n {{#crossLink \"BaseAuthenticator/authenticate:method\"}}{{/crossLink}}) and\n that will be cleared when the session is invalidated. This data cannot be\n written. All other session data is writable and will not be cleared when\n the session is invalidated.\n\n @property data\n @type Object\n @readOnly\n @default { authenticated: {} }\n @public\n */\n data: readOnly('session.content'),\n\n /**\n The session store.\n\n @property store\n @type BaseStore\n @readOnly\n @default null\n @public\n */\n store: readOnly('session.store'),\n\n /**\n A previously attempted but intercepted transition (e.g. by the\n {{#crossLink \"AuthenticatedRouteMixin\"}}{{/crossLink}}). If an attempted\n transition is present, the\n {{#crossLink \"ApplicationRouteMixin\"}}{{/crossLink}} will retry it when the\n session becomes authenticated (see\n {{#crossLink \"ApplicationRouteMixin/sessionAuthenticated:method\"}}{{/crossLink}}).\n\n @property attemptedTransition\n @type Transition\n @default null\n @public\n */\n attemptedTransition: alias('session.attemptedTransition'),\n\n session: null,\n\n init() {\n this._super(...arguments);\n this.set('session', getOwner(this).lookup('session:main'));\n this._forwardSessionEvents();\n },\n\n set(key, value) {\n const setsSessionData = SESSION_DATA_KEY_PREFIX.test(key);\n if (setsSessionData) {\n const sessionDataKey = `session.${key.replace(SESSION_DATA_KEY_PREFIX, '')}`;\n return this._super(sessionDataKey, value);\n } else {\n return this._super(...arguments);\n }\n },\n\n _forwardSessionEvents() {\n A([\n 'authenticationSucceeded',\n 'invalidationSucceeded'\n ]).forEach((event) => {\n const session = this.get('session');\n // the internal session won't be available in route unit tests\n if (session) {\n session.on(event, () => {\n enableEventsDeprecation = false;\n this.trigger(event, ...arguments);\n enableEventsDeprecation = true;\n });\n }\n });\n },\n\n on() {\n deprecateSessionEvents();\n\n return this._super(...arguments);\n },\n\n one() {\n deprecateSessionEvents();\n\n return this._super(...arguments);\n },\n\n off() {\n deprecateSessionEvents();\n\n return this._super(...arguments);\n },\n\n has() {\n deprecateSessionEvents();\n\n return this._super(...arguments);\n },\n\n trigger() {\n deprecateSessionEvents();\n\n return this._super(...arguments);\n },\n\n _setupHandlers() {\n this.get('session').on('authenticationSucceeded', () => this.handleAuthentication(Configuration.routeAfterAuthentication));\n this.get('session').on('invalidationSucceeded', () => this.handleInvalidation(Configuration.rootURL));\n },\n\n /**\n __Authenticates the session with an `authenticator`__ and appropriate\n arguments. The authenticator implements the actual steps necessary to\n authenticate the session (see\n {{#crossLink \"BaseAuthenticator/authenticate:method\"}}{{/crossLink}}) and\n returns a promise after doing so. The session handles the returned promise\n and when it resolves becomes authenticated, otherwise remains\n unauthenticated. All data the authenticator resolves with will be\n accessible via the\n {{#crossLink \"SessionService/data:property\"}}session data's{{/crossLink}}\n `authenticated` property.\n\n __This method returns a promise. A resolving promise indicates that the\n session was successfully authenticated__ while a rejecting promise\n indicates that authentication failed and the session remains\n unauthenticated. The promise does not resolve with a value; instead, the\n data returned from the authenticator is available via the\n {{#crossLink \"SessionService/data:property\"}}{{/crossLink}} property.\n\n When authentication succeeds this will trigger the\n {{#crossLink \"SessionService/authenticationSucceeded:event\"}}{{/crossLink}}\n event.\n\n @method authenticate\n @param {String} authenticator The authenticator to use to authenticate the session\n @param {Any} [...args] The arguments to pass to the authenticator; depending on the type of authenticator these might be a set of credentials, a Facebook OAuth Token, etc.\n @return {Ember.RSVP.Promise} A promise that resolves when the session was authenticated successfully and rejects otherwise\n @public\n */\n authenticate() {\n const session = this.get('session');\n\n return session.authenticate(...arguments);\n },\n\n /**\n __Invalidates the session with the authenticator it is currently\n authenticated with__ (see\n {{#crossLink \"SessionService/authenticate:method\"}}{{/crossLink}}). This\n invokes the authenticator's\n {{#crossLink \"BaseAuthenticator/invalidate:method\"}}{{/crossLink}} method\n and handles the returned promise accordingly.\n\n This method returns a promise. A resolving promise indicates that the\n session was successfully invalidated while a rejecting promise indicates\n that invalidation failed and the session remains authenticated. Once the\n session is successfully invalidated it clears all of its authenticated data\n (see {{#crossLink \"SessionService/data:property\"}}{{/crossLink}}).\n\n When invalidation succeeds this will trigger the\n {{#crossLink \"SessionService/invalidationSucceeded:event\"}}{{/crossLink}}\n event.\n\n When calling the {{#crossLink \"BaseAuthenticator/invalidate:method\"}}{{/crossLink}}\n on an already unauthenticated session, the method will return a resolved Promise\n immediately.\n\n @method invalidate\n @param {Array} ...args arguments that will be passed to the authenticator\n @return {Ember.RSVP.Promise} A promise that resolves when the session was invalidated successfully and rejects otherwise\n @public\n */\n invalidate() {\n const session = this.get('session');\n\n return session.invalidate(...arguments);\n },\n\n /**\n Checks whether the session is authenticated and if it is not, transitions\n to the specified route or invokes the specified callback.\n\n If a transition is in progress and is aborted, this method will save it in the\n session service's\n {{#crossLink \"SessionService/attemptedTransition:property\"}}{{/crossLink}}\n property so that it can be retried after the session is authenticated. If\n the transition is aborted in Fastboot mode, the transition's target URL\n will be saved in a `ember_simple_auth-redirectTarget` cookie for use by the\n browser after authentication is complete.\n\n @method requireAuthentication\n @param {Transition} transition A transition that triggered the authentication requirement or null if the requirement originated independently of a transition\n @param {String|Function} routeOrCallback The route to transition to in case that the session is not authenticated or a callback function to invoke in that case\n @return {Boolean} true when the session is authenticated, false otherwise\n @public\n */\n requireAuthentication(transition, routeOrCallback) {\n assertSetupHasBeenCalled(this._setupIsCalled);\n let isAuthenticated = requireAuthentication(getOwner(this), transition);\n if (!isAuthenticated) {\n let argType = typeof routeOrCallback;\n if (argType === 'string') {\n triggerAuthentication(getOwner(this), routeOrCallback);\n } else if (argType === 'function') {\n routeOrCallback();\n } else {\n assert(`The second argument to requireAuthentication must be a String or Function, got \"${argType}\"!`, false);\n }\n }\n return isAuthenticated;\n },\n\n /**\n Checks whether the session is authenticated and if it is, transitions\n to the specified route or invokes the specified callback.\n\n @method prohibitAuthentication\n @param {String|Function} routeOrCallback The route to transition to in case that the session is authenticated or a callback function to invoke in that case\n @return {Boolean} true when the session is not authenticated, false otherwise\n @public\n */\n prohibitAuthentication(routeOrCallback) {\n assertSetupHasBeenCalled(this._setupIsCalled);\n let isAuthenticated = this.get('isAuthenticated');\n if (isAuthenticated) {\n let argType = typeof routeOrCallback;\n if (argType === 'string') {\n prohibitAuthentication(getOwner(this), routeOrCallback);\n } else if (argType === 'function') {\n routeOrCallback();\n } else {\n assert(`The first argument to prohibitAuthentication must be a String or Function, got \"${argType}\"!`, false);\n }\n }\n return !isAuthenticated;\n },\n\n /**\n This method is called whenever the session goes from being unauthenticated\n to being authenticated. If there is a transition that was previously\n intercepted by the\n {{#crossLink \"SessionService/requireAuthentication:method\"}}{{/crossLink}},\n it will retry it. If there is no such transition, the\n `ember_simple_auth-redirectTarget` cookie will be checked for a url that\n represents an attemptedTransition that was aborted in Fastboot mode,\n otherwise this action transitions to the specified\n routeAfterAuthentication.\n\n @method handleAuthentication\n @param {String} routeAfterAuthentication The route to transition to\n @public\n */\n handleAuthentication(routeAfterAuthentication) {\n handleSessionAuthenticated(getOwner(this), routeAfterAuthentication);\n },\n\n /**\n This method is called whenever the session goes from being authenticated to\n not being authenticated. __It reloads the Ember.js application__ by\n redirecting the browser to the specified route so that all in-memory data\n (such as Ember Data stores etc.) gets cleared.\n\n If the Ember.js application will be used in an environment where the users\n don't have direct access to any data stored on the client (e.g.\n [cordova](http://cordova.apache.org)) this action can be overridden to e.g.\n simply transition to the index route.\n\n @method handleInvalidation\n @param {String} routeAfterInvalidation The route to transition to\n @public\n */\n handleInvalidation(routeAfterInvalidation) {\n handleSessionInvalidated(getOwner(this), routeAfterInvalidation);\n },\n\n /**\n Sets up the session service.\n\n This method must be called when the application starts up,\n usually as the first thing in the `application` route's `beforeModel`\n method.\n\n @method setup\n @public\n */\n setup() {\n this._setupIsCalled = true;\n this._setupHandlers();\n\n return this.session.restore().catch(() => {\n // If it raises an error then it means that restore didn't find any restorable state.\n });\n },\n});\n","import Ember from 'ember';\nimport isFastBoot from '../utils/is-fastboot';\nimport location from '../utils/location';\n\nexport function requireAuthentication(owner, transition) {\n let sessionService = owner.lookup('service:session');\n let isAuthenticated = sessionService.get('isAuthenticated');\n if (!isAuthenticated) {\n if (transition && isFastBoot(owner)) {\n const fastbootService = owner.lookup('service:fastboot');\n const cookiesService = owner.lookup('service:cookies');\n cookiesService.write('ember_simple_auth-redirectTarget', transition.intent.url, {\n path: '/',\n secure: fastbootService.get('request.protocol') === 'https'\n });\n } else if (transition) {\n sessionService.set('attemptedTransition', transition);\n }\n }\n return isAuthenticated;\n}\n\nexport function triggerAuthentication(owner, authenticationRoute) {\n let authRouter = owner.lookup('service:router') || owner.lookup('router:main');\n authRouter.transitionTo(authenticationRoute);\n}\n\nexport function prohibitAuthentication(owner, routeIfAlreadyAuthenticated) {\n let authRouter = owner.lookup('service:router') || owner.lookup('router:main');\n authRouter.transitionTo(routeIfAlreadyAuthenticated);\n}\n\nexport function handleSessionAuthenticated(owner, routeAfterAuthentication) {\n let sessionService = owner.lookup('service:session');\n let attemptedTransition = sessionService.get('attemptedTransition');\n let cookiesService = owner.lookup('service:cookies');\n const redirectTarget = cookiesService.read('ember_simple_auth-redirectTarget');\n\n let routerService = owner.lookup('service:router');\n\n if (attemptedTransition) {\n attemptedTransition.retry();\n sessionService.set('attemptedTransition', null);\n } else if (redirectTarget) {\n routerService.transitionTo(redirectTarget);\n cookiesService.clear('ember_simple_auth-redirectTarget');\n } else {\n routerService.transitionTo(routeAfterAuthentication);\n }\n}\n\nexport function handleSessionInvalidated(owner, routeAfterInvalidation) {\n if (isFastBoot(owner)) {\n let routerService = owner.lookup('service:router');\n routerService.transitionTo(routeAfterInvalidation);\n } else {\n if (!Ember.testing) {\n location().replace(routeAfterInvalidation);\n }\n }\n}\n","export default () => window.location;\n","import RSVP from 'rsvp';\nimport EmberObject from '@ember/object';\nimport Evented from '@ember/object/evented';\n\n/**\n The base class for all session stores. __This serves as a starting point for\n implementing custom session stores and must not be used directly.__\n\n Session Stores persist the session's state so that it survives a page reload\n and is synchronized across multiple tabs or windows of the same application.\n\n @class BaseStore\n @module ember-simple-auth/session-stores/base\n @extends Ember.Object\n @uses Ember.Evented\n @public\n*/\nexport default EmberObject.extend(Evented, {\n /**\n Triggered when the session store's data changes due to an external event,\n e.g., from another tab or window of the same application. The session\n handles that event, passes the updated data to its authenticator's\n {{#crossLink \"BaseAuthenticator/restore:method\"}}{{/crossLink}} method and\n handles the result of that invocation accordingly.\n\n @event sessionDataUpdated\n @param {Object} data The updated session data\n @public\n */\n\n /**\n Persists the `data`. This replaces all currently stored data.\n\n `BaseStores`'s implementation always returns a rejecting promise. __This\n method must be overridden in subclasses__.\n\n @method persist\n @param {Object} data The data to persist\n @return {Ember.RSVP.Promise} A promise that resolves when the data has successfully been persisted and rejects otherwise.\n @public\n */\n persist() {\n return RSVP.reject();\n },\n\n /**\n Returns all data currently stored as a plain object.\n\n `BaseStores`'s implementation always returns a rejecting promise. __This\n method must be overridden in subclasses__.\n\n @method restore\n @return {Ember.RSVP.Promise} A promise that resolves with the data currently persisted in the store when the data has been restored successfully and rejects otherwise.\n @public\n */\n restore() {\n return RSVP.reject();\n },\n\n /**\n Clears the store.\n\n `BaseStores`'s implementation always returns a rejecting promise. __This\n method must be overridden in subclasses__.\n\n @method clear\n @return {Ember.RSVP.Promise} A promise that resolves when the store has been cleared successfully and rejects otherwise.\n @public\n */\n clear() {\n return RSVP.reject();\n }\n});\n","import RSVP from 'rsvp';\nimport { computed } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { later, cancel, scheduleOnce, next } from '@ember/runloop';\nimport { isPresent, typeOf, isEmpty, isNone } from '@ember/utils';\nimport { A } from '@ember/array';\nimport { getOwner } from '@ember/application';\nimport { warn } from '@ember/debug';\nimport Ember from 'ember';\nimport BaseStore from './base';\nimport objectsAreEqual from '../utils/objects-are-equal';\n\nconst persistingProperty = function(beforeSet = function() {}) {\n return computed({\n get(key) {\n return this.get(`_${key}`);\n },\n set(key, value) {\n beforeSet.apply(this, [key, value]);\n this.set(`_${key}`, value);\n scheduleOnce('actions', this, this.rewriteCookie);\n return value;\n }\n });\n};\n\n/**\n Session store that persists data in a cookie.\n\n By default the cookie session store uses a session cookie that expires and is\n deleted when the browser is closed. The cookie expiration period can be\n configured by setting the\n {{#crossLink \"CookieStore/cookieExpirationTime:property\"}}{{/crossLink}}\n property. This can be used to implement \"remember me\" functionality that will\n either store the session persistently or in a session cookie depending on\n whether the user opted in or not:\n\n ```js\n // app/controllers/login.js\n import Controller from '@ember/controller';\n import { inject as service } from '@ember/service';\n\n export default class LoginController extends Controller {\n @service session;\n _rememberMe = false;\n\n get rememberMe() {\n return this._rememberMe;\n }\n\n set rememberMe(value) {\n let expirationTime = value ? (14 * 24 * 60 * 60) : null;\n this.set('session.store.cookieExpirationTime', expirationTime);\n this._rememberMe = value;\n }\n }\n ```\n\n __Applications that use FastBoot must use this session store by defining the\n application session store like this:__\n\n ```js\n // app/session-stores/application.js\n import CookieStore from 'ember-simple-auth/session-stores/cookie';\n\n export default class ApplicationSessionStore extends CookieStore {}\n ```\n\n @class CookieStore\n @module ember-simple-auth/session-stores/cookie\n @extends BaseStore\n @public\n*/\nexport default BaseStore.extend({\n _syncDataTimeout: null,\n _renewExpirationTimeout: null,\n\n /**\n The domain to use for the cookie, e.g., \"example.com\", \".example.com\"\n (which includes all subdomains) or \"subdomain.example.com\". If not\n explicitly set, the cookie domain defaults to the domain the session was\n authenticated on.\n\n @property cookieDomain\n @type String\n @default null\n @public\n */\n _cookieDomain: null,\n cookieDomain: persistingProperty(),\n\n /**\n Allows servers to assert that a cookie ought not to be sent along with cross-site requests,\n which provides some protection against cross-site request forgery attacks (CSRF).\n Available options:\n - \"Strict\"\n - \"Lax\"\n @property sameSite\n @type String\n @default null\n @public\n */\n _sameSite: null,\n sameSite: persistingProperty(),\n\n /**\n The name of the cookie.\n\n @property cookieName\n @type String\n @default ember_simple_auth-session\n @public\n */\n _cookieName: 'ember_simple_auth-session',\n cookieName: persistingProperty(function() {\n this._oldCookieName = this._cookieName;\n }),\n\n /**\n The path to use for the cookie, e.g., \"/\", \"/something\".\n\n @property cookiePath\n @type String\n @default '/'\n @public\n */\n _cookiePath: '/',\n cookiePath: persistingProperty(),\n\n /**\n The expiration time for the cookie in seconds. A value of `null` will make\n the cookie a session cookie that expires and gets deleted when the browser\n is closed.\n\n The recommended minimum value is 90 seconds. If your value is less than\n that, the cookie may expire before its expiration time is extended\n (expiration time is extended every 60 seconds).\n\n @property cookieExpirationTime\n @default null\n @type Integer\n @public\n */\n _cookieExpirationTime: null,\n cookieExpirationTime: persistingProperty(function(key, value) {\n // When nulling expiry time on purpose, we need to clear the cached value.\n // Otherwise, `_calculateExpirationTime` will reuse it.\n if (isNone(value)) {\n this.get('_cookies').clear(`${this.get('cookieName')}-expiration_time`);\n } else if (value < 90) {\n warn('The recommended minimum value for `cookieExpirationTime` is 90 seconds. If your value is less than that, the cookie may expire before its expiration time is extended (expiration time is extended every 60 seconds).', false, { id: 'ember-simple-auth.cookieExpirationTime' });\n }\n }),\n\n _cookies: service('cookies'),\n\n _secureCookies() {\n if (this.get('_fastboot.isFastBoot')) {\n return this.get('_fastboot.request.protocol') === 'https';\n }\n\n return window.location.protocol === 'https:';\n },\n\n _isPageVisible() {\n if (this.get('_fastboot.isFastBoot')) {\n return false;\n } else {\n const visibilityState = typeof document !== 'undefined' ? document.visibilityState || 'visible' : false;\n return visibilityState === 'visible';\n }\n },\n\n init() {\n this._super(...arguments);\n let owner = getOwner(this);\n if (owner && !this.hasOwnProperty('_fastboot')) {\n this._fastboot = owner.lookup('service:fastboot');\n }\n\n let cachedExpirationTime = this._read(`${this.get('cookieName')}-expiration_time`);\n if (cachedExpirationTime) {\n this.set('cookieExpirationTime', parseInt(cachedExpirationTime, 10));\n }\n\n if (!this.get('_fastboot.isFastBoot')) {\n next(() => {\n this._syncData().then(() => {\n this._renewExpiration();\n });\n });\n } else {\n this._renew();\n }\n },\n\n /**\n Persists the `data` in the cookie.\n\n @method persist\n @param {Object} data The data to persist\n @return {Ember.RSVP.Promise} A promise that resolves when the data has successfully been persisted and rejects otherwise.\n @public\n */\n persist(data) {\n this._lastData = data;\n data = JSON.stringify(data || {});\n let expiration = this._calculateExpirationTime();\n this._write(data, expiration);\n return RSVP.resolve();\n },\n\n /**\n Returns all data currently stored in the cookie as a plain object.\n\n @method restore\n @return {Ember.RSVP.Promise} A promise that resolves with the data currently persisted in the store when the data has been restored successfully and rejects otherwise.\n @public\n */\n restore() {\n let data = this._read(this.get('cookieName'));\n if (isEmpty(data)) {\n return RSVP.resolve({});\n } else {\n return RSVP.resolve(JSON.parse(data));\n }\n },\n\n /**\n Clears the store by deleting the cookie.\n\n @method clear\n @return {Ember.RSVP.Promise} A promise that resolves when the store has been cleared successfully and rejects otherwise.\n @public\n */\n clear() {\n this._write('', 0);\n this._lastData = {};\n return RSVP.resolve();\n },\n\n _read(name) {\n return this.get('_cookies').read(name) || '';\n },\n\n _calculateExpirationTime() {\n let cachedExpirationTime = this._read(`${this.get('cookieName')}-expiration_time`);\n cachedExpirationTime = cachedExpirationTime ? new Date().getTime() + cachedExpirationTime * 1000 : null;\n return this.get('cookieExpirationTime') ? new Date().getTime() + this.get('cookieExpirationTime') * 1000 : cachedExpirationTime;\n },\n\n _write(value, expiration) {\n let cookieOptions = {\n domain: this.get('cookieDomain'),\n expires: isEmpty(expiration) ? null : new Date(expiration),\n path: this.get('cookiePath'),\n secure: this._secureCookies(),\n sameSite: this.get('sameSite')\n };\n if (this._oldCookieName) {\n A([this._oldCookieName, `${this._oldCookieName}-expiration_time`]).forEach((oldCookie) => {\n this.get('_cookies').clear(oldCookie);\n });\n delete this._oldCookieName;\n }\n this.get('_cookies').write(this.get('cookieName'), value, cookieOptions);\n if (!isEmpty(expiration)) {\n let expirationCookieName = `${this.get('cookieName')}-expiration_time`;\n let cachedExpirationTime = this.get('_cookies').read(expirationCookieName);\n this.get('_cookies').write(expirationCookieName, this.get('cookieExpirationTime') || cachedExpirationTime, cookieOptions);\n }\n },\n\n _syncData() {\n return this.restore().then((data) => {\n if (!objectsAreEqual(data, this._lastData)) {\n this._lastData = data;\n this.trigger('sessionDataUpdated', data);\n }\n if (!Ember.testing) {\n cancel(this._syncDataTimeout);\n this._syncDataTimeout = later(this, this._syncData, 500);\n }\n });\n },\n\n _renew() {\n return this.restore().then((data) => {\n if (!isEmpty(data) && !(data.constructor === Object && Object.keys(data).length === 0)) {\n data = typeOf(data) === 'string' ? data : JSON.stringify(data || {});\n let expiration = this._calculateExpirationTime();\n this._write(data, expiration);\n }\n });\n },\n\n _renewExpiration() {\n if (!Ember.testing) {\n cancel(this._renewExpirationTimeout);\n this._renewExpirationTimeout = later(this, this._renewExpiration, 60000);\n }\n if (this._isPageVisible()) {\n return this._renew();\n } else {\n return RSVP.resolve();\n }\n },\n\n rewriteCookie() {\n // if `cookieName` has not been renamed, `oldCookieName` will be nil\n const cookieName = this._oldCookieName || this._cookieName;\n const data = this._read(cookieName);\n if (isPresent(data)) {\n const expiration = this._calculateExpirationTime();\n this._write(data, expiration);\n }\n },\n});\n","/* eslint-disable no-unused-vars */\n// @ts-check\nimport { assert } from '@ember/debug';\nimport ApplicationInstance from '@ember/application/instance';\n\nexport default function isFastBoot(owner) {\n assert('You must pass in an owner to isFastBoot!', owner && typeof owner.lookup === 'function');\n const fastboot = owner.lookup('service:fastboot');\n return fastboot ? fastboot.get('isFastBoot') : false;\n}\n","export default function objectsAreEqual(a, b) {\n function compare(x, y) {\n let property;\n if (isNaN(x) && isNaN(y) && typeof x === 'number' && typeof y === 'number') {\n return true;\n }\n\n if (x === y) {\n return true;\n }\n\n if (!(x instanceof Object && y instanceof Object)) {\n return false;\n }\n\n for (property in y) {\n if (y.hasOwnProperty(property) !== x.hasOwnProperty(property)) {\n return false;\n } else if (typeof y[property] !== typeof x[property]) {\n return false;\n }\n }\n\n for (property in x) {\n if (y.hasOwnProperty(property) !== x.hasOwnProperty(property)) {\n return false;\n } else if (typeof y[property] !== typeof x[property]) {\n return false;\n }\n\n switch (typeof (x[property])) {\n case 'object':\n if (!compare(x[property], y[property])) {\n return false;\n }\n break;\n default:\n if (x[property] !== y[property]) {\n return false;\n }\n break;\n }\n }\n\n return true;\n }\n\n return compare(a, b);\n}\n","export default function esCompat(m) {\n return m?.__esModule ? m : { default: m, ...m };\n}\n","import { __extends } from \"tslib\";\nexport var IntlErrorCode;\n(function (IntlErrorCode) {\n IntlErrorCode[\"FORMAT_ERROR\"] = \"FORMAT_ERROR\";\n IntlErrorCode[\"UNSUPPORTED_FORMATTER\"] = \"UNSUPPORTED_FORMATTER\";\n IntlErrorCode[\"INVALID_CONFIG\"] = \"INVALID_CONFIG\";\n IntlErrorCode[\"MISSING_DATA\"] = \"MISSING_DATA\";\n IntlErrorCode[\"MISSING_TRANSLATION\"] = \"MISSING_TRANSLATION\";\n})(IntlErrorCode || (IntlErrorCode = {}));\nvar IntlError = /** @class */ (function (_super) {\n __extends(IntlError, _super);\n function IntlError(code, message, exception) {\n var _this = this;\n var err = exception\n ? exception instanceof Error\n ? exception\n : new Error(String(exception))\n : undefined;\n _this = _super.call(this, \"[@formatjs/intl Error \".concat(code, \"] \").concat(message, \"\\n\").concat(err ? \"\\n\".concat(err.message, \"\\n\").concat(err.stack) : '')) || this;\n _this.code = code;\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (typeof Error.captureStackTrace === 'function') {\n // @ts-ignore just so we don't need to declare dep on @types/node\n Error.captureStackTrace(_this, IntlError);\n }\n return _this;\n }\n return IntlError;\n}(Error));\nexport { IntlError };\nvar UnsupportedFormatterError = /** @class */ (function (_super) {\n __extends(UnsupportedFormatterError, _super);\n function UnsupportedFormatterError(message, exception) {\n return _super.call(this, IntlErrorCode.UNSUPPORTED_FORMATTER, message, exception) || this;\n }\n return UnsupportedFormatterError;\n}(IntlError));\nexport { UnsupportedFormatterError };\nvar InvalidConfigError = /** @class */ (function (_super) {\n __extends(InvalidConfigError, _super);\n function InvalidConfigError(message, exception) {\n return _super.call(this, IntlErrorCode.INVALID_CONFIG, message, exception) || this;\n }\n return InvalidConfigError;\n}(IntlError));\nexport { InvalidConfigError };\nvar MissingDataError = /** @class */ (function (_super) {\n __extends(MissingDataError, _super);\n function MissingDataError(message, exception) {\n return _super.call(this, IntlErrorCode.MISSING_DATA, message, exception) || this;\n }\n return MissingDataError;\n}(IntlError));\nexport { MissingDataError };\nvar IntlFormatError = /** @class */ (function (_super) {\n __extends(IntlFormatError, _super);\n function IntlFormatError(message, locale, exception) {\n var _this = _super.call(this, IntlErrorCode.FORMAT_ERROR, \"\".concat(message, \"\\nLocale: \").concat(locale, \"\\n\"), exception) || this;\n _this.locale = locale;\n return _this;\n }\n return IntlFormatError;\n}(IntlError));\nexport { IntlFormatError };\nvar MessageFormatError = /** @class */ (function (_super) {\n __extends(MessageFormatError, _super);\n function MessageFormatError(message, locale, descriptor, exception) {\n var _this = _super.call(this, \"\".concat(message, \"\\nMessageID: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.id, \"\\nDefault Message: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage, \"\\nDescription: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.description, \"\\n\"), locale, exception) || this;\n _this.descriptor = descriptor;\n _this.locale = locale;\n return _this;\n }\n return MessageFormatError;\n}(IntlFormatError));\nexport { MessageFormatError };\nvar MissingTranslationError = /** @class */ (function (_super) {\n __extends(MissingTranslationError, _super);\n function MissingTranslationError(descriptor, locale) {\n var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, \"Missing message: \\\"\".concat(descriptor.id, \"\\\" for locale \\\"\").concat(locale, \"\\\", using \").concat(descriptor.defaultMessage\n ? \"default message (\".concat(typeof descriptor.defaultMessage === 'string'\n ? descriptor.defaultMessage\n : descriptor.defaultMessage\n .map(function (e) { var _a; return (_a = e.value) !== null && _a !== void 0 ? _a : JSON.stringify(e); })\n .join(), \")\")\n : 'id', \" as fallback.\")) || this;\n _this.descriptor = descriptor;\n return _this;\n }\n return MissingTranslationError;\n}(IntlError));\nexport { MissingTranslationError };\n","declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n","import { getClient } from '@sentry/core';\nimport type {\n Event,\n EventHint,\n Exception,\n ParameterizedString,\n Severity,\n SeverityLevel,\n StackFrame,\n StackParser,\n} from '@sentry/types';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n extractExceptionKeysForMessage,\n isDOMError,\n isDOMException,\n isError,\n isErrorEvent,\n isEvent,\n isParameterizedString,\n isPlainObject,\n normalizeToSize,\n resolvedSyncPromise,\n} from '@sentry/utils';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n\n/**\n * This function creates an exception from a JavaScript Error\n */\nexport function exceptionFromError(stackParser: StackParser, ex: Error): Exception {\n // Get the frames first since Opera can lose the stack if we touch anything else first\n const frames = parseStackFrames(stackParser, ex);\n\n const exception: Exception = {\n type: ex && ex.name,\n value: extractMessage(ex),\n };\n\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n\n/**\n * @hidden\n */\nexport function eventFromPlainObject(\n stackParser: StackParser,\n exception: Record,\n syntheticException?: Error,\n isUnhandledRejection?: boolean,\n): Event {\n const client = getClient();\n const normalizeDepth = client && client.getOptions().normalizeDepth;\n\n const event: Event = {\n exception: {\n values: [\n {\n type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),\n },\n ],\n },\n extra: {\n __serialized__: normalizeToSize(exception, normalizeDepth),\n },\n };\n\n if (syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n // event.exception.values[0] has been set above\n (event.exception as { values: Exception[] }).values[0].stacktrace = { frames };\n }\n }\n\n return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromError(stackParser: StackParser, ex: Error): Event {\n return {\n exception: {\n values: [exceptionFromError(stackParser, ex)],\n },\n };\n}\n\n/** Parses stack frames from an error */\nexport function parseStackFrames(\n stackParser: StackParser,\n ex: Error & { framesToPop?: number; stacktrace?: string },\n): StackFrame[] {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n const stacktrace = ex.stacktrace || ex.stack || '';\n\n const popSize = getPopSize(ex);\n\n try {\n return stackParser(stacktrace, popSize);\n } catch (e) {\n // no-empty\n }\n\n return [];\n}\n\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\nfunction getPopSize(ex: Error & { framesToPop?: number }): number {\n if (ex) {\n if (typeof ex.framesToPop === 'number') {\n return ex.framesToPop;\n }\n\n if (reactMinifiedRegexp.test(ex.message)) {\n return 1;\n }\n }\n\n return 0;\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nfunction extractMessage(ex: Error & { message: { error?: Error } }): string {\n const message = ex && ex.message;\n if (!message) {\n return 'No error message';\n }\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n return message;\n}\n\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\nexport function eventFromException(\n stackParser: StackParser,\n exception: unknown,\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);\n addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n event.level = 'error';\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n stackParser: StackParser,\n message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n level: Severity | SeverityLevel = 'info',\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n event.level = level;\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nexport function eventFromUnknownInput(\n stackParser: StackParser,\n exception: unknown,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n isUnhandledRejection?: boolean,\n): Event {\n let event: Event;\n\n if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n const errorEvent = exception as ErrorEvent;\n return eventFromError(stackParser, errorEvent.error as Error);\n }\n\n // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n if (isDOMError(exception) || isDOMException(exception as DOMException)) {\n const domException = exception as DOMException;\n\n if ('stack' in (exception as Error)) {\n event = eventFromError(stackParser, exception as Error);\n } else {\n const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n const message = domException.message ? `${name}: ${domException.message}` : name;\n event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, message);\n }\n if ('code' in domException) {\n // eslint-disable-next-line deprecation/deprecation\n event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n }\n\n return event;\n }\n if (isError(exception)) {\n // we have a real Error object, do nothing\n return eventFromError(stackParser, exception);\n }\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n // group on any key/value change.\n const objectException = exception as Record;\n event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n return event;\n }\n\n // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n event = eventFromString(stackParser, exception as string, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, `${exception}`, undefined);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n\n return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromString(\n stackParser: StackParser,\n message: ParameterizedString,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n): Event {\n const event: Event = {};\n\n if (attachStacktrace && syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n event.exception = {\n values: [{ value: message, stacktrace: { frames } }],\n };\n }\n }\n\n if (isParameterizedString(message)) {\n const { __sentry_template_string__, __sentry_template_values__ } = message;\n\n event.logentry = {\n message: __sentry_template_string__,\n params: __sentry_template_values__,\n };\n return event;\n }\n\n event.message = message;\n return event;\n}\n\nfunction getNonErrorObjectExceptionValue(\n exception: Record,\n { isUnhandledRejection }: { isUnhandledRejection?: boolean },\n): string {\n const keys = extractExceptionKeysForMessage(exception);\n const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';\n\n // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before\n // We still want to try to get a decent message for these cases\n if (isErrorEvent(exception)) {\n return `Event \\`ErrorEvent\\` captured as ${captureType} with message \\`${exception.message}\\``;\n }\n\n if (isEvent(exception)) {\n const className = getObjectClassName(exception);\n return `Event \\`${className}\\` (type=${exception.type}) captured as ${captureType}`;\n }\n\n return `Object captured as ${captureType} with keys: ${keys}`;\n}\n\nfunction getObjectClassName(obj: unknown): string | undefined | void {\n try {\n const prototype: Prototype | null = Object.getPrototypeOf(obj);\n return prototype ? prototype.constructor.name : undefined;\n } catch (e) {\n // ignore errors here\n }\n}\n","import { captureException, withScope } from '@sentry/core';\nimport type { DsnLike, Mechanism, WrappedFunction } from '@sentry/types';\nimport {\n GLOBAL_OBJ,\n addExceptionMechanism,\n addExceptionTypeValue,\n addNonEnumerableProperty,\n getOriginalFunction,\n markFunctionWrapped,\n} from '@sentry/utils';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n // onerror should trigger before setTimeout\n ignoreOnError++;\n setTimeout(() => {\n ignoreOnError--;\n });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap(\n fn: WrappedFunction,\n options: {\n mechanism?: Mechanism;\n } = {},\n before?: WrappedFunction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n const wrapper = fn.__sentry_wrapped__;\n if (wrapper) {\n return wrapper;\n }\n\n // We don't wanna wrap it twice\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n /* eslint-disable prefer-rest-params */\n // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n const sentryWrapped: WrappedFunction = function (this: unknown): void {\n const args = Array.prototype.slice.call(arguments);\n\n try {\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const wrappedArguments = args.map((arg: any) => wrap(arg, options));\n\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = {\n ...event.extra,\n arguments: args,\n };\n\n return event;\n });\n\n captureException(ex);\n });\n\n throw ex;\n }\n };\n /* eslint-enable prefer-rest-params */\n\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n markFunctionWrapped(sentryWrapped, fn);\n\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n // Restore original function name (not all browsers allow that)\n try {\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get(): string {\n return fn.name;\n },\n });\n }\n // eslint-disable-next-line no-empty\n } catch (_oO) {}\n\n return sentryWrapped;\n}\n\n/**\n * All properties the report dialog supports\n *\n * @deprecated This type will be removed in the next major version of the Sentry SDK. `showReportDialog` will still be around, however the `eventId` option will now be required.\n */\nexport interface ReportDialogOptions {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n eventId?: string;\n dsn?: DsnLike;\n user?: {\n email?: string;\n name?: string;\n };\n lang?: string;\n title?: string;\n subtitle?: string;\n subtitle2?: string;\n labelName?: string;\n labelEmail?: string;\n labelComments?: string;\n labelClose?: string;\n labelSubmit?: string;\n errorGeneric?: string;\n errorFormEntry?: string;\n successMessage?: string;\n /** Callback after reportDialog showed up */\n onLoad?(this: void): void;\n /** Callback after reportDialog closed */\n onClose?(this: void): void;\n}\n","import type {\n Client,\n Event,\n EventHint,\n Exception,\n Extras,\n Hub,\n Mechanism,\n ParameterizedString,\n Severity,\n SeverityLevel,\n StackFrame,\n StackParser,\n} from '@sentry/types';\n\nimport { isError, isParameterizedString, isPlainObject } from './is';\nimport { addExceptionMechanism, addExceptionTypeValue } from './misc';\nimport { normalizeToSize } from './normalize';\nimport { extractExceptionKeysForMessage } from './object';\n\n/**\n * Extracts stack frames from the error.stack string\n */\nexport function parseStackFrames(stackParser: StackParser, error: Error): StackFrame[] {\n return stackParser(error.stack || '', 1);\n}\n\n/**\n * Extracts stack frames from the error and builds a Sentry Exception\n */\nexport function exceptionFromError(stackParser: StackParser, error: Error): Exception {\n const exception: Exception = {\n type: error.name || error.constructor.name,\n value: error.message,\n };\n\n const frames = parseStackFrames(stackParser, error);\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n\n return exception;\n}\n\nfunction getMessageForObject(exception: object): string {\n if ('name' in exception && typeof exception.name === 'string') {\n let message = `'${exception.name}' captured as exception`;\n\n if ('message' in exception && typeof exception.message === 'string') {\n message += ` with message '${exception.message}'`;\n }\n\n return message;\n } else if ('message' in exception && typeof exception.message === 'string') {\n return exception.message;\n } else {\n // This will allow us to group events based on top-level keys\n // which is much better than creating new group when any key/value change\n return `Object captured as exception with keys: ${extractExceptionKeysForMessage(\n exception as Record,\n )}`;\n }\n}\n\n/**\n * Builds and Event from a Exception\n *\n * TODO(v8): Remove getHub fallback\n * @hidden\n */\nexport function eventFromUnknownInput(\n getHubOrClient: (() => Hub) | Client | undefined,\n stackParser: StackParser,\n exception: unknown,\n hint?: EventHint,\n): Event {\n const client = typeof getHubOrClient === 'function' ? getHubOrClient().getClient() : getHubOrClient;\n\n let ex: unknown = exception;\n const providedMechanism: Mechanism | undefined =\n hint && hint.data && (hint.data as { mechanism: Mechanism }).mechanism;\n const mechanism: Mechanism = providedMechanism || {\n handled: true,\n type: 'generic',\n };\n\n let extras: Extras | undefined;\n\n if (!isError(exception)) {\n if (isPlainObject(exception)) {\n const normalizeDepth = client && client.getOptions().normalizeDepth;\n extras = { ['__serialized__']: normalizeToSize(exception as Record, normalizeDepth) };\n\n const message = getMessageForObject(exception);\n ex = (hint && hint.syntheticException) || new Error(message);\n (ex as Error).message = message;\n } else {\n // This handles when someone does: `throw \"something awesome\";`\n // We use synthesized Error here so we can extract a (rough) stack trace.\n ex = (hint && hint.syntheticException) || new Error(exception as string);\n (ex as Error).message = exception as string;\n }\n mechanism.synthetic = true;\n }\n\n const event: Event = {\n exception: {\n values: [exceptionFromError(stackParser, ex as Error)],\n },\n };\n\n if (extras) {\n event.extra = extras;\n }\n\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, mechanism);\n\n return {\n ...event,\n event_id: hint && hint.event_id,\n };\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n stackParser: StackParser,\n message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n level: Severity | SeverityLevel = 'info',\n hint?: EventHint,\n attachStacktrace?: boolean,\n): Event {\n const event: Event = {\n event_id: hint && hint.event_id,\n level,\n };\n\n if (attachStacktrace && hint && hint.syntheticException) {\n const frames = parseStackFrames(stackParser, hint.syntheticException);\n if (frames.length) {\n event.exception = {\n values: [\n {\n value: message,\n stacktrace: { frames },\n },\n ],\n };\n }\n }\n\n if (isParameterizedString(message)) {\n const { __sentry_template_string__, __sentry_template_values__ } = message;\n\n event.logentry = {\n message: __sentry_template_string__,\n params: __sentry_template_values__,\n };\n return event;\n }\n\n event.message = message;\n return event;\n}\n","import type { IntegrationFn } from '@sentry/types';\nimport { applyAggregateErrorsToEvent, exceptionFromError } from '@sentry/utils';\nimport { convertIntegrationFnToClass } from '../integration';\n\ninterface LinkedErrorsOptions {\n key?: string;\n limit?: number;\n}\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\nconst INTEGRATION_NAME = 'LinkedErrors';\n\nconst linkedErrorsIntegration: IntegrationFn = (options: LinkedErrorsOptions = {}) => {\n const limit = options.limit || DEFAULT_LIMIT;\n const key = options.key || DEFAULT_KEY;\n\n return {\n name: INTEGRATION_NAME,\n preprocessEvent(event, hint, client) {\n const options = client.getOptions();\n\n applyAggregateErrorsToEvent(\n exceptionFromError,\n options.stackParser,\n options.maxValueLength,\n key,\n limit,\n event,\n hint,\n );\n },\n };\n};\n\n/** Adds SDK info to an event. */\n// eslint-disable-next-line deprecation/deprecation\nexport const LinkedErrors = convertIntegrationFnToClass(INTEGRATION_NAME, linkedErrorsIntegration);\n","import type { Options } from '@sentry/types';\n\nimport { getClient } from '../exports';\n\n// Treeshakable guard to remove all code related to tracing\ndeclare const __SENTRY_TRACING__: boolean | undefined;\n\n/**\n * Determines if tracing is currently enabled.\n *\n * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.\n */\nexport function hasTracingEnabled(\n maybeOptions?: Pick | undefined,\n): boolean {\n if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {\n return false;\n }\n\n const client = getClient();\n const options = maybeOptions || (client && client.getOptions());\n return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);\n}\n","import type {\n Instrumenter,\n Primitive,\n Scope,\n Span,\n SpanTimeInput,\n TransactionContext,\n TransactionMetadata,\n} from '@sentry/types';\nimport type { SpanAttributes } from '@sentry/types';\nimport type { SpanOrigin } from '@sentry/types';\nimport type { TransactionSource } from '@sentry/types';\nimport { dropUndefinedKeys, logger, tracingContextFromHeaders } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getCurrentScope, withScope } from '../exports';\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\nimport { handleCallbackErrors } from '../utils/handleCallbackErrors';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled';\nimport { spanTimeInputToSeconds } from '../utils/spanUtils';\n\ninterface StartSpanOptions extends TransactionContext {\n /** A manually specified start time for the created `Span` object. */\n startTime?: SpanTimeInput;\n\n /** If defined, start this span off this scope instead off the current scope. */\n scope?: Scope;\n\n /** The name of the span. */\n name: string;\n\n /** An op for the span. This is a categorization for spans. */\n op?: string;\n\n /** The origin of the span - if it comes from auto instrumenation or manual instrumentation. */\n origin?: SpanOrigin;\n\n /** Attributes for the span. */\n attributes?: SpanAttributes;\n\n // All remaining fields are deprecated\n\n /**\n * @deprecated Manually set the end timestamp instead.\n */\n trimEnd?: boolean;\n\n /**\n * @deprecated This cannot be set manually anymore.\n */\n parentSampled?: boolean;\n\n /**\n * @deprecated Use attributes or set data on scopes instead.\n */\n metadata?: Partial;\n\n /**\n * The name thingy.\n * @deprecated Use `name` instead.\n */\n description?: string;\n\n /**\n * @deprecated Use `span.setStatus()` instead.\n */\n status?: string;\n\n /**\n * @deprecated Use `scope` instead.\n */\n parentSpanId?: string;\n\n /**\n * @deprecated You cannot manually set the span to sampled anymore.\n */\n sampled?: boolean;\n\n /**\n * @deprecated You cannot manually set the spanId anymore.\n */\n spanId?: string;\n\n /**\n * @deprecated You cannot manually set the traceId anymore.\n */\n traceId?: string;\n\n /**\n * @deprecated Use an attribute instead.\n */\n source?: TransactionSource;\n\n /**\n * @deprecated Use attributes or set tags on the scope instead.\n */\n tags?: { [key: string]: Primitive };\n\n /**\n * @deprecated Use attributes instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data?: { [key: string]: any };\n\n /**\n * @deprecated Use `startTime` instead.\n */\n startTimestamp?: number;\n\n /**\n * @deprecated Use `span.end()` instead.\n */\n endTimestamp?: number;\n\n /**\n * @deprecated You cannot set the instrumenter manually anymore.\n */\n instrumenter?: Instrumenter;\n}\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n *\n * This function is meant to be used internally and may break at any time. Use at your own risk.\n *\n * @internal\n * @private\n *\n * @deprecated Use `startSpan` instead.\n */\nexport function trace(\n context: TransactionContext,\n callback: (span?: Span) => T,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onError: (error: unknown, span?: Span) => void = () => {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n afterFinish: () => void = () => {},\n): T {\n const hub = getCurrentHub();\n const scope = getCurrentScope();\n // eslint-disable-next-line deprecation/deprecation\n const parentSpan = scope.getSpan();\n\n const ctx = normalizeContext(context);\n const activeSpan = createChildSpanOrTransaction(hub, parentSpan, ctx);\n\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(activeSpan);\n\n return handleCallbackErrors(\n () => callback(activeSpan),\n error => {\n activeSpan && activeSpan.setStatus('internal_error');\n onError(error, activeSpan);\n },\n () => {\n activeSpan && activeSpan.end();\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(parentSpan);\n afterFinish();\n },\n );\n}\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getSpan()`, as long as the function is executed while the scope is active.\n *\n * If you want to create a span that is not set as active, use {@link startInactiveSpan}.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startSpan(context: StartSpanOptions, callback: (span: Span | undefined) => T): T {\n const ctx = normalizeContext(context);\n\n return withScope(context.scope, scope => {\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const parentSpan = scope.getSpan();\n\n const activeSpan = createChildSpanOrTransaction(hub, parentSpan, ctx);\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(activeSpan);\n\n return handleCallbackErrors(\n () => callback(activeSpan),\n () => {\n // Only update the span status if it hasn't been changed yet\n if (activeSpan && (!activeSpan.status || activeSpan.status === 'ok')) {\n activeSpan.setStatus('internal_error');\n }\n },\n () => activeSpan && activeSpan.end(),\n );\n });\n}\n\n/**\n * @deprecated Use {@link startSpan} instead.\n */\nexport const startActiveSpan = startSpan;\n\n/**\n * Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span\n * after the function is done automatically. You'll have to call `span.end()` manually.\n *\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startSpanManual(\n context: StartSpanOptions,\n callback: (span: Span | undefined, finish: () => void) => T,\n): T {\n const ctx = normalizeContext(context);\n\n return withScope(context.scope, scope => {\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const parentSpan = scope.getSpan();\n\n const activeSpan = createChildSpanOrTransaction(hub, parentSpan, ctx);\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(activeSpan);\n\n function finishAndSetSpan(): void {\n activeSpan && activeSpan.end();\n }\n\n return handleCallbackErrors(\n () => callback(activeSpan, finishAndSetSpan),\n () => {\n // Only update the span status if it hasn't been changed yet, and the span is not yet finished\n if (activeSpan && !activeSpan.endTimestamp && (!activeSpan.status || activeSpan.status === 'ok')) {\n activeSpan.setStatus('internal_error');\n }\n },\n );\n });\n}\n\n/**\n * Creates a span. This span is not set as active, so will not get automatic instrumentation spans\n * as children or be able to be accessed via `Sentry.getSpan()`.\n *\n * If you want to create a span that is set as active, use {@link startSpan}.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate` or `tracesSampler`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startInactiveSpan(context: StartSpanOptions): Span | undefined {\n if (!hasTracingEnabled()) {\n return undefined;\n }\n\n const ctx = normalizeContext(context);\n const hub = getCurrentHub();\n const parentSpan = context.scope\n ? // eslint-disable-next-line deprecation/deprecation\n context.scope.getSpan()\n : getActiveSpan();\n return parentSpan\n ? // eslint-disable-next-line deprecation/deprecation\n parentSpan.startChild(ctx)\n : // eslint-disable-next-line deprecation/deprecation\n hub.startTransaction(ctx);\n}\n\n/**\n * Returns the currently active span.\n */\nexport function getActiveSpan(): Span | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentScope().getSpan();\n}\n\nexport function continueTrace({\n sentryTrace,\n baggage,\n}: {\n sentryTrace: Parameters[0];\n baggage: Parameters[1];\n}): Partial;\nexport function continueTrace(\n {\n sentryTrace,\n baggage,\n }: {\n sentryTrace: Parameters[0];\n baggage: Parameters[1];\n },\n callback: (transactionContext: Partial) => V,\n): V;\n/**\n * Continue a trace from `sentry-trace` and `baggage` values.\n * These values can be obtained from incoming request headers,\n * or in the browser from `` and `` HTML tags.\n *\n * The callback receives a transactionContext that may be used for `startTransaction` or `startSpan`.\n */\nexport function continueTrace(\n {\n sentryTrace,\n baggage,\n }: {\n sentryTrace: Parameters[0];\n baggage: Parameters[1];\n },\n callback?: (transactionContext: Partial) => V,\n): V | Partial {\n const currentScope = getCurrentScope();\n\n const { traceparentData, dynamicSamplingContext, propagationContext } = tracingContextFromHeaders(\n sentryTrace,\n baggage,\n );\n\n currentScope.setPropagationContext(propagationContext);\n\n if (DEBUG_BUILD && traceparentData) {\n logger.log(`[Tracing] Continuing trace ${traceparentData.traceId}.`);\n }\n\n const transactionContext: Partial = {\n ...traceparentData,\n metadata: dropUndefinedKeys({\n dynamicSamplingContext: traceparentData && !dynamicSamplingContext ? {} : dynamicSamplingContext,\n }),\n };\n\n if (!callback) {\n return transactionContext;\n }\n\n return callback(transactionContext);\n}\n\nfunction createChildSpanOrTransaction(\n hub: Hub,\n parentSpan: Span | undefined,\n ctx: TransactionContext,\n): Span | undefined {\n if (!hasTracingEnabled()) {\n return undefined;\n }\n return parentSpan\n ? // eslint-disable-next-line deprecation/deprecation\n parentSpan.startChild(ctx)\n : // eslint-disable-next-line deprecation/deprecation\n hub.startTransaction(ctx);\n}\n\n/**\n * This converts StartSpanOptions to TransactionContext.\n * For the most part (for now) we accept the same options,\n * but some of them need to be transformed.\n *\n * Eventually the StartSpanOptions will be more aligned with OpenTelemetry.\n */\nfunction normalizeContext(context: StartSpanOptions): TransactionContext {\n if (context.startTime) {\n const ctx: TransactionContext & { startTime?: SpanTimeInput } = { ...context };\n ctx.startTimestamp = spanTimeInputToSeconds(context.startTime);\n delete ctx.startTime;\n return ctx;\n }\n\n return context;\n}\n","/* eslint-disable max-lines */\nimport type {\n Instrumenter,\n Primitive,\n Span as SpanInterface,\n SpanAttributeValue,\n SpanAttributes,\n SpanContext,\n SpanContextData,\n SpanJSON,\n SpanOrigin,\n SpanTimeInput,\n TraceContext,\n Transaction,\n} from '@sentry/types';\nimport { dropUndefinedKeys, logger, timestampInSeconds, uuid4 } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport {\n TRACE_FLAG_NONE,\n TRACE_FLAG_SAMPLED,\n spanTimeInputToSeconds,\n spanToJSON,\n spanToTraceContext,\n spanToTraceHeader,\n} from '../utils/spanUtils';\n\n/**\n * Keeps track of finished spans for a given transaction\n * @internal\n * @hideconstructor\n * @hidden\n */\nexport class SpanRecorder {\n public spans: Span[];\n\n private readonly _maxlen: number;\n\n public constructor(maxlen: number = 1000) {\n this._maxlen = maxlen;\n this.spans = [];\n }\n\n /**\n * This is just so that we don't run out of memory while recording a lot\n * of spans. At some point we just stop and flush out the start of the\n * trace tree (i.e.the first n spans with the smallest\n * start_timestamp).\n */\n public add(span: Span): void {\n if (this.spans.length > this._maxlen) {\n span.spanRecorder = undefined;\n } else {\n this.spans.push(span);\n }\n }\n}\n\n/**\n * Span contains all data about a span\n */\nexport class Span implements SpanInterface {\n /**\n * @inheritDoc\n */\n public parentSpanId?: string;\n\n /**\n * Internal keeper of the status\n */\n public status?: SpanStatusType | string;\n\n /**\n * Timestamp in seconds when the span was created.\n */\n public startTimestamp: number;\n\n /**\n * Timestamp in seconds when the span ended.\n */\n public endTimestamp?: number;\n\n /**\n * @inheritDoc\n */\n public op?: string;\n\n /**\n * Tags for the span.\n * @deprecated Use `getSpanAttributes(span)` instead.\n */\n public tags: { [key: string]: Primitive };\n\n /**\n * Data for the span.\n * @deprecated Use `getSpanAttributes(span)` instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public data: { [key: string]: any };\n\n /**\n * List of spans that were finalized\n */\n public spanRecorder?: SpanRecorder;\n\n /**\n * @inheritDoc\n */\n public transaction?: Transaction;\n\n /**\n * The instrumenter that created this span.\n */\n public instrumenter: Instrumenter;\n\n /**\n * The origin of the span, giving context about what created the span.\n */\n public origin?: SpanOrigin;\n\n protected _traceId: string;\n protected _spanId: string;\n protected _sampled: boolean | undefined;\n protected _name?: string;\n protected _attributes: SpanAttributes;\n\n private _logMessage?: string;\n\n /**\n * You should never call the constructor manually, always use `Sentry.startTransaction()`\n * or call `startChild()` on an existing span.\n * @internal\n * @hideconstructor\n * @hidden\n */\n public constructor(spanContext: SpanContext = {}) {\n this._traceId = spanContext.traceId || uuid4();\n this._spanId = spanContext.spanId || uuid4().substring(16);\n this.startTimestamp = spanContext.startTimestamp || timestampInSeconds();\n // eslint-disable-next-line deprecation/deprecation\n this.tags = spanContext.tags ? { ...spanContext.tags } : {};\n // eslint-disable-next-line deprecation/deprecation\n this.data = spanContext.data ? { ...spanContext.data } : {};\n this._attributes = spanContext.attributes ? { ...spanContext.attributes } : {};\n this.instrumenter = spanContext.instrumenter || 'sentry';\n this.origin = spanContext.origin || 'manual';\n // eslint-disable-next-line deprecation/deprecation\n this._name = spanContext.name || spanContext.description;\n\n if (spanContext.parentSpanId) {\n this.parentSpanId = spanContext.parentSpanId;\n }\n // We want to include booleans as well here\n if ('sampled' in spanContext) {\n this._sampled = spanContext.sampled;\n }\n if (spanContext.op) {\n this.op = spanContext.op;\n }\n if (spanContext.status) {\n this.status = spanContext.status;\n }\n if (spanContext.endTimestamp) {\n this.endTimestamp = spanContext.endTimestamp;\n }\n }\n\n // This rule conflicts with another eslint rule :(\n /* eslint-disable @typescript-eslint/member-ordering */\n\n /**\n * An alias for `description` of the Span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public get name(): string {\n return this._name || '';\n }\n\n /**\n * Update the name of the span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public set name(name: string) {\n this.updateName(name);\n }\n\n /**\n * Get the description of the Span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public get description(): string | undefined {\n return this._name;\n }\n\n /**\n * Get the description of the Span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public set description(description: string | undefined) {\n this._name = description;\n }\n\n /**\n * The ID of the trace.\n * @deprecated Use `spanContext().traceId` instead.\n */\n public get traceId(): string {\n return this._traceId;\n }\n\n /**\n * The ID of the trace.\n * @deprecated You cannot update the traceId of a span after span creation.\n */\n public set traceId(traceId: string) {\n this._traceId = traceId;\n }\n\n /**\n * The ID of the span.\n * @deprecated Use `spanContext().spanId` instead.\n */\n public get spanId(): string {\n return this._spanId;\n }\n\n /**\n * The ID of the span.\n * @deprecated You cannot update the spanId of a span after span creation.\n */\n public set spanId(spanId: string) {\n this._spanId = spanId;\n }\n\n /**\n * Was this span chosen to be sent as part of the sample?\n * @deprecated Use `isRecording()` instead.\n */\n public get sampled(): boolean | undefined {\n return this._sampled;\n }\n\n /**\n * Was this span chosen to be sent as part of the sample?\n * @deprecated You cannot update the sampling decision of a span after span creation.\n */\n public set sampled(sampled: boolean | undefined) {\n this._sampled = sampled;\n }\n\n /**\n * Attributes for the span.\n * @deprecated Use `getSpanAttributes(span)` instead.\n */\n public get attributes(): SpanAttributes {\n return this._attributes;\n }\n\n /**\n * Attributes for the span.\n * @deprecated Use `setAttributes()` instead.\n */\n public set attributes(attributes: SpanAttributes) {\n this._attributes = attributes;\n }\n\n /* eslint-enable @typescript-eslint/member-ordering */\n\n /** @inheritdoc */\n public spanContext(): SpanContextData {\n const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this;\n return {\n spanId,\n traceId,\n traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE,\n };\n }\n\n /**\n * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.\n * Also the `sampled` decision will be inherited.\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\n public startChild(\n spanContext?: Pick>,\n ): Span {\n const childSpan = new Span({\n ...spanContext,\n parentSpanId: this._spanId,\n sampled: this._sampled,\n traceId: this._traceId,\n });\n\n childSpan.spanRecorder = this.spanRecorder;\n if (childSpan.spanRecorder) {\n childSpan.spanRecorder.add(childSpan);\n }\n\n childSpan.transaction = this.transaction;\n\n if (DEBUG_BUILD && childSpan.transaction) {\n const opStr = (spanContext && spanContext.op) || '< unknown op >';\n const nameStr = spanToJSON(childSpan).description || '< unknown name >';\n const idStr = childSpan.transaction.spanContext().spanId;\n\n const logMessage = `[Tracing] Starting '${opStr}' span on transaction '${nameStr}' (${idStr}).`;\n logger.log(logMessage);\n this._logMessage = logMessage;\n }\n\n return childSpan;\n }\n\n /**\n * Sets the tag attribute on the current span.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key Tag key\n * @param value Tag value\n * @deprecated Use `setAttribute()` instead.\n */\n public setTag(key: string, value: Primitive): this {\n // eslint-disable-next-line deprecation/deprecation\n this.tags = { ...this.tags, [key]: value };\n return this;\n }\n\n /**\n * Sets the data attribute on the current span\n * @param key Data key\n * @param value Data value\n * @deprecated Use `setAttribute()` instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setData(key: string, value: any): this {\n // eslint-disable-next-line deprecation/deprecation\n this.data = { ...this.data, [key]: value };\n return this;\n }\n\n /** @inheritdoc */\n public setAttribute(key: string, value: SpanAttributeValue | undefined): void {\n if (value === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._attributes[key];\n } else {\n this._attributes[key] = value;\n }\n }\n\n /** @inheritdoc */\n public setAttributes(attributes: SpanAttributes): void {\n Object.keys(attributes).forEach(key => this.setAttribute(key, attributes[key]));\n }\n\n /**\n * @inheritDoc\n */\n public setStatus(value: SpanStatusType): this {\n this.status = value;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setHttpStatus(httpStatus: number): this {\n // eslint-disable-next-line deprecation/deprecation\n this.setTag('http.status_code', String(httpStatus));\n // eslint-disable-next-line deprecation/deprecation\n this.setData('http.response.status_code', httpStatus);\n const spanStatus = spanStatusfromHttpCode(httpStatus);\n if (spanStatus !== 'unknown_error') {\n this.setStatus(spanStatus);\n }\n return this;\n }\n\n /** @inheritdoc */\n public setName(name: string): void {\n this.updateName(name);\n }\n\n /**\n * @inheritDoc\n */\n public updateName(name: string): this {\n this._name = name;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public isSuccess(): boolean {\n return this.status === 'ok';\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `.end()` instead.\n */\n public finish(endTimestamp?: number): void {\n return this.end(endTimestamp);\n }\n\n /** @inheritdoc */\n public end(endTimestamp?: SpanTimeInput): void {\n if (\n DEBUG_BUILD &&\n // Don't call this for transactions\n this.transaction &&\n this.transaction.spanContext().spanId !== this._spanId\n ) {\n const logMessage = this._logMessage;\n if (logMessage) {\n logger.log((logMessage as string).replace('Starting', 'Finishing'));\n }\n }\n\n this.endTimestamp = spanTimeInputToSeconds(endTimestamp);\n }\n\n /**\n * @inheritDoc\n */\n public toTraceparent(): string {\n return spanToTraceHeader(this);\n }\n\n /**\n * @inheritDoc\n */\n public toContext(): SpanContext {\n return dropUndefinedKeys({\n data: this._getData(),\n description: this._name,\n endTimestamp: this.endTimestamp,\n op: this.op,\n parentSpanId: this.parentSpanId,\n sampled: this._sampled,\n spanId: this._spanId,\n startTimestamp: this.startTimestamp,\n status: this.status,\n // eslint-disable-next-line deprecation/deprecation\n tags: this.tags,\n traceId: this._traceId,\n });\n }\n\n /**\n * @inheritDoc\n */\n public updateWithContext(spanContext: SpanContext): this {\n // eslint-disable-next-line deprecation/deprecation\n this.data = spanContext.data || {};\n // eslint-disable-next-line deprecation/deprecation\n this._name = spanContext.name || spanContext.description;\n this.endTimestamp = spanContext.endTimestamp;\n this.op = spanContext.op;\n this.parentSpanId = spanContext.parentSpanId;\n this._sampled = spanContext.sampled;\n this._spanId = spanContext.spanId || this._spanId;\n this.startTimestamp = spanContext.startTimestamp || this.startTimestamp;\n this.status = spanContext.status;\n // eslint-disable-next-line deprecation/deprecation\n this.tags = spanContext.tags || {};\n this._traceId = spanContext.traceId || this._traceId;\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getTraceContext(): TraceContext {\n return spanToTraceContext(this);\n }\n\n /**\n * Get JSON representation of this span.\n */\n public getSpanJSON(): SpanJSON {\n return dropUndefinedKeys({\n data: this._getData(),\n description: this._name,\n op: this.op,\n parent_span_id: this.parentSpanId,\n span_id: this._spanId,\n start_timestamp: this.startTimestamp,\n status: this.status,\n // eslint-disable-next-line deprecation/deprecation\n tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n timestamp: this.endTimestamp,\n trace_id: this._traceId,\n origin: this.origin,\n });\n }\n\n /** @inheritdoc */\n public isRecording(): boolean {\n return !this.endTimestamp && !!this._sampled;\n }\n\n /**\n * Convert the object to JSON.\n * @deprecated Use `spanToJSON(span)` instead.\n */\n public toJSON(): SpanJSON {\n return this.getSpanJSON();\n }\n\n /**\n * Get the merged data for this span.\n * For now, this combines `data` and `attributes` together,\n * until eventually we can ingest `attributes` directly.\n */\n private _getData():\n | {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n }\n | undefined {\n // eslint-disable-next-line deprecation/deprecation\n const { data, _attributes: attributes } = this;\n\n const hasData = Object.keys(data).length > 0;\n const hasAttributes = Object.keys(attributes).length > 0;\n\n if (!hasData && !hasAttributes) {\n return undefined;\n }\n\n if (hasData && hasAttributes) {\n return {\n ...data,\n ...attributes,\n };\n }\n\n return hasData ? data : attributes;\n }\n}\n\nexport type SpanStatusType =\n /** The operation completed successfully. */\n | 'ok'\n /** Deadline expired before operation could complete. */\n | 'deadline_exceeded'\n /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n | 'unauthenticated'\n /** 403 Forbidden */\n | 'permission_denied'\n /** 404 Not Found. Some requested entity (file or directory) was not found. */\n | 'not_found'\n /** 429 Too Many Requests */\n | 'resource_exhausted'\n /** Client specified an invalid argument. 4xx. */\n | 'invalid_argument'\n /** 501 Not Implemented */\n | 'unimplemented'\n /** 503 Service Unavailable */\n | 'unavailable'\n /** Other/generic 5xx. */\n | 'internal_error'\n /** Unknown. Any non-standard HTTP status code. */\n | 'unknown_error'\n /** The operation was cancelled (typically by the user). */\n | 'cancelled'\n /** Already exists (409) */\n | 'already_exists'\n /** Operation was rejected because the system is not in a state required for the operation's */\n | 'failed_precondition'\n /** The operation was aborted, typically due to a concurrency issue. */\n | 'aborted'\n /** Operation was attempted past the valid range. */\n | 'out_of_range'\n /** Unrecoverable data loss or corruption */\n | 'data_loss';\n\n/**\n * Converts a HTTP status code into a {@link SpanStatusType}.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or unknown_error.\n */\nexport function spanStatusfromHttpCode(httpStatus: number): SpanStatusType {\n if (httpStatus < 400 && httpStatus >= 100) {\n return 'ok';\n }\n\n if (httpStatus >= 400 && httpStatus < 500) {\n switch (httpStatus) {\n case 401:\n return 'unauthenticated';\n case 403:\n return 'permission_denied';\n case 404:\n return 'not_found';\n case 409:\n return 'already_exists';\n case 413:\n return 'failed_precondition';\n case 429:\n return 'resource_exhausted';\n default:\n return 'invalid_argument';\n }\n }\n\n if (httpStatus >= 500 && httpStatus < 600) {\n switch (httpStatus) {\n case 501:\n return 'unimplemented';\n case 503:\n return 'unavailable';\n case 504:\n return 'deadline_exceeded';\n default:\n return 'internal_error';\n }\n }\n\n return 'unknown_error';\n}\n","/**\n * Use this attribute to represent the source of a span.\n * Should be one of: custom, url, route, view, component, task, unknown\n *\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source';\n\n/**\n * Use this attribute to represent the sample rate used for a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate';\n","import type {\n Context,\n Contexts,\n DynamicSamplingContext,\n MeasurementUnit,\n Measurements,\n SpanTimeInput,\n Transaction as TransactionInterface,\n TransactionContext,\n TransactionEvent,\n TransactionMetadata,\n} from '@sentry/types';\nimport { dropUndefinedKeys, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes';\nimport { spanTimeInputToSeconds, spanToTraceContext } from '../utils/spanUtils';\nimport { getDynamicSamplingContextFromSpan } from './dynamicSamplingContext';\nimport { Span as SpanClass, SpanRecorder } from './span';\n\n/** JSDoc */\nexport class Transaction extends SpanClass implements TransactionInterface {\n /**\n * The reference to the current hub.\n */\n public _hub: Hub;\n\n protected _name: string;\n\n private _measurements: Measurements;\n\n private _contexts: Contexts;\n\n private _trimEnd?: boolean;\n\n // DO NOT yet remove this property, it is used in a hack for v7 backwards compatibility.\n private _frozenDynamicSamplingContext: Readonly> | undefined;\n\n private _metadata: Partial;\n\n /**\n * This constructor should never be called manually. Those instrumenting tracing should use\n * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`.\n * @internal\n * @hideconstructor\n * @hidden\n *\n * @deprecated Transactions will be removed in v8. Use spans instead.\n */\n public constructor(transactionContext: TransactionContext, hub?: Hub) {\n super(transactionContext);\n this._measurements = {};\n this._contexts = {};\n\n this._hub = hub || getCurrentHub();\n\n this._name = transactionContext.name || '';\n\n this._metadata = {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.metadata,\n };\n\n this._trimEnd = transactionContext.trimEnd;\n\n // this is because transactions are also spans, and spans have a transaction pointer\n this.transaction = this;\n\n // If Dynamic Sampling Context is provided during the creation of the transaction, we freeze it as it usually means\n // there is incoming Dynamic Sampling Context. (Either through an incoming request, a baggage meta-tag, or other means)\n const incomingDynamicSamplingContext = this._metadata.dynamicSamplingContext;\n if (incomingDynamicSamplingContext) {\n // We shallow copy this in case anything writes to the original reference of the passed in `dynamicSamplingContext`\n this._frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext };\n }\n }\n\n // This sadly conflicts with the getter/setter ordering :(\n /* eslint-disable @typescript-eslint/member-ordering */\n\n /**\n * Getter for `name` property.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public get name(): string {\n return this._name;\n }\n\n /**\n * Setter for `name` property, which also sets `source` as custom.\n * @deprecated Use `updateName()` and `setMetadata()` instead.\n */\n public set name(newName: string) {\n // eslint-disable-next-line deprecation/deprecation\n this.setName(newName);\n }\n\n /**\n * Get the metadata for this transaction.\n * @deprecated Use `spanGetMetadata(transaction)` instead.\n */\n public get metadata(): TransactionMetadata {\n // We merge attributes in for backwards compatibility\n return {\n // Defaults\n // eslint-disable-next-line deprecation/deprecation\n source: 'custom',\n spanMetadata: {},\n\n // Legacy metadata\n ...this._metadata,\n\n // From attributes\n ...(this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] && {\n source: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] as TransactionMetadata['source'],\n }),\n ...(this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE] && {\n sampleRate: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE] as TransactionMetadata['sampleRate'],\n }),\n };\n }\n\n /**\n * Update the metadata for this transaction.\n * @deprecated Use `spanGetMetadata(transaction)` instead.\n */\n public set metadata(metadata: TransactionMetadata) {\n this._metadata = metadata;\n }\n\n /* eslint-enable @typescript-eslint/member-ordering */\n\n /**\n * Setter for `name` property, which also sets `source` on the metadata.\n *\n * @deprecated Use `updateName()` and `setMetadata()` instead.\n */\n public setName(name: string, source: TransactionMetadata['source'] = 'custom'): void {\n this._name = name;\n this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);\n }\n\n /** @inheritdoc */\n public updateName(name: string): this {\n this._name = name;\n return this;\n }\n\n /**\n * Attaches SpanRecorder to the span itself\n * @param maxlen maximum number of spans that can be recorded\n */\n public initSpanRecorder(maxlen: number = 1000): void {\n if (!this.spanRecorder) {\n this.spanRecorder = new SpanRecorder(maxlen);\n }\n this.spanRecorder.add(this);\n }\n\n /**\n * Set the context of a transaction event.\n * @deprecated Use either `.setAttribute()`, or set the context on the scope before creating the transaction.\n */\n public setContext(key: string, context: Context | null): void {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts[key] = context;\n }\n }\n\n /**\n * @inheritDoc\n */\n public setMeasurement(name: string, value: number, unit: MeasurementUnit = ''): void {\n this._measurements[name] = { value, unit };\n }\n\n /**\n * Store metadata on this transaction.\n * @deprecated Use attributes or store data on the scope instead.\n */\n public setMetadata(newMetadata: Partial): void {\n this._metadata = { ...this._metadata, ...newMetadata };\n }\n\n /**\n * @inheritDoc\n */\n public end(endTimestamp?: SpanTimeInput): string | undefined {\n const timestampInS = spanTimeInputToSeconds(endTimestamp);\n const transaction = this._finishTransaction(timestampInS);\n if (!transaction) {\n return undefined;\n }\n // eslint-disable-next-line deprecation/deprecation\n return this._hub.captureEvent(transaction);\n }\n\n /**\n * @inheritDoc\n */\n public toContext(): TransactionContext {\n // eslint-disable-next-line deprecation/deprecation\n const spanContext = super.toContext();\n\n return dropUndefinedKeys({\n ...spanContext,\n name: this._name,\n trimEnd: this._trimEnd,\n });\n }\n\n /**\n * @inheritDoc\n */\n public updateWithContext(transactionContext: TransactionContext): this {\n // eslint-disable-next-line deprecation/deprecation\n super.updateWithContext(transactionContext);\n\n this._name = transactionContext.name || '';\n this._trimEnd = transactionContext.trimEnd;\n\n return this;\n }\n\n /**\n * @inheritdoc\n *\n * @experimental\n *\n * @deprecated Use top-level `getDynamicSamplingContextFromSpan` instead.\n */\n public getDynamicSamplingContext(): Readonly> {\n return getDynamicSamplingContextFromSpan(this);\n }\n\n /**\n * Override the current hub with a new one.\n * Used if you want another hub to finish the transaction.\n *\n * @internal\n */\n public setHub(hub: Hub): void {\n this._hub = hub;\n }\n\n /**\n * Finish the transaction & prepare the event to send to Sentry.\n */\n protected _finishTransaction(endTimestamp?: number): TransactionEvent | undefined {\n // This transaction is already finished, so we should not flush it again.\n if (this.endTimestamp !== undefined) {\n return undefined;\n }\n\n if (!this._name) {\n DEBUG_BUILD && logger.warn('Transaction has no name, falling back to ``.');\n this._name = '';\n }\n\n // just sets the end timestamp\n super.end(endTimestamp);\n\n const client = this._hub.getClient();\n if (client && client.emit) {\n client.emit('finishTransaction', this);\n }\n\n if (this._sampled !== true) {\n // At this point if `sampled !== true` we want to discard the transaction.\n DEBUG_BUILD && logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.');\n\n if (client) {\n client.recordDroppedEvent('sample_rate', 'transaction');\n }\n\n return undefined;\n }\n\n const finishedSpans = this.spanRecorder ? this.spanRecorder.spans.filter(s => s !== this && s.endTimestamp) : [];\n\n if (this._trimEnd && finishedSpans.length > 0) {\n this.endTimestamp = finishedSpans.reduce((prev: SpanClass, current: SpanClass) => {\n if (prev.endTimestamp && current.endTimestamp) {\n return prev.endTimestamp > current.endTimestamp ? prev : current;\n }\n return prev;\n }).endTimestamp;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n const { metadata } = this;\n // eslint-disable-next-line deprecation/deprecation\n const { source } = metadata;\n\n const transaction: TransactionEvent = {\n contexts: {\n ...this._contexts,\n // We don't want to override trace context\n trace: spanToTraceContext(this),\n },\n // TODO: Pass spans serialized via `spanToJSON()` here instead in v8.\n spans: finishedSpans,\n start_timestamp: this.startTimestamp,\n // eslint-disable-next-line deprecation/deprecation\n tags: this.tags,\n timestamp: this.endTimestamp,\n transaction: this._name,\n type: 'transaction',\n sdkProcessingMetadata: {\n ...metadata,\n dynamicSamplingContext: getDynamicSamplingContextFromSpan(this),\n },\n ...(source && {\n transaction_info: {\n source,\n },\n }),\n };\n\n const hasMeasurements = Object.keys(this._measurements).length > 0;\n\n if (hasMeasurements) {\n DEBUG_BUILD &&\n logger.log(\n '[Measurements] Adding measurements to transaction',\n JSON.stringify(this._measurements, undefined, 2),\n );\n transaction.measurements = this._measurements;\n }\n\n DEBUG_BUILD && logger.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`);\n\n return transaction;\n }\n}\n","/* eslint-disable max-lines */\nimport type { SpanTimeInput, TransactionContext } from '@sentry/types';\nimport { logger, timestampInSeconds } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { Hub } from '../hub';\nimport { spanTimeInputToSeconds } from '../utils/spanUtils';\nimport type { Span } from './span';\nimport { SpanRecorder } from './span';\nimport { Transaction } from './transaction';\n\nexport const TRACING_DEFAULTS = {\n idleTimeout: 1000,\n finalTimeout: 30000,\n heartbeatInterval: 5000,\n};\n\nconst FINISH_REASON_TAG = 'finishReason';\n\nconst IDLE_TRANSACTION_FINISH_REASONS = [\n 'heartbeatFailed',\n 'idleTimeout',\n 'documentHidden',\n 'finalTimeout',\n 'externalFinish',\n 'cancelled',\n];\n\n/**\n * @inheritDoc\n */\nexport class IdleTransactionSpanRecorder extends SpanRecorder {\n public constructor(\n private readonly _pushActivity: (id: string) => void,\n private readonly _popActivity: (id: string) => void,\n public transactionSpanId: string,\n maxlen?: number,\n ) {\n super(maxlen);\n }\n\n /**\n * @inheritDoc\n */\n public add(span: Span): void {\n // We should make sure we do not push and pop activities for\n // the transaction that this span recorder belongs to.\n if (span.spanContext().spanId !== this.transactionSpanId) {\n // We patch span.end() to pop an activity after setting an endTimestamp.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalEnd = span.end;\n span.end = (...rest: unknown[]) => {\n this._popActivity(span.spanContext().spanId);\n return originalEnd.apply(span, rest);\n };\n\n // We should only push new activities if the span does not have an end timestamp.\n if (span.endTimestamp === undefined) {\n this._pushActivity(span.spanContext().spanId);\n }\n }\n\n super.add(span);\n }\n}\n\nexport type BeforeFinishCallback = (transactionSpan: IdleTransaction, endTimestamp: number) => void;\n\n/**\n * An IdleTransaction is a transaction that automatically finishes. It does this by tracking child spans as activities.\n * You can have multiple IdleTransactions active, but if the `onScope` option is specified, the idle transaction will\n * put itself on the scope on creation.\n */\nexport class IdleTransaction extends Transaction {\n // Activities store a list of active spans\n public activities: Record;\n // Track state of activities in previous heartbeat\n private _prevHeartbeatString: string | undefined;\n\n // Amount of times heartbeat has counted. Will cause transaction to finish after 3 beats.\n private _heartbeatCounter: number;\n\n // We should not use heartbeat if we finished a transaction\n private _finished: boolean;\n\n // Idle timeout was canceled and we should finish the transaction with the last span end.\n private _idleTimeoutCanceledPermanently: boolean;\n\n private readonly _beforeFinishCallbacks: BeforeFinishCallback[];\n\n /**\n * Timer that tracks Transaction idleTimeout\n */\n private _idleTimeoutID: ReturnType | undefined;\n\n private _finishReason: (typeof IDLE_TRANSACTION_FINISH_REASONS)[number];\n\n /**\n * @deprecated Transactions will be removed in v8. Use spans instead.\n */\n public constructor(\n transactionContext: TransactionContext,\n private readonly _idleHub: Hub,\n /**\n * The time to wait in ms until the idle transaction will be finished. This timer is started each time\n * there are no active spans on this transaction.\n */\n private readonly _idleTimeout: number = TRACING_DEFAULTS.idleTimeout,\n /**\n * The final value in ms that a transaction cannot exceed\n */\n private readonly _finalTimeout: number = TRACING_DEFAULTS.finalTimeout,\n private readonly _heartbeatInterval: number = TRACING_DEFAULTS.heartbeatInterval,\n // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends\n private readonly _onScope: boolean = false,\n ) {\n super(transactionContext, _idleHub);\n\n this.activities = {};\n this._heartbeatCounter = 0;\n this._finished = false;\n this._idleTimeoutCanceledPermanently = false;\n this._beforeFinishCallbacks = [];\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[4];\n\n if (_onScope) {\n // We set the transaction here on the scope so error events pick up the trace\n // context and attach it to the error.\n DEBUG_BUILD && logger.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`);\n // eslint-disable-next-line deprecation/deprecation\n _idleHub.getScope().setSpan(this);\n }\n\n this._restartIdleTimeout();\n setTimeout(() => {\n if (!this._finished) {\n this.setStatus('deadline_exceeded');\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[3];\n this.end();\n }\n }, this._finalTimeout);\n }\n\n /** {@inheritDoc} */\n public end(endTimestamp?: SpanTimeInput): string | undefined {\n const endTimestampInS = spanTimeInputToSeconds(endTimestamp);\n\n this._finished = true;\n this.activities = {};\n\n if (this.op === 'ui.action.click') {\n this.setAttribute(FINISH_REASON_TAG, this._finishReason);\n }\n\n if (this.spanRecorder) {\n DEBUG_BUILD &&\n logger.log('[Tracing] finishing IdleTransaction', new Date(endTimestampInS * 1000).toISOString(), this.op);\n\n for (const callback of this._beforeFinishCallbacks) {\n callback(this, endTimestampInS);\n }\n\n this.spanRecorder.spans = this.spanRecorder.spans.filter((span: Span) => {\n // If we are dealing with the transaction itself, we just return it\n if (span.spanContext().spanId === this.spanContext().spanId) {\n return true;\n }\n\n // We cancel all pending spans with status \"cancelled\" to indicate the idle transaction was finished early\n if (!span.endTimestamp) {\n span.endTimestamp = endTimestampInS;\n span.setStatus('cancelled');\n DEBUG_BUILD &&\n logger.log('[Tracing] cancelling span since transaction ended early', JSON.stringify(span, undefined, 2));\n }\n\n const spanStartedBeforeTransactionFinish = span.startTimestamp < endTimestampInS;\n\n // Add a delta with idle timeout so that we prevent false positives\n const timeoutWithMarginOfError = (this._finalTimeout + this._idleTimeout) / 1000;\n const spanEndedBeforeFinalTimeout = span.endTimestamp - this.startTimestamp < timeoutWithMarginOfError;\n\n if (DEBUG_BUILD) {\n const stringifiedSpan = JSON.stringify(span, undefined, 2);\n if (!spanStartedBeforeTransactionFinish) {\n logger.log('[Tracing] discarding Span since it happened after Transaction was finished', stringifiedSpan);\n } else if (!spanEndedBeforeFinalTimeout) {\n logger.log('[Tracing] discarding Span since it finished after Transaction final timeout', stringifiedSpan);\n }\n }\n\n return spanStartedBeforeTransactionFinish && spanEndedBeforeFinalTimeout;\n });\n\n DEBUG_BUILD && logger.log('[Tracing] flushing IdleTransaction');\n } else {\n DEBUG_BUILD && logger.log('[Tracing] No active IdleTransaction');\n }\n\n // if `this._onScope` is `true`, the transaction put itself on the scope when it started\n if (this._onScope) {\n const scope = this._idleHub.getScope();\n // eslint-disable-next-line deprecation/deprecation\n if (scope.getTransaction() === this) {\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(undefined);\n }\n }\n\n return super.end(endTimestamp);\n }\n\n /**\n * Register a callback function that gets excecuted before the transaction finishes.\n * Useful for cleanup or if you want to add any additional spans based on current context.\n *\n * This is exposed because users have no other way of running something before an idle transaction\n * finishes.\n */\n public registerBeforeFinishCallback(callback: BeforeFinishCallback): void {\n this._beforeFinishCallbacks.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n public initSpanRecorder(maxlen?: number): void {\n if (!this.spanRecorder) {\n const pushActivity = (id: string): void => {\n if (this._finished) {\n return;\n }\n this._pushActivity(id);\n };\n const popActivity = (id: string): void => {\n if (this._finished) {\n return;\n }\n this._popActivity(id);\n };\n\n this.spanRecorder = new IdleTransactionSpanRecorder(pushActivity, popActivity, this.spanContext().spanId, maxlen);\n\n // Start heartbeat so that transactions do not run forever.\n DEBUG_BUILD && logger.log('Starting heartbeat');\n this._pingHeartbeat();\n }\n this.spanRecorder.add(this);\n }\n\n /**\n * Cancels the existing idle timeout, if there is one.\n * @param restartOnChildSpanChange Default is `true`.\n * If set to false the transaction will end\n * with the last child span.\n */\n public cancelIdleTimeout(\n endTimestamp?: Parameters[0],\n {\n restartOnChildSpanChange,\n }: {\n restartOnChildSpanChange?: boolean;\n } = {\n restartOnChildSpanChange: true,\n },\n ): void {\n this._idleTimeoutCanceledPermanently = restartOnChildSpanChange === false;\n if (this._idleTimeoutID) {\n clearTimeout(this._idleTimeoutID);\n this._idleTimeoutID = undefined;\n\n if (Object.keys(this.activities).length === 0 && this._idleTimeoutCanceledPermanently) {\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n this.end(endTimestamp);\n }\n }\n }\n\n /**\n * Temporary method used to externally set the transaction's `finishReason`\n *\n * ** WARNING**\n * This is for the purpose of experimentation only and will be removed in the near future, do not use!\n *\n * @internal\n *\n */\n public setFinishReason(reason: string): void {\n this._finishReason = reason;\n }\n\n /**\n * Restarts idle timeout, if there is no running idle timeout it will start one.\n */\n private _restartIdleTimeout(endTimestamp?: Parameters[0]): void {\n this.cancelIdleTimeout();\n this._idleTimeoutID = setTimeout(() => {\n if (!this._finished && Object.keys(this.activities).length === 0) {\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[1];\n this.end(endTimestamp);\n }\n }, this._idleTimeout);\n }\n\n /**\n * Start tracking a specific activity.\n * @param spanId The span id that represents the activity\n */\n private _pushActivity(spanId: string): void {\n this.cancelIdleTimeout(undefined, { restartOnChildSpanChange: !this._idleTimeoutCanceledPermanently });\n DEBUG_BUILD && logger.log(`[Tracing] pushActivity: ${spanId}`);\n this.activities[spanId] = true;\n DEBUG_BUILD && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n }\n\n /**\n * Remove an activity from usage\n * @param spanId The span id that represents the activity\n */\n private _popActivity(spanId: string): void {\n if (this.activities[spanId]) {\n DEBUG_BUILD && logger.log(`[Tracing] popActivity ${spanId}`);\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this.activities[spanId];\n DEBUG_BUILD && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n }\n\n if (Object.keys(this.activities).length === 0) {\n const endTimestamp = timestampInSeconds();\n if (this._idleTimeoutCanceledPermanently) {\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n this.end(endTimestamp);\n } else {\n // We need to add the timeout here to have the real endtimestamp of the transaction\n // Remember timestampInSeconds is in seconds, timeout is in ms\n this._restartIdleTimeout(endTimestamp + this._idleTimeout / 1000);\n }\n }\n }\n\n /**\n * Checks when entries of this.activities are not changing for 3 beats.\n * If this occurs we finish the transaction.\n */\n private _beat(): void {\n // We should not be running heartbeat if the idle transaction is finished.\n if (this._finished) {\n return;\n }\n\n const heartbeatString = Object.keys(this.activities).join('');\n\n if (heartbeatString === this._prevHeartbeatString) {\n this._heartbeatCounter++;\n } else {\n this._heartbeatCounter = 1;\n }\n\n this._prevHeartbeatString = heartbeatString;\n\n if (this._heartbeatCounter >= 3) {\n DEBUG_BUILD && logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');\n this.setStatus('deadline_exceeded');\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[0];\n this.end();\n } else {\n this._pingHeartbeat();\n }\n }\n\n /**\n * Pings the heartbeat\n */\n private _pingHeartbeat(): void {\n DEBUG_BUILD && logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`);\n setTimeout(() => {\n this._beat();\n }, this._heartbeatInterval);\n }\n}\n","import type { Transaction } from '@sentry/types';\nimport { extractTraceparentData as _extractTraceparentData } from '@sentry/utils';\n\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\n\n/**\n * Grabs active transaction off scope.\n *\n * @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.\n */\nexport function getActiveTransaction(maybeHub?: Hub): T | undefined {\n const hub = maybeHub || getCurrentHub();\n const scope = hub.getScope();\n // eslint-disable-next-line deprecation/deprecation\n return scope.getTransaction() as T | undefined;\n}\n\n// so it can be used in manual instrumentation without necessitating a hard dependency on @sentry/utils\nexport { stripUrlQueryAndFragment } from '@sentry/utils';\n\n/**\n * The `extractTraceparentData` function and `TRACEPARENT_REGEXP` constant used\n * to be declared in this file. It was later moved into `@sentry/utils` as part of a\n * move to remove `@sentry/tracing` dependencies from `@sentry/node` (`extractTraceparentData`\n * is the only tracing function used by `@sentry/node`).\n *\n * These exports are kept here for backwards compatability's sake.\n *\n * See https://github.com/getsentry/sentry-javascript/issues/4642 for more details.\n *\n * @deprecated Import this function from `@sentry/utils` instead\n */\nexport const extractTraceparentData = _extractTraceparentData;\n","import {\n addGlobalErrorInstrumentationHandler,\n addGlobalUnhandledRejectionInstrumentationHandler,\n logger,\n} from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { SpanStatusType } from './span';\nimport { getActiveTransaction } from './utils';\n\nlet errorsInstrumented = false;\n\n/**\n * Configures global error listeners\n */\nexport function registerErrorInstrumentation(): void {\n if (errorsInstrumented) {\n return;\n }\n\n errorsInstrumented = true;\n addGlobalErrorInstrumentationHandler(errorCallback);\n addGlobalUnhandledRejectionInstrumentationHandler(errorCallback);\n}\n\n/**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\nfunction errorCallback(): void {\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n if (activeTransaction) {\n const status: SpanStatusType = 'internal_error';\n DEBUG_BUILD && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n activeTransaction.setStatus(status);\n }\n}\n\n// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the\n// node.js default exit behaviour\nerrorCallback.tag = 'sentry_tracingErrorCallback';\n","import type { Options, SamplingContext } from '@sentry/types';\nimport { isNaN, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE } from '../semanticAttributes';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled';\nimport { spanToJSON } from '../utils/spanUtils';\nimport type { Transaction } from './transaction';\n\n/**\n * Makes a sampling decision for the given transaction and stores it on the transaction.\n *\n * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be\n * sent to Sentry.\n *\n * This method muttes the given `transaction` and will set the `sampled` value on it.\n * It returns the same transaction, for convenience.\n */\nexport function sampleTransaction(\n transaction: T,\n options: Pick,\n samplingContext: SamplingContext,\n): T {\n // nothing to do if tracing is not enabled\n if (!hasTracingEnabled(options)) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that\n // eslint-disable-next-line deprecation/deprecation\n if (transaction.sampled !== undefined) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(transaction.sampled));\n return transaction;\n }\n\n // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should\n // work; prefer the hook if so\n let sampleRate;\n if (typeof options.tracesSampler === 'function') {\n sampleRate = options.tracesSampler(samplingContext);\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else if (samplingContext.parentSampled !== undefined) {\n sampleRate = samplingContext.parentSampled;\n } else if (typeof options.tracesSampleRate !== 'undefined') {\n sampleRate = options.tracesSampleRate;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else {\n // When `enableTracing === true`, we use a sample rate of 100%\n sampleRate = 1;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate);\n }\n\n // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n // only valid values are booleans or numbers between 0 and 1.)\n if (!isValidSampleRate(sampleRate)) {\n DEBUG_BUILD && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped\n if (!sampleRate) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because ${\n typeof options.tracesSampler === 'function'\n ? 'tracesSampler returned 0 or false'\n : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'\n }`,\n );\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = Math.random() < (sampleRate as number | boolean);\n\n // if we're not going to keep it, we're done\n // eslint-disable-next-line deprecation/deprecation\n if (!transaction.sampled) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(\n sampleRate,\n )})`,\n );\n return transaction;\n }\n\n DEBUG_BUILD &&\n logger.log(`[Tracing] starting ${transaction.op} transaction - ${spanToJSON(transaction).description}`);\n return transaction;\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nfunction isValidSampleRate(rate: unknown): boolean {\n // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n rate,\n )} of type ${JSON.stringify(typeof rate)}.`,\n );\n return false;\n }\n\n // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n if (rate < 0 || rate > 1) {\n DEBUG_BUILD &&\n logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);\n return false;\n }\n return true;\n}\n","import type { ClientOptions, CustomSamplingContext, TransactionContext } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { Hub } from '../hub';\nimport { getMainCarrier } from '../hub';\nimport { spanToTraceHeader } from '../utils/spanUtils';\nimport { registerErrorInstrumentation } from './errors';\nimport { IdleTransaction } from './idletransaction';\nimport { sampleTransaction } from './sampling';\nimport { Transaction } from './transaction';\n\n/** Returns all trace headers that are currently on the top scope. */\nfunction traceHeaders(this: Hub): { [key: string]: string } {\n const scope = this.getScope();\n // eslint-disable-next-line deprecation/deprecation\n const span = scope.getSpan();\n\n return span\n ? {\n 'sentry-trace': spanToTraceHeader(span),\n }\n : {};\n}\n\n/**\n * Creates a new transaction and adds a sampling decision if it doesn't yet have one.\n *\n * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if\n * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an\n * \"extension method.\"\n *\n * @param this: The Hub starting the transaction\n * @param transactionContext: Data used to configure the transaction\n * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)\n *\n * @returns The new transaction\n *\n * @see {@link Hub.startTransaction}\n */\nfunction _startTransaction(\n this: Hub,\n transactionContext: TransactionContext,\n customSamplingContext?: CustomSamplingContext,\n): Transaction {\n const client = this.getClient();\n const options: Partial = (client && client.getOptions()) || {};\n\n const configInstrumenter = options.instrumenter || 'sentry';\n const transactionInstrumenter = transactionContext.instrumenter || 'sentry';\n\n if (configInstrumenter !== transactionInstrumenter) {\n DEBUG_BUILD &&\n logger.error(\n `A transaction was started with instrumenter=\\`${transactionInstrumenter}\\`, but the SDK is configured with the \\`${configInstrumenter}\\` instrumenter.\nThe transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,\n );\n\n // eslint-disable-next-line deprecation/deprecation\n transactionContext.sampled = false;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new Transaction(transactionContext, this);\n transaction = sampleTransaction(transaction, options, {\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans as number));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Create new idle transaction.\n */\nexport function startIdleTransaction(\n hub: Hub,\n transactionContext: TransactionContext,\n idleTimeout: number,\n finalTimeout: number,\n onScope?: boolean,\n customSamplingContext?: CustomSamplingContext,\n heartbeatInterval?: number,\n): IdleTransaction {\n const client = hub.getClient();\n const options: Partial = (client && client.getOptions()) || {};\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new IdleTransaction(transactionContext, hub, idleTimeout, finalTimeout, heartbeatInterval, onScope);\n transaction = sampleTransaction(transaction, options, {\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans as number));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Adds tracing extensions to the global hub.\n */\nexport function addTracingExtensions(): void {\n const carrier = getMainCarrier();\n if (!carrier.__SENTRY__) {\n return;\n }\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (!carrier.__SENTRY__.extensions.startTransaction) {\n carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n }\n if (!carrier.__SENTRY__.extensions.traceHeaders) {\n carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n }\n\n registerErrorInstrumentation();\n}\n","declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n","import { GLOBAL_OBJ } from '@sentry/utils';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Metric, ReportCallback } from '../types';\n\nexport const bindReporter = (\n callback: ReportCallback,\n metric: Metric,\n reportAllChanges?: boolean,\n): ((forceReport?: boolean) => void) => {\n let prevValue: number;\n let delta: number;\n return (forceReport?: boolean) => {\n if (metric.value >= 0) {\n if (forceReport || reportAllChanges) {\n delta = metric.value - (prevValue || 0);\n\n // Report the metric if there's a non-zero delta or if no previous\n // value exists (which can happen in the case of the document becoming\n // hidden when the metric value is 0).\n // See: https://github.com/GoogleChrome/web-vitals/issues/14\n if (delta || prevValue === undefined) {\n prevValue = metric.value;\n metric.delta = delta;\n callback(metric);\n }\n }\n }\n };\n};\n","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport type { NavigationTimingPolyfillEntry } from '../types';\n\nconst getNavigationEntryFromPerformanceTiming = (): NavigationTimingPolyfillEntry => {\n // eslint-disable-next-line deprecation/deprecation\n const timing = WINDOW.performance.timing;\n // eslint-disable-next-line deprecation/deprecation\n const type = WINDOW.performance.navigation.type;\n\n const navigationEntry: { [key: string]: number | string } = {\n entryType: 'navigation',\n startTime: 0,\n type: type == 2 ? 'back_forward' : type === 1 ? 'reload' : 'navigate',\n };\n\n for (const key in timing) {\n if (key !== 'navigationStart' && key !== 'toJSON') {\n // eslint-disable-next-line deprecation/deprecation\n navigationEntry[key] = Math.max((timing[key as keyof PerformanceTiming] as number) - timing.navigationStart, 0);\n }\n }\n return navigationEntry as unknown as NavigationTimingPolyfillEntry;\n};\n\nexport const getNavigationEntry = (): PerformanceNavigationTiming | NavigationTimingPolyfillEntry | undefined => {\n if (WINDOW.__WEB_VITALS_POLYFILL__) {\n return (\n WINDOW.performance &&\n ((performance.getEntriesByType && performance.getEntriesByType('navigation')[0]) ||\n getNavigationEntryFromPerformanceTiming())\n );\n } else {\n return WINDOW.performance && performance.getEntriesByType && performance.getEntriesByType('navigation')[0];\n }\n};\n","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getNavigationEntry } from './getNavigationEntry';\n\nexport const getActivationStart = (): number => {\n const navEntry = getNavigationEntry();\n return (navEntry && navEntry.activationStart) || 0;\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport type { Metric } from '../types';\nimport { generateUniqueID } from './generateUniqueID';\nimport { getActivationStart } from './getActivationStart';\nimport { getNavigationEntry } from './getNavigationEntry';\n\nexport const initMetric = (name: Metric['name'], value?: number): Metric => {\n const navEntry = getNavigationEntry();\n let navigationType: Metric['navigationType'] = 'navigate';\n\n if (navEntry) {\n if (WINDOW.document.prerendering || getActivationStart() > 0) {\n navigationType = 'prerender';\n } else {\n navigationType = navEntry.type.replace(/_/g, '-') as Metric['navigationType'];\n }\n }\n\n return {\n name,\n value: typeof value === 'undefined' ? -1 : value,\n rating: 'good', // Will be updated if the value changes.\n delta: 0,\n entries: [],\n id: generateUniqueID(),\n navigationType,\n };\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Performantly generate a unique, 30-char string by combining a version\n * number, the current timestamp with a 13-digit number integer.\n * @return {string}\n */\nexport const generateUniqueID = (): string => {\n return `v3-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FirstInputPolyfillEntry, NavigationTimingPolyfillEntry, PerformancePaintTiming } from '../types';\n\nexport interface PerformanceEntryHandler {\n (entry: PerformanceEntry): void;\n}\n\ninterface PerformanceEntryMap {\n event: PerformanceEventTiming[];\n paint: PerformancePaintTiming[];\n 'layout-shift': LayoutShift[];\n 'largest-contentful-paint': LargestContentfulPaint[];\n 'first-input': PerformanceEventTiming[] | FirstInputPolyfillEntry[];\n navigation: PerformanceNavigationTiming[] | NavigationTimingPolyfillEntry[];\n resource: PerformanceResourceTiming[];\n longtask: PerformanceEntry[];\n}\n\n/**\n * Takes a performance entry type and a callback function, and creates a\n * `PerformanceObserver` instance that will observe the specified entry type\n * with buffering enabled and call the callback _for each entry_.\n *\n * This function also feature-detects entry support and wraps the logic in a\n * try/catch to avoid errors in unsupporting browsers.\n */\nexport const observe = (\n type: K,\n callback: (entries: PerformanceEntryMap[K]) => void,\n opts?: PerformanceObserverInit,\n): PerformanceObserver | undefined => {\n try {\n if (PerformanceObserver.supportedEntryTypes.includes(type)) {\n const po = new PerformanceObserver(list => {\n callback(list.getEntries() as PerformanceEntryMap[K]);\n });\n po.observe(\n Object.assign(\n {\n type,\n buffered: true,\n },\n opts || {},\n ) as PerformanceObserverInit,\n );\n return po;\n }\n } catch (e) {\n // Do nothing.\n }\n return;\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\n\nexport interface OnHiddenCallback {\n (event: Event): void;\n}\n\nexport const onHidden = (cb: OnHiddenCallback, once?: boolean): void => {\n const onHiddenOrPageHide = (event: Event): void => {\n if (event.type === 'pagehide' || WINDOW.document.visibilityState === 'hidden') {\n cb(event);\n if (once) {\n removeEventListener('visibilitychange', onHiddenOrPageHide, true);\n removeEventListener('pagehide', onHiddenOrPageHide, true);\n }\n }\n };\n addEventListener('visibilitychange', onHiddenOrPageHide, true);\n // Some browsers have buggy implementations of visibilitychange,\n // so we use pagehide in addition, just to be safe.\n addEventListener('pagehide', onHiddenOrPageHide, true);\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { CLSMetric, ReportCallback, StopListening } from './types';\n\n/**\n * Calculates the [CLS](https://web.dev/cls/) value for the current page and\n * calls the `callback` function once the value is ready to be reported, along\n * with all `layout-shift` performance entries that were used in the metric\n * value calculation. The reported value is a `double` (corresponding to a\n * [layout shift score](https://web.dev/cls/#layout-shift-score)).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** CLS should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nexport const onCLS = (onReport: ReportCallback): StopListening | undefined => {\n const metric = initMetric('CLS', 0);\n let report: ReturnType;\n\n let sessionValue = 0;\n let sessionEntries: PerformanceEntry[] = [];\n\n // const handleEntries = (entries: Metric['entries']) => {\n const handleEntries = (entries: LayoutShift[]): void => {\n entries.forEach(entry => {\n // Only count layout shifts without recent user input.\n if (!entry.hadRecentInput) {\n const firstSessionEntry = sessionEntries[0];\n const lastSessionEntry = sessionEntries[sessionEntries.length - 1];\n\n // If the entry occurred less than 1 second after the previous entry and\n // less than 5 seconds after the first entry in the session, include the\n // entry in the current session. Otherwise, start a new session.\n if (\n sessionValue &&\n sessionEntries.length !== 0 &&\n entry.startTime - lastSessionEntry.startTime < 1000 &&\n entry.startTime - firstSessionEntry.startTime < 5000\n ) {\n sessionValue += entry.value;\n sessionEntries.push(entry);\n } else {\n sessionValue = entry.value;\n sessionEntries = [entry];\n }\n\n // If the current session value is larger than the current CLS value,\n // update CLS and the entries contributing to it.\n if (sessionValue > metric.value) {\n metric.value = sessionValue;\n metric.entries = sessionEntries;\n if (report) {\n report();\n }\n }\n }\n });\n };\n\n const po = observe('layout-shift', handleEntries);\n if (po) {\n report = bindReporter(onReport, metric);\n\n const stopListening = (): void => {\n handleEntries(po.takeRecords() as CLSMetric['entries']);\n report(true);\n };\n\n onHidden(stopListening);\n\n return stopListening;\n }\n\n return;\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport { onHidden } from './onHidden';\n\nlet firstHiddenTime = -1;\n\nconst initHiddenTime = (): number => {\n // If the document is hidden and not prerendering, assume it was always\n // hidden and the page was loaded in the background.\n return WINDOW.document.visibilityState === 'hidden' && !WINDOW.document.prerendering ? 0 : Infinity;\n};\n\nconst trackChanges = (): void => {\n // Update the time if/when the document becomes hidden.\n onHidden(({ timeStamp }) => {\n firstHiddenTime = timeStamp;\n }, true);\n};\n\nexport const getVisibilityWatcher = (): {\n readonly firstHiddenTime: number;\n} => {\n if (firstHiddenTime < 0) {\n // If the document is hidden when this code runs, assume it was hidden\n // since navigation start. This isn't a perfect heuristic, but it's the\n // best we can do until an API is available to support querying past\n // visibilityState.\n firstHiddenTime = initHiddenTime();\n trackChanges();\n }\n return {\n get firstHiddenTime() {\n return firstHiddenTime;\n },\n };\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { FIDMetric, PerformanceEventTiming, ReportCallback } from './types';\n\n/**\n * Calculates the [FID](https://web.dev/fid/) value for the current page and\n * calls the `callback` function once the value is ready, along with the\n * relevant `first-input` performance entry used to determine the value. The\n * reported value is a `DOMHighResTimeStamp`.\n *\n * _**Important:** since FID is only reported after the user interacts with the\n * page, it's possible that it will not be reported for some page loads._\n */\nexport const onFID = (onReport: ReportCallback): void => {\n const visibilityWatcher = getVisibilityWatcher();\n const metric = initMetric('FID');\n // eslint-disable-next-line prefer-const\n let report: ReturnType;\n\n const handleEntry = (entry: PerformanceEventTiming): void => {\n // Only report if the page wasn't hidden prior to the first input.\n if (entry.startTime < visibilityWatcher.firstHiddenTime) {\n metric.value = entry.processingStart - entry.startTime;\n metric.entries.push(entry);\n report(true);\n }\n };\n\n const handleEntries = (entries: FIDMetric['entries']): void => {\n (entries as PerformanceEventTiming[]).forEach(handleEntry);\n };\n\n const po = observe('first-input', handleEntries);\n report = bindReporter(onReport, metric);\n\n if (po) {\n onHidden(() => {\n handleEntries(po.takeRecords() as FIDMetric['entries']);\n po.disconnect();\n }, true);\n }\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { getActivationStart } from './lib/getActivationStart';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { LCPMetric, ReportCallback, StopListening } from './types';\n\nconst reportedMetricIDs: Record = {};\n\n/**\n * Calculates the [LCP](https://web.dev/lcp/) value for the current page and\n * calls the `callback` function once the value is ready (along with the\n * relevant `largest-contentful-paint` performance entry used to determine the\n * value). The reported value is a `DOMHighResTimeStamp`.\n */\nexport const onLCP = (onReport: ReportCallback): StopListening | undefined => {\n const visibilityWatcher = getVisibilityWatcher();\n const metric = initMetric('LCP');\n let report: ReturnType;\n\n const handleEntries = (entries: LCPMetric['entries']): void => {\n const lastEntry = entries[entries.length - 1] as LargestContentfulPaint;\n if (lastEntry) {\n // The startTime attribute returns the value of the renderTime if it is\n // not 0, and the value of the loadTime otherwise. The activationStart\n // reference is used because LCP should be relative to page activation\n // rather than navigation start if the page was prerendered.\n const value = Math.max(lastEntry.startTime - getActivationStart(), 0);\n\n // Only report if the page wasn't hidden prior to LCP.\n if (value < visibilityWatcher.firstHiddenTime) {\n metric.value = value;\n metric.entries = [lastEntry];\n report();\n }\n }\n };\n\n const po = observe('largest-contentful-paint', handleEntries);\n\n if (po) {\n report = bindReporter(onReport, metric);\n\n const stopListening = (): void => {\n if (!reportedMetricIDs[metric.id]) {\n handleEntries(po.takeRecords() as LCPMetric['entries']);\n po.disconnect();\n reportedMetricIDs[metric.id] = true;\n report(true);\n }\n };\n\n // Stop listening after input. Note: while scrolling is an input that\n // stop LCP observation, it's unreliable since it can be programmatically\n // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75\n ['keydown', 'click'].forEach(type => {\n addEventListener(type, stopListening, { once: true, capture: true });\n });\n\n onHidden(stopListening, true);\n\n return stopListening;\n }\n\n return;\n};\n","import { getFunctionName, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport { onCLS } from './web-vitals/getCLS';\nimport { onFID } from './web-vitals/getFID';\nimport { onLCP } from './web-vitals/getLCP';\nimport { observe } from './web-vitals/lib/observe';\n\ntype InstrumentHandlerTypePerformanceObserver = 'longtask' | 'event' | 'navigation' | 'paint' | 'resource';\n\ntype InstrumentHandlerTypeMetric = 'cls' | 'lcp' | 'fid';\n\n// We provide this here manually instead of relying on a global, as this is not available in non-browser environements\n// And we do not want to expose such types\ninterface PerformanceEntry {\n readonly duration: number;\n readonly entryType: string;\n readonly name: string;\n readonly startTime: number;\n toJSON(): Record;\n}\n\ninterface Metric {\n /**\n * The name of the metric (in acronym form).\n */\n name: 'CLS' | 'FCP' | 'FID' | 'INP' | 'LCP' | 'TTFB';\n\n /**\n * The current value of the metric.\n */\n value: number;\n\n /**\n * The rating as to whether the metric value is within the \"good\",\n * \"needs improvement\", or \"poor\" thresholds of the metric.\n */\n rating: 'good' | 'needs-improvement' | 'poor';\n\n /**\n * The delta between the current value and the last-reported value.\n * On the first report, `delta` and `value` will always be the same.\n */\n delta: number;\n\n /**\n * A unique ID representing this particular metric instance. This ID can\n * be used by an analytics tool to dedupe multiple values sent for the same\n * metric instance, or to group multiple deltas together and calculate a\n * total. It can also be used to differentiate multiple different metric\n * instances sent from the same page, which can happen if the page is\n * restored from the back/forward cache (in that case new metrics object\n * get created).\n */\n id: string;\n\n /**\n * Any performance entries relevant to the metric value calculation.\n * The array may also be empty if the metric value was not based on any\n * entries (e.g. a CLS value of 0 given no layout shifts).\n */\n entries: PerformanceEntry[];\n\n /**\n * The type of navigation\n *\n * Navigation Timing API (or `undefined` if the browser doesn't\n * support that API). For pages that are restored from the bfcache, this\n * value will be 'back-forward-cache'.\n */\n navigationType: 'navigate' | 'reload' | 'back-forward' | 'back-forward-cache' | 'prerender';\n}\n\ntype InstrumentHandlerType = InstrumentHandlerTypeMetric | InstrumentHandlerTypePerformanceObserver;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype InstrumentHandlerCallback = (data: any) => void;\n\ntype CleanupHandlerCallback = () => void;\n\nconst handlers: { [key in InstrumentHandlerType]?: InstrumentHandlerCallback[] } = {};\nconst instrumented: { [key in InstrumentHandlerType]?: boolean } = {};\n\nlet _previousCls: Metric | undefined;\nlet _previousFid: Metric | undefined;\nlet _previousLcp: Metric | undefined;\n\n/**\n * Add a callback that will be triggered when a CLS metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nexport function addClsInstrumentationHandler(callback: (data: { metric: Metric }) => void): CleanupHandlerCallback {\n return addMetricObserver('cls', callback, instrumentCls, _previousCls);\n}\n\n/**\n * Add a callback that will be triggered when a LCP metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nexport function addLcpInstrumentationHandler(callback: (data: { metric: Metric }) => void): CleanupHandlerCallback {\n return addMetricObserver('lcp', callback, instrumentLcp, _previousLcp);\n}\n\n/**\n * Add a callback that will be triggered when a FID metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nexport function addFidInstrumentationHandler(callback: (data: { metric: Metric }) => void): CleanupHandlerCallback {\n return addMetricObserver('fid', callback, instrumentFid, _previousFid);\n}\n\nexport function addPerformanceInstrumentationHandler(\n type: 'event',\n callback: (data: { entries: (PerformanceEntry & { target?: unknown | null })[] }) => void,\n): CleanupHandlerCallback;\nexport function addPerformanceInstrumentationHandler(\n type: InstrumentHandlerTypePerformanceObserver,\n callback: (data: { entries: PerformanceEntry[] }) => void,\n): CleanupHandlerCallback;\n\n/**\n * Add a callback that will be triggered when a performance observer is triggered,\n * and receives the entries of the observer.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nexport function addPerformanceInstrumentationHandler(\n type: InstrumentHandlerTypePerformanceObserver,\n callback: (data: { entries: PerformanceEntry[] }) => void,\n): CleanupHandlerCallback {\n addHandler(type, callback);\n\n if (!instrumented[type]) {\n instrumentPerformanceObserver(type);\n instrumented[type] = true;\n }\n\n return getCleanupCallback(type, callback);\n}\n\n/** Trigger all handlers of a given type. */\nfunction triggerHandlers(type: InstrumentHandlerType, data: unknown): void {\n const typeHandlers = handlers[type];\n\n if (!typeHandlers || !typeHandlers.length) {\n return;\n }\n\n for (const handler of typeHandlers) {\n try {\n handler(data);\n } catch (e) {\n DEBUG_BUILD &&\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n e,\n );\n }\n }\n}\n\nfunction instrumentCls(): void {\n onCLS(metric => {\n triggerHandlers('cls', {\n metric,\n });\n _previousCls = metric;\n });\n}\n\nfunction instrumentFid(): void {\n onFID(metric => {\n triggerHandlers('fid', {\n metric,\n });\n _previousFid = metric;\n });\n}\n\nfunction instrumentLcp(): void {\n onLCP(metric => {\n triggerHandlers('lcp', {\n metric,\n });\n _previousLcp = metric;\n });\n}\n\nfunction addMetricObserver(\n type: InstrumentHandlerTypeMetric,\n callback: InstrumentHandlerCallback,\n instrumentFn: () => void,\n previousValue: Metric | undefined,\n): CleanupHandlerCallback {\n addHandler(type, callback);\n\n if (!instrumented[type]) {\n instrumentFn();\n instrumented[type] = true;\n }\n\n if (previousValue) {\n callback({ metric: previousValue });\n }\n\n return getCleanupCallback(type, callback);\n}\n\nfunction instrumentPerformanceObserver(type: InstrumentHandlerTypePerformanceObserver): void {\n const options: PerformanceObserverInit = {};\n\n // Special per-type options we want to use\n if (type === 'event') {\n options.durationThreshold = 0;\n }\n\n observe(\n type,\n entries => {\n triggerHandlers(type, { entries });\n },\n options,\n );\n}\n\nfunction addHandler(type: InstrumentHandlerType, handler: InstrumentHandlerCallback): void {\n handlers[type] = handlers[type] || [];\n (handlers[type] as InstrumentHandlerCallback[]).push(handler);\n}\n\n// Get a callback which can be called to remove the instrumentation handler\nfunction getCleanupCallback(type: InstrumentHandlerType, callback: InstrumentHandlerCallback): CleanupHandlerCallback {\n return () => {\n const typeHandlers = handlers[type];\n\n if (!typeHandlers) {\n return;\n }\n\n const index = typeHandlers.indexOf(callback);\n if (index !== -1) {\n typeHandlers.splice(index, 1);\n }\n };\n}\n","import type { Transaction } from '@sentry/core';\nimport type { Span, SpanContext } from '@sentry/types';\n\n/**\n * Checks if a given value is a valid measurement value.\n */\nexport function isMeasurementValue(value: unknown): value is number {\n return typeof value === 'number' && isFinite(value);\n}\n\n/**\n * Helper function to start child on transactions. This function will make sure that the transaction will\n * use the start timestamp of the created child span if it is earlier than the transactions actual\n * start timestamp.\n */\nexport function _startChild(transaction: Transaction, { startTimestamp, ...ctx }: SpanContext): Span {\n if (startTimestamp && transaction.startTimestamp > startTimestamp) {\n transaction.startTimestamp = startTimestamp;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return transaction.startChild({\n startTimestamp,\n ...ctx,\n });\n}\n","/* eslint-disable max-lines */\nimport type { IdleTransaction, Transaction } from '@sentry/core';\nimport { getActiveTransaction } from '@sentry/core';\nimport type { Measurements, SpanContext } from '@sentry/types';\nimport { browserPerformanceTimeOrigin, getComponentName, htmlTreeAsString, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../../common/debug-build';\nimport {\n addClsInstrumentationHandler,\n addFidInstrumentationHandler,\n addLcpInstrumentationHandler,\n addPerformanceInstrumentationHandler,\n} from '../instrument';\nimport { WINDOW } from '../types';\nimport { getVisibilityWatcher } from '../web-vitals/lib/getVisibilityWatcher';\nimport type { NavigatorDeviceMemory, NavigatorNetworkInformation } from '../web-vitals/types';\nimport { _startChild, isMeasurementValue } from './utils';\n\nconst MAX_INT_AS_BYTES = 2147483647;\n\n/**\n * Converts from milliseconds to seconds\n * @param time time in ms\n */\nfunction msToSec(time: number): number {\n return time / 1000;\n}\n\nfunction getBrowserPerformanceAPI(): Performance | undefined {\n // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are\n return WINDOW && WINDOW.addEventListener && WINDOW.performance;\n}\n\nlet _performanceCursor: number = 0;\n\nlet _measurements: Measurements = {};\nlet _lcpEntry: LargestContentfulPaint | undefined;\nlet _clsEntry: LayoutShift | undefined;\n\n/**\n * Start tracking web vitals\n *\n * @returns A function that forces web vitals collection\n */\nexport function startTrackingWebVitals(): () => void {\n const performance = getBrowserPerformanceAPI();\n if (performance && browserPerformanceTimeOrigin) {\n // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are\n if (performance.mark) {\n WINDOW.performance.mark('sentry-tracing-init');\n }\n const fidCallback = _trackFID();\n const clsCallback = _trackCLS();\n const lcpCallback = _trackLCP();\n\n return (): void => {\n fidCallback();\n clsCallback();\n lcpCallback();\n };\n }\n\n return () => undefined;\n}\n\n/**\n * Start tracking long tasks.\n */\nexport function startTrackingLongTasks(): void {\n addPerformanceInstrumentationHandler('longtask', ({ entries }) => {\n for (const entry of entries) {\n // eslint-disable-next-line deprecation/deprecation\n const transaction = getActiveTransaction() as IdleTransaction | undefined;\n if (!transaction) {\n return;\n }\n const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n const duration = msToSec(entry.duration);\n\n // eslint-disable-next-line deprecation/deprecation\n transaction.startChild({\n description: 'Main UI thread blocked',\n op: 'ui.long-task',\n origin: 'auto.ui.browser.metrics',\n startTimestamp: startTime,\n endTimestamp: startTime + duration,\n });\n }\n });\n}\n\n/**\n * Start tracking interaction events.\n */\nexport function startTrackingInteractions(): void {\n addPerformanceInstrumentationHandler('event', ({ entries }) => {\n for (const entry of entries) {\n // eslint-disable-next-line deprecation/deprecation\n const transaction = getActiveTransaction() as IdleTransaction | undefined;\n if (!transaction) {\n return;\n }\n\n if (entry.name === 'click') {\n const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n const duration = msToSec(entry.duration);\n\n const span: SpanContext = {\n description: htmlTreeAsString(entry.target),\n op: `ui.interaction.${entry.name}`,\n origin: 'auto.ui.browser.metrics',\n startTimestamp: startTime,\n endTimestamp: startTime + duration,\n };\n\n const componentName = getComponentName(entry.target);\n if (componentName) {\n span.attributes = { 'ui.component_name': componentName };\n }\n\n // eslint-disable-next-line deprecation/deprecation\n transaction.startChild(span);\n }\n }\n });\n}\n\n/** Starts tracking the Cumulative Layout Shift on the current page. */\nfunction _trackCLS(): () => void {\n return addClsInstrumentationHandler(({ metric }) => {\n const entry = metric.entries.pop();\n if (!entry) {\n return;\n }\n\n DEBUG_BUILD && logger.log('[Measurements] Adding CLS');\n _measurements['cls'] = { value: metric.value, unit: '' };\n _clsEntry = entry as LayoutShift;\n });\n}\n\n/** Starts tracking the Largest Contentful Paint on the current page. */\nfunction _trackLCP(): () => void {\n return addLcpInstrumentationHandler(({ metric }) => {\n const entry = metric.entries.pop();\n if (!entry) {\n return;\n }\n\n DEBUG_BUILD && logger.log('[Measurements] Adding LCP');\n _measurements['lcp'] = { value: metric.value, unit: 'millisecond' };\n _lcpEntry = entry as LargestContentfulPaint;\n });\n}\n\n/** Starts tracking the First Input Delay on the current page. */\nfunction _trackFID(): () => void {\n return addFidInstrumentationHandler(({ metric }) => {\n const entry = metric.entries.pop();\n if (!entry) {\n return;\n }\n\n const timeOrigin = msToSec(browserPerformanceTimeOrigin as number);\n const startTime = msToSec(entry.startTime);\n DEBUG_BUILD && logger.log('[Measurements] Adding FID');\n _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n });\n}\n\n/** Add performance related spans to a transaction */\nexport function addPerformanceEntries(transaction: Transaction): void {\n const performance = getBrowserPerformanceAPI();\n if (!performance || !WINDOW.performance.getEntries || !browserPerformanceTimeOrigin) {\n // Gatekeeper if performance API not available\n return;\n }\n\n DEBUG_BUILD && logger.log('[Tracing] Adding & adjusting spans using Performance API');\n const timeOrigin = msToSec(browserPerformanceTimeOrigin);\n\n const performanceEntries = performance.getEntries();\n\n let responseStartTimestamp: number | undefined;\n let requestStartTimestamp: number | undefined;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n performanceEntries.slice(_performanceCursor).forEach((entry: Record) => {\n const startTime = msToSec(entry.startTime);\n const duration = msToSec(entry.duration);\n\n if (transaction.op === 'navigation' && timeOrigin + startTime < transaction.startTimestamp) {\n return;\n }\n\n switch (entry.entryType) {\n case 'navigation': {\n _addNavigationSpans(transaction, entry, timeOrigin);\n responseStartTimestamp = timeOrigin + msToSec(entry.responseStart);\n requestStartTimestamp = timeOrigin + msToSec(entry.requestStart);\n break;\n }\n case 'mark':\n case 'paint':\n case 'measure': {\n _addMeasureSpans(transaction, entry, startTime, duration, timeOrigin);\n\n // capture web vitals\n const firstHidden = getVisibilityWatcher();\n // Only report if the page wasn't hidden prior to the web vital.\n const shouldRecord = entry.startTime < firstHidden.firstHiddenTime;\n\n if (entry.name === 'first-paint' && shouldRecord) {\n DEBUG_BUILD && logger.log('[Measurements] Adding FP');\n _measurements['fp'] = { value: entry.startTime, unit: 'millisecond' };\n }\n if (entry.name === 'first-contentful-paint' && shouldRecord) {\n DEBUG_BUILD && logger.log('[Measurements] Adding FCP');\n _measurements['fcp'] = { value: entry.startTime, unit: 'millisecond' };\n }\n break;\n }\n case 'resource': {\n const resourceName = (entry.name as string).replace(WINDOW.location.origin, '');\n _addResourceSpans(transaction, entry, resourceName, startTime, duration, timeOrigin);\n break;\n }\n default:\n // Ignore other entry types.\n }\n });\n\n _performanceCursor = Math.max(performanceEntries.length - 1, 0);\n\n _trackNavigator(transaction);\n\n // Measurements are only available for pageload transactions\n if (transaction.op === 'pageload') {\n // Generate TTFB (Time to First Byte), which measured as the time between the beginning of the transaction and the\n // start of the response in milliseconds\n if (typeof responseStartTimestamp === 'number') {\n DEBUG_BUILD && logger.log('[Measurements] Adding TTFB');\n _measurements['ttfb'] = {\n value: (responseStartTimestamp - transaction.startTimestamp) * 1000,\n unit: 'millisecond',\n };\n\n if (typeof requestStartTimestamp === 'number' && requestStartTimestamp <= responseStartTimestamp) {\n // Capture the time spent making the request and receiving the first byte of the response.\n // This is the time between the start of the request and the start of the response in milliseconds.\n _measurements['ttfb.requestTime'] = {\n value: (responseStartTimestamp - requestStartTimestamp) * 1000,\n unit: 'millisecond',\n };\n }\n }\n\n ['fcp', 'fp', 'lcp'].forEach(name => {\n if (!_measurements[name] || timeOrigin >= transaction.startTimestamp) {\n return;\n }\n // The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin.\n // Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need\n // to be adjusted to be relative to transaction.startTimestamp.\n const oldValue = _measurements[name].value;\n const measurementTimestamp = timeOrigin + msToSec(oldValue);\n\n // normalizedValue should be in milliseconds\n const normalizedValue = Math.abs((measurementTimestamp - transaction.startTimestamp) * 1000);\n const delta = normalizedValue - oldValue;\n\n DEBUG_BUILD && logger.log(`[Measurements] Normalized ${name} from ${oldValue} to ${normalizedValue} (${delta})`);\n _measurements[name].value = normalizedValue;\n });\n\n const fidMark = _measurements['mark.fid'];\n if (fidMark && _measurements['fid']) {\n // create span for FID\n _startChild(transaction, {\n description: 'first input delay',\n endTimestamp: fidMark.value + msToSec(_measurements['fid'].value),\n op: 'ui.action',\n origin: 'auto.ui.browser.metrics',\n startTimestamp: fidMark.value,\n });\n\n // Delete mark.fid as we don't want it to be part of final payload\n delete _measurements['mark.fid'];\n }\n\n // If FCP is not recorded we should not record the cls value\n // according to the new definition of CLS.\n if (!('fcp' in _measurements)) {\n delete _measurements.cls;\n }\n\n Object.keys(_measurements).forEach(measurementName => {\n transaction.setMeasurement(\n measurementName,\n _measurements[measurementName].value,\n _measurements[measurementName].unit,\n );\n });\n\n _tagMetricInfo(transaction);\n }\n\n _lcpEntry = undefined;\n _clsEntry = undefined;\n _measurements = {};\n}\n\n/** Create measure related spans */\nexport function _addMeasureSpans(\n transaction: Transaction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n entry: Record,\n startTime: number,\n duration: number,\n timeOrigin: number,\n): number {\n const measureStartTimestamp = timeOrigin + startTime;\n const measureEndTimestamp = measureStartTimestamp + duration;\n\n _startChild(transaction, {\n description: entry.name as string,\n endTimestamp: measureEndTimestamp,\n op: entry.entryType as string,\n origin: 'auto.resource.browser.metrics',\n startTimestamp: measureStartTimestamp,\n });\n\n return measureStartTimestamp;\n}\n\n/** Instrument navigation entries */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addNavigationSpans(transaction: Transaction, entry: Record, timeOrigin: number): void {\n ['unloadEvent', 'redirect', 'domContentLoadedEvent', 'loadEvent', 'connect'].forEach(event => {\n _addPerformanceNavigationTiming(transaction, entry, event, timeOrigin);\n });\n _addPerformanceNavigationTiming(transaction, entry, 'secureConnection', timeOrigin, 'TLS/SSL', 'connectEnd');\n _addPerformanceNavigationTiming(transaction, entry, 'fetch', timeOrigin, 'cache', 'domainLookupStart');\n _addPerformanceNavigationTiming(transaction, entry, 'domainLookup', timeOrigin, 'DNS');\n _addRequest(transaction, entry, timeOrigin);\n}\n\n/** Create performance navigation related spans */\nfunction _addPerformanceNavigationTiming(\n transaction: Transaction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n entry: Record,\n event: string,\n timeOrigin: number,\n description?: string,\n eventEnd?: string,\n): void {\n const end = eventEnd ? (entry[eventEnd] as number | undefined) : (entry[`${event}End`] as number | undefined);\n const start = entry[`${event}Start`] as number | undefined;\n if (!start || !end) {\n return;\n }\n _startChild(transaction, {\n op: 'browser',\n origin: 'auto.browser.browser.metrics',\n description: description || event,\n startTimestamp: timeOrigin + msToSec(start),\n endTimestamp: timeOrigin + msToSec(end),\n });\n}\n\n/** Create request and response related spans */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addRequest(transaction: Transaction, entry: Record, timeOrigin: number): void {\n _startChild(transaction, {\n op: 'browser',\n origin: 'auto.browser.browser.metrics',\n description: 'request',\n startTimestamp: timeOrigin + msToSec(entry.requestStart as number),\n endTimestamp: timeOrigin + msToSec(entry.responseEnd as number),\n });\n\n _startChild(transaction, {\n op: 'browser',\n origin: 'auto.browser.browser.metrics',\n description: 'response',\n startTimestamp: timeOrigin + msToSec(entry.responseStart as number),\n endTimestamp: timeOrigin + msToSec(entry.responseEnd as number),\n });\n}\n\nexport interface ResourceEntry extends Record {\n initiatorType?: string;\n transferSize?: number;\n encodedBodySize?: number;\n decodedBodySize?: number;\n renderBlockingStatus?: string;\n}\n\n/** Create resource-related spans */\nexport function _addResourceSpans(\n transaction: Transaction,\n entry: ResourceEntry,\n resourceName: string,\n startTime: number,\n duration: number,\n timeOrigin: number,\n): void {\n // we already instrument based on fetch and xhr, so we don't need to\n // duplicate spans here.\n if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const data: Record = {};\n setResourceEntrySizeData(data, entry, 'transferSize', 'http.response_transfer_size');\n setResourceEntrySizeData(data, entry, 'encodedBodySize', 'http.response_content_length');\n setResourceEntrySizeData(data, entry, 'decodedBodySize', 'http.decoded_response_content_length');\n if ('renderBlockingStatus' in entry) {\n data['resource.render_blocking_status'] = entry.renderBlockingStatus;\n }\n\n const startTimestamp = timeOrigin + startTime;\n const endTimestamp = startTimestamp + duration;\n\n _startChild(transaction, {\n description: resourceName,\n endTimestamp,\n op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other',\n origin: 'auto.resource.browser.metrics',\n startTimestamp,\n data,\n });\n}\n\n/**\n * Capture the information of the user agent.\n */\nfunction _trackNavigator(transaction: Transaction): void {\n const navigator = WINDOW.navigator as null | (Navigator & NavigatorNetworkInformation & NavigatorDeviceMemory);\n if (!navigator) {\n return;\n }\n\n // track network connectivity\n const connection = navigator.connection;\n if (connection) {\n if (connection.effectiveType) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('effectiveConnectionType', connection.effectiveType);\n }\n\n if (connection.type) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('connectionType', connection.type);\n }\n\n if (isMeasurementValue(connection.rtt)) {\n _measurements['connection.rtt'] = { value: connection.rtt, unit: 'millisecond' };\n }\n }\n\n if (isMeasurementValue(navigator.deviceMemory)) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('deviceMemory', `${navigator.deviceMemory} GB`);\n }\n\n if (isMeasurementValue(navigator.hardwareConcurrency)) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('hardwareConcurrency', String(navigator.hardwareConcurrency));\n }\n}\n\n/** Add LCP / CLS data to transaction to allow debugging */\nfunction _tagMetricInfo(transaction: Transaction): void {\n if (_lcpEntry) {\n DEBUG_BUILD && logger.log('[Measurements] Adding LCP Data');\n\n // Capture Properties of the LCP element that contributes to the LCP.\n\n if (_lcpEntry.element) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.element', htmlTreeAsString(_lcpEntry.element));\n }\n\n if (_lcpEntry.id) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.id', _lcpEntry.id);\n }\n\n if (_lcpEntry.url) {\n // Trim URL to the first 200 characters.\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.url', _lcpEntry.url.trim().slice(0, 200));\n }\n\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.size', _lcpEntry.size);\n }\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift\n if (_clsEntry && _clsEntry.sources) {\n DEBUG_BUILD && logger.log('[Measurements] Adding CLS Data');\n _clsEntry.sources.forEach((source, index) =>\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag(`cls.source.${index + 1}`, htmlTreeAsString(source.node)),\n );\n }\n}\n\nfunction setResourceEntrySizeData(\n data: Record,\n entry: ResourceEntry,\n key: keyof Pick,\n dataKey: 'http.response_transfer_size' | 'http.response_content_length' | 'http.decoded_response_content_length',\n): void {\n const entryVal = entry[key];\n if (entryVal != null && entryVal < MAX_INT_AS_BYTES) {\n data[dataKey] = entryVal;\n }\n}\n","/* eslint-disable max-lines */\nimport {\n getActiveSpan,\n getClient,\n getCurrentScope,\n getDynamicSamplingContextFromClient,\n getDynamicSamplingContextFromSpan,\n hasTracingEnabled,\n spanToJSON,\n spanToTraceHeader,\n} from '@sentry/core';\nimport type { HandlerDataXhr, SentryWrappedXMLHttpRequest, Span } from '@sentry/types';\nimport {\n BAGGAGE_HEADER_NAME,\n SENTRY_XHR_DATA_KEY,\n addFetchInstrumentationHandler,\n addXhrInstrumentationHandler,\n browserPerformanceTimeOrigin,\n dynamicSamplingContextToSentryBaggageHeader,\n generateSentryTraceHeader,\n stringMatchesSomePattern,\n} from '@sentry/utils';\n\nimport { instrumentFetchRequest } from '../common/fetch';\nimport { addPerformanceInstrumentationHandler } from './instrument';\n\nexport const DEFAULT_TRACE_PROPAGATION_TARGETS = ['localhost', /^\\/(?!\\/)/];\n\n/** Options for Request Instrumentation */\nexport interface RequestInstrumentationOptions {\n /**\n * @deprecated Will be removed in v8.\n * Use `shouldCreateSpanForRequest` to control span creation and `tracePropagationTargets` to control\n * trace header attachment.\n */\n tracingOrigins: Array;\n\n /**\n * List of strings and/or regexes used to determine which outgoing requests will have `sentry-trace` and `baggage`\n * headers attached.\n *\n * @deprecated Use the top-level `tracePropagationTargets` option in `Sentry.init` instead.\n * This option will be removed in v8.\n *\n * Default: ['localhost', /^\\//] @see {DEFAULT_TRACE_PROPAGATION_TARGETS}\n */\n tracePropagationTargets: Array;\n\n /**\n * Flag to disable patching all together for fetch requests.\n *\n * Default: true\n */\n traceFetch: boolean;\n\n /**\n * Flag to disable patching all together for xhr requests.\n *\n * Default: true\n */\n traceXHR: boolean;\n\n /**\n * If true, Sentry will capture http timings and add them to the corresponding http spans.\n *\n * Default: true\n */\n enableHTTPTimings: boolean;\n\n /**\n * This function will be called before creating a span for a request with the given url.\n * Return false if you don't want a span for the given url.\n *\n * Default: (url: string) => true\n */\n shouldCreateSpanForRequest?(this: void, url: string): boolean;\n}\n\nexport const defaultRequestInstrumentationOptions: RequestInstrumentationOptions = {\n traceFetch: true,\n traceXHR: true,\n enableHTTPTimings: true,\n // TODO (v8): Remove this property\n tracingOrigins: DEFAULT_TRACE_PROPAGATION_TARGETS,\n tracePropagationTargets: DEFAULT_TRACE_PROPAGATION_TARGETS,\n};\n\n/** Registers span creators for xhr and fetch requests */\nexport function instrumentOutgoingRequests(_options?: Partial): void {\n const {\n traceFetch,\n traceXHR,\n // eslint-disable-next-line deprecation/deprecation\n tracePropagationTargets,\n // eslint-disable-next-line deprecation/deprecation\n tracingOrigins,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n } = {\n traceFetch: defaultRequestInstrumentationOptions.traceFetch,\n traceXHR: defaultRequestInstrumentationOptions.traceXHR,\n ..._options,\n };\n\n const shouldCreateSpan =\n typeof shouldCreateSpanForRequest === 'function' ? shouldCreateSpanForRequest : (_: string) => true;\n\n // TODO(v8) Remove tracingOrigins here\n // The only reason we're passing it in here is because this instrumentOutgoingRequests function is publicly exported\n // and we don't want to break the API. We can remove it in v8.\n const shouldAttachHeadersWithTargets = (url: string): boolean =>\n shouldAttachHeaders(url, tracePropagationTargets || tracingOrigins);\n\n const spans: Record = {};\n\n if (traceFetch) {\n addFetchInstrumentationHandler(handlerData => {\n const createdSpan = instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n if (enableHTTPTimings && createdSpan) {\n addHTTPTimings(createdSpan);\n }\n });\n }\n\n if (traceXHR) {\n addXhrInstrumentationHandler(handlerData => {\n const createdSpan = xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n if (enableHTTPTimings && createdSpan) {\n addHTTPTimings(createdSpan);\n }\n });\n }\n}\n\nfunction isPerformanceResourceTiming(entry: PerformanceEntry): entry is PerformanceResourceTiming {\n return (\n entry.entryType === 'resource' &&\n 'initiatorType' in entry &&\n typeof (entry as PerformanceResourceTiming).nextHopProtocol === 'string' &&\n (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest')\n );\n}\n\n/**\n * Creates a temporary observer to listen to the next fetch/xhr resourcing timings,\n * so that when timings hit their per-browser limit they don't need to be removed.\n *\n * @param span A span that has yet to be finished, must contain `url` on data.\n */\nfunction addHTTPTimings(span: Span): void {\n const { url } = spanToJSON(span).data || {};\n\n if (!url || typeof url !== 'string') {\n return;\n }\n\n const cleanup = addPerformanceInstrumentationHandler('resource', ({ entries }) => {\n entries.forEach(entry => {\n if (isPerformanceResourceTiming(entry) && entry.name.endsWith(url)) {\n const spanData = resourceTimingEntryToSpanData(entry);\n spanData.forEach(data => span.setAttribute(...data));\n // In the next tick, clean this handler up\n // We have to wait here because otherwise this cleans itself up before it is fully done\n setTimeout(cleanup);\n }\n });\n });\n}\n\n/**\n * Converts ALPN protocol ids to name and version.\n *\n * (https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids)\n * @param nextHopProtocol PerformanceResourceTiming.nextHopProtocol\n */\nexport function extractNetworkProtocol(nextHopProtocol: string): { name: string; version: string } {\n let name = 'unknown';\n let version = 'unknown';\n let _name = '';\n for (const char of nextHopProtocol) {\n // http/1.1 etc.\n if (char === '/') {\n [name, version] = nextHopProtocol.split('/');\n break;\n }\n // h2, h3 etc.\n if (!isNaN(Number(char))) {\n name = _name === 'h' ? 'http' : _name;\n version = nextHopProtocol.split(_name)[1];\n break;\n }\n _name += char;\n }\n if (_name === nextHopProtocol) {\n // webrtc, ftp, etc.\n name = _name;\n }\n return { name, version };\n}\n\nfunction getAbsoluteTime(time: number = 0): number {\n return ((browserPerformanceTimeOrigin || performance.timeOrigin) + time) / 1000;\n}\n\nfunction resourceTimingEntryToSpanData(resourceTiming: PerformanceResourceTiming): [string, string | number][] {\n const { name, version } = extractNetworkProtocol(resourceTiming.nextHopProtocol);\n\n const timingSpanData: [string, string | number][] = [];\n\n timingSpanData.push(['network.protocol.version', version], ['network.protocol.name', name]);\n\n if (!browserPerformanceTimeOrigin) {\n return timingSpanData;\n }\n return [\n ...timingSpanData,\n ['http.request.redirect_start', getAbsoluteTime(resourceTiming.redirectStart)],\n ['http.request.fetch_start', getAbsoluteTime(resourceTiming.fetchStart)],\n ['http.request.domain_lookup_start', getAbsoluteTime(resourceTiming.domainLookupStart)],\n ['http.request.domain_lookup_end', getAbsoluteTime(resourceTiming.domainLookupEnd)],\n ['http.request.connect_start', getAbsoluteTime(resourceTiming.connectStart)],\n ['http.request.secure_connection_start', getAbsoluteTime(resourceTiming.secureConnectionStart)],\n ['http.request.connection_end', getAbsoluteTime(resourceTiming.connectEnd)],\n ['http.request.request_start', getAbsoluteTime(resourceTiming.requestStart)],\n ['http.request.response_start', getAbsoluteTime(resourceTiming.responseStart)],\n ['http.request.response_end', getAbsoluteTime(resourceTiming.responseEnd)],\n ];\n}\n\n/**\n * A function that determines whether to attach tracing headers to a request.\n * This was extracted from `instrumentOutgoingRequests` to make it easier to test shouldAttachHeaders.\n * We only export this fuction for testing purposes.\n */\nexport function shouldAttachHeaders(url: string, tracePropagationTargets: (string | RegExp)[] | undefined): boolean {\n return stringMatchesSomePattern(url, tracePropagationTargets || DEFAULT_TRACE_PROPAGATION_TARGETS);\n}\n\n/**\n * Create and track xhr request spans\n *\n * @returns Span if a span was created, otherwise void.\n */\n// eslint-disable-next-line complexity\nexport function xhrCallback(\n handlerData: HandlerDataXhr,\n shouldCreateSpan: (url: string) => boolean,\n shouldAttachHeaders: (url: string) => boolean,\n spans: Record,\n): Span | undefined {\n const xhr = handlerData.xhr;\n const sentryXhrData = xhr && xhr[SENTRY_XHR_DATA_KEY];\n\n if (!hasTracingEnabled() || !xhr || xhr.__sentry_own_request__ || !sentryXhrData) {\n return undefined;\n }\n\n const shouldCreateSpanResult = shouldCreateSpan(sentryXhrData.url);\n\n // check first if the request has finished and is tracked by an existing span which should now end\n if (handlerData.endTimestamp && shouldCreateSpanResult) {\n const spanId = xhr.__sentry_xhr_span_id__;\n if (!spanId) return;\n\n const span = spans[spanId];\n if (span && sentryXhrData.status_code !== undefined) {\n span.setHttpStatus(sentryXhrData.status_code);\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete spans[spanId];\n }\n return undefined;\n }\n\n const scope = getCurrentScope();\n const parentSpan = getActiveSpan();\n\n const span =\n shouldCreateSpanResult && parentSpan\n ? // eslint-disable-next-line deprecation/deprecation\n parentSpan.startChild({\n data: {\n type: 'xhr',\n 'http.method': sentryXhrData.method,\n url: sentryXhrData.url,\n },\n description: `${sentryXhrData.method} ${sentryXhrData.url}`,\n op: 'http.client',\n origin: 'auto.http.browser',\n })\n : undefined;\n\n if (span) {\n xhr.__sentry_xhr_span_id__ = span.spanContext().spanId;\n spans[xhr.__sentry_xhr_span_id__] = span;\n }\n\n if (xhr.setRequestHeader && shouldAttachHeaders(sentryXhrData.url)) {\n if (span) {\n const transaction = span && span.transaction;\n const dynamicSamplingContext = transaction && getDynamicSamplingContextFromSpan(transaction);\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n setHeaderOnXhr(xhr, spanToTraceHeader(span), sentryBaggageHeader);\n } else {\n const client = getClient();\n const { traceId, sampled, dsc } = scope.getPropagationContext();\n const sentryTraceHeader = generateSentryTraceHeader(traceId, undefined, sampled);\n const dynamicSamplingContext =\n dsc || (client ? getDynamicSamplingContextFromClient(traceId, client, scope) : undefined);\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n setHeaderOnXhr(xhr, sentryTraceHeader, sentryBaggageHeader);\n }\n }\n\n return span;\n}\n\nfunction setHeaderOnXhr(\n xhr: SentryWrappedXMLHttpRequest,\n sentryTraceHeader: string,\n sentryBaggageHeader: string | undefined,\n): void {\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n xhr.setRequestHeader!('sentry-trace', sentryTraceHeader);\n if (sentryBaggageHeader) {\n // From MDN: \"If this method is called several times with the same header, the values are merged into one single request header.\"\n // We can therefore simply set a baggage header without checking what was there before\n // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n xhr.setRequestHeader!(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n }\n } catch (_) {\n // Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.\n }\n}\n","import {\n getActiveSpan,\n getClient,\n getCurrentScope,\n getDynamicSamplingContextFromClient,\n getDynamicSamplingContextFromSpan,\n hasTracingEnabled,\n spanToTraceHeader,\n} from '@sentry/core';\nimport type { Client, HandlerDataFetch, Scope, Span, SpanOrigin } from '@sentry/types';\nimport {\n BAGGAGE_HEADER_NAME,\n dynamicSamplingContextToSentryBaggageHeader,\n generateSentryTraceHeader,\n isInstanceOf,\n} from '@sentry/utils';\n\ntype PolymorphicRequestHeaders =\n | Record\n | Array<[string, string]>\n // the below is not preicsely the Header type used in Request, but it'll pass duck-typing\n | {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n append: (key: string, value: string) => void;\n get: (key: string) => string | null | undefined;\n };\n\n/**\n * Create and track fetch request spans for usage in combination with `addInstrumentationHandler`.\n *\n * @returns Span if a span was created, otherwise void.\n */\nexport function instrumentFetchRequest(\n handlerData: HandlerDataFetch,\n shouldCreateSpan: (url: string) => boolean,\n shouldAttachHeaders: (url: string) => boolean,\n spans: Record,\n spanOrigin: SpanOrigin = 'auto.http.browser',\n): Span | undefined {\n if (!hasTracingEnabled() || !handlerData.fetchData) {\n return undefined;\n }\n\n const shouldCreateSpanResult = shouldCreateSpan(handlerData.fetchData.url);\n\n if (handlerData.endTimestamp && shouldCreateSpanResult) {\n const spanId = handlerData.fetchData.__span;\n if (!spanId) return;\n\n const span = spans[spanId];\n if (span) {\n if (handlerData.response) {\n span.setHttpStatus(handlerData.response.status);\n\n const contentLength =\n handlerData.response && handlerData.response.headers && handlerData.response.headers.get('content-length');\n\n if (contentLength) {\n const contentLengthNum = parseInt(contentLength);\n if (contentLengthNum > 0) {\n span.setAttribute('http.response_content_length', contentLengthNum);\n }\n }\n } else if (handlerData.error) {\n span.setStatus('internal_error');\n }\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete spans[spanId];\n }\n return undefined;\n }\n\n const scope = getCurrentScope();\n const client = getClient();\n const parentSpan = getActiveSpan();\n\n const { method, url } = handlerData.fetchData;\n\n const span =\n shouldCreateSpanResult && parentSpan\n ? // eslint-disable-next-line deprecation/deprecation\n parentSpan.startChild({\n data: {\n url,\n type: 'fetch',\n 'http.method': method,\n },\n description: `${method} ${url}`,\n op: 'http.client',\n origin: spanOrigin,\n })\n : undefined;\n\n if (span) {\n handlerData.fetchData.__span = span.spanContext().spanId;\n spans[span.spanContext().spanId] = span;\n }\n\n if (shouldAttachHeaders(handlerData.fetchData.url) && client) {\n const request: string | Request = handlerData.args[0];\n\n // In case the user hasn't set the second argument of a fetch call we default it to `{}`.\n handlerData.args[1] = handlerData.args[1] || {};\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const options: { [key: string]: any } = handlerData.args[1];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n options.headers = addTracingHeadersToFetchRequest(request, client, scope, options, span);\n }\n\n return span;\n}\n\n/**\n * Adds sentry-trace and baggage headers to the various forms of fetch headers\n */\nexport function addTracingHeadersToFetchRequest(\n request: string | unknown, // unknown is actually type Request but we can't export DOM types from this package,\n client: Client,\n scope: Scope,\n options: {\n headers?:\n | {\n [key: string]: string[] | string | undefined;\n }\n | PolymorphicRequestHeaders;\n },\n requestSpan?: Span,\n): PolymorphicRequestHeaders | undefined {\n // eslint-disable-next-line deprecation/deprecation\n const span = requestSpan || scope.getSpan();\n\n const transaction = span && span.transaction;\n\n const { traceId, sampled, dsc } = scope.getPropagationContext();\n\n const sentryTraceHeader = span ? spanToTraceHeader(span) : generateSentryTraceHeader(traceId, undefined, sampled);\n const dynamicSamplingContext = transaction\n ? getDynamicSamplingContextFromSpan(transaction)\n : dsc\n ? dsc\n : getDynamicSamplingContextFromClient(traceId, client, scope);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n\n const headers =\n typeof Request !== 'undefined' && isInstanceOf(request, Request) ? (request as Request).headers : options.headers;\n\n if (!headers) {\n return { 'sentry-trace': sentryTraceHeader, baggage: sentryBaggageHeader };\n } else if (typeof Headers !== 'undefined' && isInstanceOf(headers, Headers)) {\n const newHeaders = new Headers(headers as Headers);\n\n newHeaders.append('sentry-trace', sentryTraceHeader);\n\n if (sentryBaggageHeader) {\n // If the same header is appended multiple times the browser will merge the values into a single request header.\n // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n newHeaders.append(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n }\n\n return newHeaders as PolymorphicRequestHeaders;\n } else if (Array.isArray(headers)) {\n const newHeaders = [...headers, ['sentry-trace', sentryTraceHeader]];\n\n if (sentryBaggageHeader) {\n // If there are multiple entries with the same key, the browser will merge the values into a single request header.\n // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n newHeaders.push([BAGGAGE_HEADER_NAME, sentryBaggageHeader]);\n }\n\n return newHeaders as PolymorphicRequestHeaders;\n } else {\n const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined;\n const newBaggageHeaders: string[] = [];\n\n if (Array.isArray(existingBaggageHeader)) {\n newBaggageHeaders.push(...existingBaggageHeader);\n } else if (existingBaggageHeader) {\n newBaggageHeaders.push(existingBaggageHeader);\n }\n\n if (sentryBaggageHeader) {\n newBaggageHeaders.push(sentryBaggageHeader);\n }\n\n return {\n ...(headers as Exclude),\n 'sentry-trace': sentryTraceHeader,\n baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,\n };\n }\n}\n","/* eslint-disable max-lines */\nimport type { Hub, IdleTransaction } from '@sentry/core';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n TRACING_DEFAULTS,\n addTracingExtensions,\n getActiveTransaction,\n spanIsSampled,\n startIdleTransaction,\n} from '@sentry/core';\nimport type { EventProcessor, Integration, Transaction, TransactionContext, TransactionSource } from '@sentry/types';\nimport { getDomElement, logger, tracingContextFromHeaders } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport { registerBackgroundTabDetection } from './backgroundtab';\nimport {\n addPerformanceEntries,\n startTrackingInteractions,\n startTrackingLongTasks,\n startTrackingWebVitals,\n} from './metrics';\nimport type { RequestInstrumentationOptions } from './request';\nimport { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request';\nimport { instrumentRoutingWithDefaults } from './router';\nimport { WINDOW } from './types';\n\nexport const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';\n\n/** Options for Browser Tracing integration */\nexport interface BrowserTracingOptions extends RequestInstrumentationOptions {\n /**\n * The time to wait in ms until the transaction will be finished during an idle state. An idle state is defined\n * by a moment where there are no in-progress spans.\n *\n * The transaction will use the end timestamp of the last finished span as the endtime for the transaction.\n * If there are still active spans when this the `idleTimeout` is set, the `idleTimeout` will get reset.\n * Time is in ms.\n *\n * Default: 1000\n */\n idleTimeout: number;\n\n /**\n * The max duration for a transaction. If a transaction duration hits the `finalTimeout` value, it\n * will be finished.\n * Time is in ms.\n *\n * Default: 30000\n */\n finalTimeout: number;\n\n /**\n * The heartbeat interval. If no new spans are started or open spans are finished within 3 heartbeats,\n * the transaction will be finished.\n * Time is in ms.\n *\n * Default: 5000\n */\n heartbeatInterval: number;\n\n /**\n * Flag to enable/disable creation of `navigation` transaction on history changes.\n *\n * Default: true\n */\n startTransactionOnLocationChange: boolean;\n\n /**\n * Flag to enable/disable creation of `pageload` transaction on first pageload.\n *\n * Default: true\n */\n startTransactionOnPageLoad: boolean;\n\n /**\n * Flag Transactions where tabs moved to background with \"cancelled\". Browser background tab timing is\n * not suited towards doing precise measurements of operations. By default, we recommend that this option\n * be enabled as background transactions can mess up your statistics in nondeterministic ways.\n *\n * Default: true\n */\n markBackgroundTransactions: boolean;\n\n /**\n * If true, Sentry will capture long tasks and add them to the corresponding transaction.\n *\n * Default: true\n */\n enableLongTask: boolean;\n\n /**\n * _metricOptions allows the user to send options to change how metrics are collected.\n *\n * _metricOptions is currently experimental.\n *\n * Default: undefined\n */\n _metricOptions?: Partial<{\n /**\n * @deprecated This property no longer has any effect and will be removed in v8.\n */\n _reportAllChanges: boolean;\n }>;\n\n /**\n * _experiments allows the user to send options to define how this integration works.\n * Note that the `enableLongTask` options is deprecated in favor of the option at the top level, and will be removed in v8.\n *\n * TODO (v8): Remove enableLongTask\n *\n * Default: undefined\n */\n _experiments: Partial<{\n enableLongTask: boolean;\n enableInteractions: boolean;\n onStartRouteTransaction: (t: Transaction | undefined, ctx: TransactionContext, getCurrentHub: () => Hub) => void;\n }>;\n\n /**\n * beforeNavigate is called before a pageload/navigation transaction is created and allows users to modify transaction\n * context data, or drop the transaction entirely (by setting `sampled = false` in the context).\n *\n * Note: For legacy reasons, transactions can also be dropped by returning `undefined`.\n *\n * @param context: The context data which will be passed to `startTransaction` by default\n *\n * @returns A (potentially) modified context object, with `sampled = false` if the transaction should be dropped.\n */\n beforeNavigate?(this: void, context: TransactionContext): TransactionContext | undefined;\n\n /**\n * Instrumentation that creates routing change transactions. By default creates\n * pageload and navigation transactions.\n */\n routingInstrumentation(\n this: void,\n customStartTransaction: (context: TransactionContext) => T | undefined,\n startTransactionOnPageLoad?: boolean,\n startTransactionOnLocationChange?: boolean,\n ): void;\n}\n\nconst DEFAULT_BROWSER_TRACING_OPTIONS: BrowserTracingOptions = {\n ...TRACING_DEFAULTS,\n markBackgroundTransactions: true,\n routingInstrumentation: instrumentRoutingWithDefaults,\n startTransactionOnLocationChange: true,\n startTransactionOnPageLoad: true,\n enableLongTask: true,\n _experiments: {},\n ...defaultRequestInstrumentationOptions,\n};\n\n/**\n * The Browser Tracing integration automatically instruments browser pageload/navigation\n * actions as transactions, and captures requests, metrics and errors as spans.\n *\n * The integration can be configured with a variety of options, and can be extended to use\n * any routing library. This integration uses {@see IdleTransaction} to create transactions.\n */\nexport class BrowserTracing implements Integration {\n // This class currently doesn't have a static `id` field like the other integration classes, because it prevented\n // @sentry/tracing from being treeshaken. Tree shakers do not like static fields, because they behave like side effects.\n // TODO: Come up with a better plan, than using static fields on integration classes, and use that plan on all\n // integrations.\n\n /** Browser Tracing integration options */\n public options: BrowserTracingOptions;\n\n /**\n * @inheritDoc\n */\n public name: string;\n\n private _getCurrentHub?: () => Hub;\n\n private _latestRouteName?: string;\n private _latestRouteSource?: TransactionSource;\n\n private _collectWebVitals: () => void;\n\n private _hasSetTracePropagationTargets: boolean;\n\n public constructor(_options?: Partial) {\n this.name = BROWSER_TRACING_INTEGRATION_ID;\n this._hasSetTracePropagationTargets = false;\n\n addTracingExtensions();\n\n if (DEBUG_BUILD) {\n this._hasSetTracePropagationTargets = !!(\n _options &&\n // eslint-disable-next-line deprecation/deprecation\n (_options.tracePropagationTargets || _options.tracingOrigins)\n );\n }\n\n this.options = {\n ...DEFAULT_BROWSER_TRACING_OPTIONS,\n ..._options,\n };\n\n // Special case: enableLongTask can be set in _experiments\n // TODO (v8): Remove this in v8\n if (this.options._experiments.enableLongTask !== undefined) {\n this.options.enableLongTask = this.options._experiments.enableLongTask;\n }\n\n // TODO (v8): remove this block after tracingOrigins is removed\n // Set tracePropagationTargets to tracingOrigins if specified by the user\n // In case both are specified, tracePropagationTargets takes precedence\n // eslint-disable-next-line deprecation/deprecation\n if (_options && !_options.tracePropagationTargets && _options.tracingOrigins) {\n // eslint-disable-next-line deprecation/deprecation\n this.options.tracePropagationTargets = _options.tracingOrigins;\n }\n\n this._collectWebVitals = startTrackingWebVitals();\n if (this.options.enableLongTask) {\n startTrackingLongTasks();\n }\n if (this.options._experiments.enableInteractions) {\n startTrackingInteractions();\n }\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n this._getCurrentHub = getCurrentHub;\n const hub = getCurrentHub();\n const client = hub.getClient();\n const clientOptions = client && client.getOptions();\n\n const {\n routingInstrumentation: instrumentRouting,\n startTransactionOnLocationChange,\n startTransactionOnPageLoad,\n markBackgroundTransactions,\n traceFetch,\n traceXHR,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n _experiments,\n } = this.options;\n\n const clientOptionsTracePropagationTargets = clientOptions && clientOptions.tracePropagationTargets;\n // There are three ways to configure tracePropagationTargets:\n // 1. via top level client option `tracePropagationTargets`\n // 2. via BrowserTracing option `tracePropagationTargets`\n // 3. via BrowserTracing option `tracingOrigins` (deprecated)\n //\n // To avoid confusion, favour top level client option `tracePropagationTargets`, and fallback to\n // BrowserTracing option `tracePropagationTargets` and then `tracingOrigins` (deprecated).\n // This is done as it minimizes bundle size (we don't have to have undefined checks).\n //\n // If both 1 and either one of 2 or 3 are set (from above), we log out a warning.\n // eslint-disable-next-line deprecation/deprecation\n const tracePropagationTargets = clientOptionsTracePropagationTargets || this.options.tracePropagationTargets;\n if (DEBUG_BUILD && this._hasSetTracePropagationTargets && clientOptionsTracePropagationTargets) {\n logger.warn(\n '[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.',\n );\n }\n\n instrumentRouting(\n (context: TransactionContext) => {\n const transaction = this._createRouteTransaction(context);\n\n this.options._experiments.onStartRouteTransaction &&\n this.options._experiments.onStartRouteTransaction(transaction, context, getCurrentHub);\n\n return transaction;\n },\n startTransactionOnPageLoad,\n startTransactionOnLocationChange,\n );\n\n if (markBackgroundTransactions) {\n registerBackgroundTabDetection();\n }\n\n if (_experiments.enableInteractions) {\n this._registerInteractionListener();\n }\n\n instrumentOutgoingRequests({\n traceFetch,\n traceXHR,\n tracePropagationTargets,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n });\n }\n\n /** Create routing idle transaction. */\n private _createRouteTransaction(context: TransactionContext): Transaction | undefined {\n if (!this._getCurrentHub) {\n DEBUG_BUILD &&\n logger.warn(`[Tracing] Did not create ${context.op} transaction because _getCurrentHub is invalid.`);\n return undefined;\n }\n\n const hub = this._getCurrentHub();\n\n const { beforeNavigate, idleTimeout, finalTimeout, heartbeatInterval } = this.options;\n\n const isPageloadTransaction = context.op === 'pageload';\n\n const sentryTrace = isPageloadTransaction ? getMetaContent('sentry-trace') : '';\n const baggage = isPageloadTransaction ? getMetaContent('baggage') : '';\n const { traceparentData, dynamicSamplingContext, propagationContext } = tracingContextFromHeaders(\n sentryTrace,\n baggage,\n );\n\n const expandedContext: TransactionContext = {\n ...context,\n ...traceparentData,\n metadata: {\n // eslint-disable-next-line deprecation/deprecation\n ...context.metadata,\n dynamicSamplingContext: traceparentData && !dynamicSamplingContext ? {} : dynamicSamplingContext,\n },\n trimEnd: true,\n };\n\n const modifiedContext = typeof beforeNavigate === 'function' ? beforeNavigate(expandedContext) : expandedContext;\n\n // For backwards compatibility reasons, beforeNavigate can return undefined to \"drop\" the transaction (prevent it\n // from being sent to Sentry).\n const finalContext = modifiedContext === undefined ? { ...expandedContext, sampled: false } : modifiedContext;\n\n // If `beforeNavigate` set a custom name, record that fact\n // eslint-disable-next-line deprecation/deprecation\n finalContext.metadata =\n finalContext.name !== expandedContext.name\n ? // eslint-disable-next-line deprecation/deprecation\n { ...finalContext.metadata, source: 'custom' }\n : // eslint-disable-next-line deprecation/deprecation\n finalContext.metadata;\n\n this._latestRouteName = finalContext.name;\n\n // eslint-disable-next-line deprecation/deprecation\n const sourceFromData = context.data && context.data[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n // eslint-disable-next-line deprecation/deprecation\n const sourceFromMetadata = finalContext.metadata && finalContext.metadata.source;\n\n this._latestRouteSource = sourceFromData || sourceFromMetadata;\n\n // eslint-disable-next-line deprecation/deprecation\n if (finalContext.sampled === false) {\n DEBUG_BUILD && logger.log(`[Tracing] Will not send ${finalContext.op} transaction because of beforeNavigate.`);\n }\n\n DEBUG_BUILD && logger.log(`[Tracing] Starting ${finalContext.op} transaction on scope`);\n\n const { location } = WINDOW;\n\n const idleTransaction = startIdleTransaction(\n hub,\n finalContext,\n idleTimeout,\n finalTimeout,\n true,\n { location }, // for use in the tracesSampler\n heartbeatInterval,\n );\n\n const scope = hub.getScope();\n\n // If it's a pageload and there is a meta tag set\n // use the traceparentData as the propagation context\n if (isPageloadTransaction && traceparentData) {\n scope.setPropagationContext(propagationContext);\n } else {\n // Navigation transactions should set a new propagation context based on the\n // created idle transaction.\n scope.setPropagationContext({\n traceId: idleTransaction.spanContext().traceId,\n spanId: idleTransaction.spanContext().spanId,\n parentSpanId: idleTransaction.parentSpanId,\n sampled: spanIsSampled(idleTransaction),\n });\n }\n\n idleTransaction.registerBeforeFinishCallback(transaction => {\n this._collectWebVitals();\n addPerformanceEntries(transaction);\n });\n\n return idleTransaction as Transaction;\n }\n\n /** Start listener for interaction transactions */\n private _registerInteractionListener(): void {\n let inflightInteractionTransaction: IdleTransaction | undefined;\n const registerInteractionTransaction = (): void => {\n const { idleTimeout, finalTimeout, heartbeatInterval } = this.options;\n const op = 'ui.action.click';\n\n // eslint-disable-next-line deprecation/deprecation\n const currentTransaction = getActiveTransaction();\n if (currentTransaction && currentTransaction.op && ['navigation', 'pageload'].includes(currentTransaction.op)) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Did not create ${op} transaction because a pageload or navigation transaction is in progress.`,\n );\n return undefined;\n }\n\n if (inflightInteractionTransaction) {\n inflightInteractionTransaction.setFinishReason('interactionInterrupted');\n inflightInteractionTransaction.end();\n inflightInteractionTransaction = undefined;\n }\n\n if (!this._getCurrentHub) {\n DEBUG_BUILD && logger.warn(`[Tracing] Did not create ${op} transaction because _getCurrentHub is invalid.`);\n return undefined;\n }\n\n if (!this._latestRouteName) {\n DEBUG_BUILD && logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);\n return undefined;\n }\n\n const hub = this._getCurrentHub();\n const { location } = WINDOW;\n\n const context: TransactionContext = {\n name: this._latestRouteName,\n op,\n trimEnd: true,\n data: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: this._latestRouteSource || 'url',\n },\n };\n\n inflightInteractionTransaction = startIdleTransaction(\n hub,\n context,\n idleTimeout,\n finalTimeout,\n true,\n { location }, // for use in the tracesSampler\n heartbeatInterval,\n );\n };\n\n ['click'].forEach(type => {\n addEventListener(type, registerInteractionTransaction, { once: false, capture: true });\n });\n }\n}\n\n/** Returns the value of a meta tag */\nexport function getMetaContent(metaName: string): string | undefined {\n // Can't specify generic to `getDomElement` because tracing can be used\n // in a variety of environments, have to disable `no-unsafe-member-access`\n // as a result.\n const metaTag = getDomElement(`meta[name=${metaName}]`);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return metaTag ? metaTag.getAttribute('content') : undefined;\n}\n","import type { Transaction, TransactionContext } from '@sentry/types';\nimport { addHistoryInstrumentationHandler, browserPerformanceTimeOrigin, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport { WINDOW } from './types';\n\n/**\n * Default function implementing pageload and navigation transactions\n */\nexport function instrumentRoutingWithDefaults(\n customStartTransaction: (context: TransactionContext) => T | undefined,\n startTransactionOnPageLoad: boolean = true,\n startTransactionOnLocationChange: boolean = true,\n): void {\n if (!WINDOW || !WINDOW.location) {\n DEBUG_BUILD && logger.warn('Could not initialize routing instrumentation due to invalid location');\n return;\n }\n\n let startingUrl: string | undefined = WINDOW.location.href;\n\n let activeTransaction: T | undefined;\n if (startTransactionOnPageLoad) {\n activeTransaction = customStartTransaction({\n name: WINDOW.location.pathname,\n // pageload should always start at timeOrigin (and needs to be in s, not ms)\n startTimestamp: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1000 : undefined,\n op: 'pageload',\n origin: 'auto.pageload.browser',\n metadata: { source: 'url' },\n });\n }\n\n if (startTransactionOnLocationChange) {\n addHistoryInstrumentationHandler(({ to, from }) => {\n /**\n * This early return is there to account for some cases where a navigation transaction starts right after\n * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't\n * create an uneccessary navigation transaction.\n *\n * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also\n * only be caused in certain development environments where the usage of a hot module reloader is causing\n * errors.\n */\n if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) {\n startingUrl = undefined;\n return;\n }\n\n if (from !== to) {\n startingUrl = undefined;\n if (activeTransaction) {\n DEBUG_BUILD && logger.log(`[Tracing] Finishing current transaction with op: ${activeTransaction.op}`);\n // If there's an open transaction on the scope, we need to finish it before creating an new one.\n activeTransaction.end();\n }\n activeTransaction = customStartTransaction({\n name: WINDOW.location.pathname,\n op: 'navigation',\n origin: 'auto.navigation.browser',\n metadata: { source: 'url' },\n });\n }\n });\n }\n}\n","import type { IdleTransaction, SpanStatusType } from '@sentry/core';\nimport { getActiveTransaction } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport { WINDOW } from './types';\n\n/**\n * Add a listener that cancels and finishes a transaction when the global\n * document is hidden.\n */\nexport function registerBackgroundTabDetection(): void {\n if (WINDOW && WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction() as IdleTransaction;\n if (WINDOW.document.hidden && activeTransaction) {\n const statusType: SpanStatusType = 'cancelled';\n\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Transaction: ${statusType} -> since tab moved to the background, op: ${activeTransaction.op}`,\n );\n // We should not set status if it is already set, this prevent important statuses like\n // error or data loss from being overwritten on transaction.\n if (!activeTransaction.status) {\n activeTransaction.setStatus(statusType);\n }\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n activeTransaction.setTag('visibilitychange', 'document.hidden');\n activeTransaction.end();\n }\n });\n } else {\n DEBUG_BUILD && logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n }\n}\n","export * from './exports';\n\nimport { Integrations as CoreIntegrations } from '@sentry/core';\n\nimport { WINDOW } from './helpers';\nimport * as BrowserIntegrations from './integrations';\n\nlet windowIntegrations = {};\n\n// This block is needed to add compatibility with the integrations packages when used with a CDN\nif (WINDOW.Sentry && WINDOW.Sentry.Integrations) {\n windowIntegrations = WINDOW.Sentry.Integrations;\n}\n\nconst INTEGRATIONS = {\n ...windowIntegrations,\n ...CoreIntegrations,\n ...BrowserIntegrations,\n};\n\nexport { INTEGRATIONS as Integrations };\n\nexport { Replay } from '@sentry/replay';\nexport type {\n ReplayEventType,\n ReplayEventWithTime,\n ReplayBreadcrumbFrame,\n ReplayBreadcrumbFrameEvent,\n ReplayOptionFrameEvent,\n ReplayFrame,\n ReplayFrameEvent,\n ReplaySpanFrame,\n ReplaySpanFrameEvent,\n} from '@sentry/replay';\n\nexport { Feedback } from '@sentry-internal/feedback';\n\nexport {\n BrowserTracing,\n defaultRequestInstrumentationOptions,\n instrumentOutgoingRequests,\n} from '@sentry-internal/tracing';\nexport type { RequestInstrumentationOptions } from '@sentry-internal/tracing';\nexport {\n addTracingExtensions,\n setMeasurement,\n // eslint-disable-next-line deprecation/deprecation\n extractTraceparentData,\n // eslint-disable-next-line deprecation/deprecation\n getActiveTransaction,\n spanStatusfromHttpCode,\n // eslint-disable-next-line deprecation/deprecation\n trace,\n makeMultiplexedTransport,\n ModuleMetadata,\n} from '@sentry/core';\nexport type { SpanStatusType } from '@sentry/core';\nexport type { Span } from '@sentry/types';\nexport { makeBrowserOfflineTransport } from './transports/offline';\nexport { onProfilingStartRouteTransaction } from './profiling/hubextensions';\nexport { BrowserProfilingIntegration } from './profiling/integration';\n","// TODO(v8): Move everything in this file into the browser package. Nothing here is generic and we run risk of leaking browser types into non-browser packages.\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { HandlerDataDom } from '@sentry/types';\n\nimport { uuid4 } from '../misc';\nimport { addNonEnumerableProperty, fill } from '../object';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\ntype SentryWrappedTarget = HTMLElement & { _sentryId?: string };\n\ntype AddEventListener = (\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n) => void;\ntype RemoveEventListener = (\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n) => void;\n\ntype InstrumentedElement = Element & {\n __sentry_instrumentation_handlers__?: {\n [key in 'click' | 'keypress']?: {\n handler?: Function;\n /** The number of custom listeners attached to this element */\n refCount: number;\n };\n };\n};\n\nconst WINDOW = GLOBAL_OBJ as unknown as Window;\nconst DEBOUNCE_DURATION = 1000;\n\nlet debounceTimerID: number | undefined;\nlet lastCapturedEventType: string | undefined;\nlet lastCapturedEventTargetId: string | undefined;\n\n/**\n * Add an instrumentation handler for when a click or a keypress happens.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addClickKeypressInstrumentationHandler(handler: (data: HandlerDataDom) => void): void {\n const type = 'dom';\n addHandler(type, handler);\n maybeInstrument(type, instrumentDOM);\n}\n\n/** Exported for tests only. */\nexport function instrumentDOM(): void {\n if (!WINDOW.document) {\n return;\n }\n\n // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom\n // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before\n // we instrument `addEventListener` so that we don't end up attaching this handler twice.\n const triggerDOMHandler = triggerHandlers.bind(null, 'dom');\n const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);\n WINDOW.document.addEventListener('click', globalDOMEventHandler, false);\n WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false);\n\n // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled\n // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That\n // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler\n // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still\n // guaranteed to fire at least once.)\n ['EventTarget', 'Node'].forEach((target: string) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const proto = (WINDOW as any)[target] && (WINDOW as any)[target].prototype;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (originalAddEventListener: AddEventListener): AddEventListener {\n return function (\n this: Element,\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): AddEventListener {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this as InstrumentedElement;\n const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {});\n const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 });\n\n if (!handlerForType.handler) {\n const handler = makeDOMEventHandler(triggerDOMHandler);\n handlerForType.handler = handler;\n originalAddEventListener.call(this, type, handler, options);\n }\n\n handlerForType.refCount++;\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalAddEventListener.call(this, type, listener, options);\n };\n });\n\n fill(\n proto,\n 'removeEventListener',\n function (originalRemoveEventListener: RemoveEventListener): RemoveEventListener {\n return function (\n this: Element,\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): () => void {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this as InstrumentedElement;\n const handlers = el.__sentry_instrumentation_handlers__ || {};\n const handlerForType = handlers[type];\n\n if (handlerForType) {\n handlerForType.refCount--;\n // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.\n if (handlerForType.refCount <= 0) {\n originalRemoveEventListener.call(this, type, handlerForType.handler, options);\n handlerForType.handler = undefined;\n delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n }\n\n // If there are no longer any custom handlers of any type on this element, cleanup everything.\n if (Object.keys(handlers).length === 0) {\n delete el.__sentry_instrumentation_handlers__;\n }\n }\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalRemoveEventListener.call(this, type, listener, options);\n };\n },\n );\n });\n}\n\n/**\n * Check whether the event is similar to the last captured one. For example, two click events on the same button.\n */\nfunction isSimilarToLastCapturedEvent(event: Event): boolean {\n // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.\n if (event.type !== lastCapturedEventType) {\n return false;\n }\n\n try {\n // If both events have the same type, it's still possible that actions were performed on different targets.\n // e.g. 2 clicks on different buttons.\n if (!event.target || (event.target as SentryWrappedTarget)._sentryId !== lastCapturedEventTargetId) {\n return false;\n }\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n }\n\n // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_\n // to which an event listener was attached), we treat them as the same action, as we want to capture\n // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.\n return true;\n}\n\n/**\n * Decide whether an event should be captured.\n * @param event event to be captured\n */\nfunction shouldSkipDOMEvent(eventType: string, target: SentryWrappedTarget | null): boolean {\n // We are only interested in filtering `keypress` events for now.\n if (eventType !== 'keypress') {\n return false;\n }\n\n if (!target || !target.tagName) {\n return true;\n }\n\n // Only consider keypress events on actual input elements. This will disregard keypresses targeting body\n // e.g.tabbing through elements, hotkeys, etc.\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n */\nfunction makeDOMEventHandler(\n handler: (data: HandlerDataDom) => void,\n globalListener: boolean = false,\n): (event: Event) => void {\n return (event: Event & { _sentryCaptured?: true }): void => {\n // It's possible this handler might trigger multiple times for the same\n // event (e.g. event propagation through node ancestors).\n // Ignore if we've already captured that event.\n if (!event || event['_sentryCaptured']) {\n return;\n }\n\n const target = getEventTarget(event);\n\n // We always want to skip _some_ events.\n if (shouldSkipDOMEvent(event.type, target)) {\n return;\n }\n\n // Mark event as \"seen\"\n addNonEnumerableProperty(event, '_sentryCaptured', true);\n\n if (target && !target._sentryId) {\n // Add UUID to event target so we can identify if\n addNonEnumerableProperty(target, '_sentryId', uuid4());\n }\n\n const name = event.type === 'keypress' ? 'input' : event.type;\n\n // If there is no last captured event, it means that we can safely capture the new event and store it for future comparisons.\n // If there is a last captured event, see if the new event is different enough to treat it as a unique one.\n // If that's the case, emit the previous event and store locally the newly-captured DOM event.\n if (!isSimilarToLastCapturedEvent(event)) {\n const handlerData: HandlerDataDom = { event, name, global: globalListener };\n handler(handlerData);\n lastCapturedEventType = event.type;\n lastCapturedEventTargetId = target ? target._sentryId : undefined;\n }\n\n // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.\n clearTimeout(debounceTimerID);\n debounceTimerID = WINDOW.setTimeout(() => {\n lastCapturedEventTargetId = undefined;\n lastCapturedEventType = undefined;\n }, DEBOUNCE_DURATION);\n };\n}\n\nfunction getEventTarget(event: Event): SentryWrappedTarget | null {\n try {\n return event.target as SentryWrappedTarget | null;\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n return null;\n }\n}\n","type PartialURL = {\n host?: string;\n path?: string;\n protocol?: string;\n relative?: string;\n search?: string;\n hash?: string;\n};\n\n/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\nexport function parseUrl(url: string): PartialURL {\n if (!url) {\n return {};\n }\n\n const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n }\n\n // coerce to undefined values to empty string so we don't get 'undefined'\n const query = match[6] || '';\n const fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n search: query,\n hash: fragment,\n relative: match[5] + query + fragment, // everything minus origin\n };\n}\n\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\nexport function stripUrlQueryAndFragment(urlPath: string): string {\n // eslint-disable-next-line no-useless-escape\n return urlPath.split(/[\\?#]/, 1)[0];\n}\n\n/**\n * Returns number of URL segments of a passed string URL.\n */\nexport function getNumberOfUrlSegments(url: string): number {\n // split at '/' or at '\\/' to split regex urls correctly\n return url.split(/\\\\?\\//).filter(s => s.length > 0 && s !== ',').length;\n}\n\n/**\n * Takes a URL object and returns a sanitized string which is safe to use as span description\n * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data\n */\nexport function getSanitizedUrlString(url: PartialURL): string {\n const { protocol, host, path } = url;\n\n const filteredHost =\n (host &&\n host\n // Always filter out authority\n .replace(/^.*@/, '[filtered]:[filtered]@')\n // Don't show standard :80 (http) and :443 (https) ports to reduce the noise\n // TODO: Use new URL global if it exists\n .replace(/(:80)$/, '')\n .replace(/(:443)$/, '')) ||\n '';\n\n return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`;\n}\n","/* eslint-disable max-lines */\nimport { addBreadcrumb, convertIntegrationFnToClass, getClient } from '@sentry/core';\nimport type {\n Client,\n Event as SentryEvent,\n HandlerDataConsole,\n HandlerDataDom,\n HandlerDataFetch,\n HandlerDataHistory,\n HandlerDataXhr,\n IntegrationFn,\n} from '@sentry/types';\nimport type {\n Breadcrumb,\n FetchBreadcrumbData,\n FetchBreadcrumbHint,\n XhrBreadcrumbData,\n XhrBreadcrumbHint,\n} from '@sentry/types/build/types/breadcrumb';\nimport {\n SENTRY_XHR_DATA_KEY,\n addClickKeypressInstrumentationHandler,\n addConsoleInstrumentationHandler,\n addFetchInstrumentationHandler,\n addHistoryInstrumentationHandler,\n addXhrInstrumentationHandler,\n getComponentName,\n getEventDescription,\n htmlTreeAsString,\n logger,\n parseUrl,\n safeJoin,\n severityLevelFromString,\n} from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\ninterface BreadcrumbsOptions {\n console: boolean;\n dom:\n | boolean\n | {\n serializeAttribute?: string | string[];\n maxStringLength?: number;\n };\n fetch: boolean;\n history: boolean;\n sentry: boolean;\n xhr: boolean;\n}\n\n/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */\nconst MAX_ALLOWED_STRING_LENGTH = 1024;\n\nconst INTEGRATION_NAME = 'Breadcrumbs';\n\nconst breadcrumbsIntegration: IntegrationFn = (options: Partial = {}) => {\n const _options = {\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: true,\n xhr: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n if (_options.console) {\n addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));\n }\n if (_options.dom) {\n addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client, _options.dom));\n }\n if (_options.xhr) {\n addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client));\n }\n if (_options.fetch) {\n addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client));\n }\n if (_options.history) {\n addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client));\n }\n if (_options.sentry && client.on) {\n client.on('beforeSendEvent', _getSentryBreadcrumbHandler(client));\n }\n },\n };\n};\n\n/**\n * Default Breadcrumbs instrumentations\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const Breadcrumbs = convertIntegrationFnToClass(INTEGRATION_NAME, breadcrumbsIntegration);\n\n/**\n * Adds a breadcrumb for Sentry events or transactions if this option is enabled.\n */\nfunction _getSentryBreadcrumbHandler(client: Client): (event: SentryEvent) => void {\n return function addSentryBreadcrumb(event: SentryEvent): void {\n if (getClient() !== client) {\n return;\n }\n\n addBreadcrumb(\n {\n category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n event_id: event.event_id,\n level: event.level,\n message: getEventDescription(event),\n },\n {\n event,\n },\n );\n };\n}\n\n/**\n * A HOC that creaes a function that creates breadcrumbs from DOM API calls.\n * This is a HOC so that we get access to dom options in the closure.\n */\nfunction _getDomBreadcrumbHandler(\n client: Client,\n dom: BreadcrumbsOptions['dom'],\n): (handlerData: HandlerDataDom) => void {\n return function _innerDomBreadcrumb(handlerData: HandlerDataDom): void {\n if (getClient() !== client) {\n return;\n }\n\n let target;\n let componentName;\n let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n let maxStringLength =\n typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;\n if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {\n DEBUG_BUILD &&\n logger.warn(\n `\\`dom.maxStringLength\\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,\n );\n maxStringLength = MAX_ALLOWED_STRING_LENGTH;\n }\n\n if (typeof keyAttrs === 'string') {\n keyAttrs = [keyAttrs];\n }\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n const event = handlerData.event as Event | Node;\n const element = _isEvent(event) ? event.target : event;\n\n target = htmlTreeAsString(element, { keyAttrs, maxStringLength });\n componentName = getComponentName(element);\n } catch (e) {\n target = '';\n }\n\n if (target.length === 0) {\n return;\n }\n\n const breadcrumb: Breadcrumb = {\n category: `ui.${handlerData.name}`,\n message: target,\n };\n\n if (componentName) {\n breadcrumb.data = { 'ui.component_name': componentName };\n }\n\n addBreadcrumb(breadcrumb, {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from console API calls\n */\nfunction _getConsoleBreadcrumbHandler(client: Client): (handlerData: HandlerDataConsole) => void {\n return function _consoleBreadcrumb(handlerData: HandlerDataConsole): void {\n if (getClient() !== client) {\n return;\n }\n\n const breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console',\n },\n level: severityLevelFromString(handlerData.level),\n message: safeJoin(handlerData.args, ' '),\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from XHR API calls\n */\nfunction _getXhrBreadcrumbHandler(client: Client): (handlerData: HandlerDataXhr) => void {\n return function _xhrBreadcrumb(handlerData: HandlerDataXhr): void {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];\n\n // We only capture complete, non-sentry requests\n if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n return;\n }\n\n const { method, url, status_code, body } = sentryXhrData;\n\n const data: XhrBreadcrumbData = {\n method,\n url,\n status_code,\n };\n\n const hint: XhrBreadcrumbHint = {\n xhr: handlerData.xhr,\n input: body,\n startTimestamp,\n endTimestamp,\n };\n\n addBreadcrumb(\n {\n category: 'xhr',\n data,\n type: 'http',\n },\n hint,\n );\n };\n}\n\n/**\n * Creates breadcrumbs from fetch API calls\n */\nfunction _getFetchBreadcrumbHandler(client: Client): (handlerData: HandlerDataFetch) => void {\n return function _fetchBreadcrumb(handlerData: HandlerDataFetch): void {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n // We only capture complete fetch requests\n if (!endTimestamp) {\n return;\n }\n\n if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n return;\n }\n\n if (handlerData.error) {\n const data: FetchBreadcrumbData = handlerData.fetchData;\n const hint: FetchBreadcrumbHint = {\n data: handlerData.error,\n input: handlerData.args,\n startTimestamp,\n endTimestamp,\n };\n\n addBreadcrumb(\n {\n category: 'fetch',\n data,\n level: 'error',\n type: 'http',\n },\n hint,\n );\n } else {\n const response = handlerData.response as Response | undefined;\n const data: FetchBreadcrumbData = {\n ...handlerData.fetchData,\n status_code: response && response.status,\n };\n const hint: FetchBreadcrumbHint = {\n input: handlerData.args,\n response,\n startTimestamp,\n endTimestamp,\n };\n addBreadcrumb(\n {\n category: 'fetch',\n data,\n type: 'http',\n },\n hint,\n );\n }\n };\n}\n\n/**\n * Creates breadcrumbs from history API calls\n */\nfunction _getHistoryBreadcrumbHandler(client: Client): (handlerData: HandlerDataHistory) => void {\n return function _historyBreadcrumb(handlerData: HandlerDataHistory): void {\n if (getClient() !== client) {\n return;\n }\n\n let from: string | undefined = handlerData.from;\n let to: string | undefined = handlerData.to;\n const parsedLoc = parseUrl(WINDOW.location.href);\n let parsedFrom = from ? parseUrl(from) : undefined;\n const parsedTo = parseUrl(to);\n\n // Initial pushState doesn't provide `from` information\n if (!parsedFrom || !parsedFrom.path) {\n parsedFrom = parsedLoc;\n }\n\n // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n to = parsedTo.relative;\n }\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n from = parsedFrom.relative;\n }\n\n addBreadcrumb({\n category: 'navigation',\n data: {\n from,\n to,\n },\n });\n };\n}\n\nfunction _isEvent(event: unknown): event is Event {\n return !!event && !!(event as Record).target;\n}\n","import { convertIntegrationFnToClass } from '@sentry/core';\nimport type { Event, Exception, IntegrationFn, StackFrame } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\n\nconst INTEGRATION_NAME = 'Dedupe';\n\nconst dedupeIntegration: IntegrationFn = () => {\n let previousEvent: Event | undefined;\n\n return {\n name: INTEGRATION_NAME,\n processEvent(currentEvent) {\n // We want to ignore any non-error type events, e.g. transactions or replays\n // These should never be deduped, and also not be compared against as _previousEvent.\n if (currentEvent.type) {\n return currentEvent;\n }\n\n // Juuust in case something goes wrong\n try {\n if (_shouldDropEvent(currentEvent, previousEvent)) {\n DEBUG_BUILD && logger.warn('Event dropped due to being a duplicate of previously captured event.');\n return null;\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n return (previousEvent = currentEvent);\n },\n };\n};\n\n/** Deduplication filter */\n// eslint-disable-next-line deprecation/deprecation\nexport const Dedupe = convertIntegrationFnToClass(INTEGRATION_NAME, dedupeIntegration);\n\nfunction _shouldDropEvent(currentEvent: Event, previousEvent?: Event): boolean {\n if (!previousEvent) {\n return false;\n }\n\n if (_isSameMessageEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n if (_isSameExceptionEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n return false;\n}\n\nfunction _isSameMessageEvent(currentEvent: Event, previousEvent: Event): boolean {\n const currentMessage = currentEvent.message;\n const previousMessage = previousEvent.message;\n\n // If neither event has a message property, they were both exceptions, so bail out\n if (!currentMessage && !previousMessage) {\n return false;\n }\n\n // If only one event has a stacktrace, but not the other one, they are not the same\n if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {\n return false;\n }\n\n if (currentMessage !== previousMessage) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n\nfunction _isSameExceptionEvent(currentEvent: Event, previousEvent: Event): boolean {\n const previousException = _getExceptionFromEvent(previousEvent);\n const currentException = _getExceptionFromEvent(currentEvent);\n\n if (!previousException || !currentException) {\n return false;\n }\n\n if (previousException.type !== currentException.type || previousException.value !== currentException.value) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n\nfunction _isSameStacktrace(currentEvent: Event, previousEvent: Event): boolean {\n let currentFrames = _getFramesFromEvent(currentEvent);\n let previousFrames = _getFramesFromEvent(previousEvent);\n\n // If neither event has a stacktrace, they are assumed to be the same\n if (!currentFrames && !previousFrames) {\n return true;\n }\n\n // If only one event has a stacktrace, but not the other one, they are not the same\n if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {\n return false;\n }\n\n currentFrames = currentFrames as StackFrame[];\n previousFrames = previousFrames as StackFrame[];\n\n // If number of frames differ, they are not the same\n if (previousFrames.length !== currentFrames.length) {\n return false;\n }\n\n // Otherwise, compare the two\n for (let i = 0; i < previousFrames.length; i++) {\n const frameA = previousFrames[i];\n const frameB = currentFrames[i];\n\n if (\n frameA.filename !== frameB.filename ||\n frameA.lineno !== frameB.lineno ||\n frameA.colno !== frameB.colno ||\n frameA.function !== frameB.function\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction _isSameFingerprint(currentEvent: Event, previousEvent: Event): boolean {\n let currentFingerprint = currentEvent.fingerprint;\n let previousFingerprint = previousEvent.fingerprint;\n\n // If neither event has a fingerprint, they are assumed to be the same\n if (!currentFingerprint && !previousFingerprint) {\n return true;\n }\n\n // If only one event has a fingerprint, but not the other one, they are not the same\n if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) {\n return false;\n }\n\n currentFingerprint = currentFingerprint as string[];\n previousFingerprint = previousFingerprint as string[];\n\n // Otherwise, compare the two\n try {\n return !!(currentFingerprint.join('') === previousFingerprint.join(''));\n } catch (_oO) {\n return false;\n }\n}\n\nfunction _getExceptionFromEvent(event: Event): Exception | undefined {\n return event.exception && event.exception.values && event.exception.values[0];\n}\n\nfunction _getFramesFromEvent(event: Event): StackFrame[] | undefined {\n const exception = event.exception;\n\n if (exception) {\n try {\n // @ts-expect-error Object could be undefined\n return exception.values[0].stacktrace.frames;\n } catch (_oO) {\n return undefined;\n }\n }\n return undefined;\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { captureEvent, convertIntegrationFnToClass, getClient } from '@sentry/core';\nimport type { Client, Event, IntegrationFn, Primitive, StackParser } from '@sentry/types';\nimport {\n addGlobalErrorInstrumentationHandler,\n addGlobalUnhandledRejectionInstrumentationHandler,\n getLocationHref,\n isErrorEvent,\n isPrimitive,\n isString,\n logger,\n} from '@sentry/utils';\n\nimport type { BrowserClient } from '../client';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { shouldIgnoreOnError } from '../helpers';\n\ntype GlobalHandlersIntegrationsOptionKeys = 'onerror' | 'onunhandledrejection';\n\ntype GlobalHandlersIntegrations = Record;\n\nconst INTEGRATION_NAME = 'GlobalHandlers';\n\nconst globalHandlersIntegrations: IntegrationFn = (options: Partial = {}) => {\n const _options = {\n onerror: true,\n onunhandledrejection: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n Error.stackTraceLimit = 50;\n },\n setup(client) {\n if (_options.onerror) {\n _installGlobalOnErrorHandler(client);\n globalHandlerLog('onerror');\n }\n if (_options.onunhandledrejection) {\n _installGlobalOnUnhandledRejectionHandler(client);\n globalHandlerLog('onunhandledrejection');\n }\n },\n };\n};\n\n/** Global handlers */\n// eslint-disable-next-line deprecation/deprecation\nexport const GlobalHandlers = convertIntegrationFnToClass(INTEGRATION_NAME, globalHandlersIntegrations);\n\nfunction _installGlobalOnErrorHandler(client: Client): void {\n addGlobalErrorInstrumentationHandler(data => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const { msg, url, line, column, error } = data;\n\n const event =\n error === undefined && isString(msg)\n ? _eventFromIncompleteOnError(msg, url, line, column)\n : _enhanceEventWithInitialFrame(\n eventFromUnknownInput(stackParser, error || msg, undefined, attachStacktrace, false),\n url,\n line,\n column,\n );\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'onerror',\n },\n });\n });\n}\n\nfunction _installGlobalOnUnhandledRejectionHandler(client: Client): void {\n addGlobalUnhandledRejectionInstrumentationHandler(e => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const error = _getUnhandledRejectionError(e as unknown);\n\n const event = isPrimitive(error)\n ? _eventFromRejectionWithPrimitive(error)\n : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'onunhandledrejection',\n },\n });\n });\n}\n\nfunction _getUnhandledRejectionError(error: unknown): unknown {\n if (isPrimitive(error)) {\n return error;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const e = error as any;\n\n // dig the object of the rejection out of known event types\n try {\n // PromiseRejectionEvents store the object of the rejection under 'reason'\n // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n if ('reason' in e) {\n return e.reason;\n }\n\n // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n // https://github.com/getsentry/sentry-javascript/issues/2380\n else if ('detail' in e && 'reason' in e.detail) {\n return e.detail.reason;\n }\n } catch {} // eslint-disable-line no-empty\n\n return error;\n}\n\n/**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\nfunction _eventFromRejectionWithPrimitive(reason: Primitive): Event {\n return {\n exception: {\n values: [\n {\n type: 'UnhandledRejection',\n // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n value: `Non-Error promise rejection captured with value: ${String(reason)}`,\n },\n ],\n },\n };\n}\n\n/**\n * This function creates a stack from an old, error-less onerror handler.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _eventFromIncompleteOnError(msg: any, url: any, line: any, column: any): Event {\n const ERROR_TYPES_RE =\n /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\n\n // If 'message' is ErrorEvent, get real message from inside\n let message = isErrorEvent(msg) ? msg.message : msg;\n let name = 'Error';\n\n const groups = message.match(ERROR_TYPES_RE);\n if (groups) {\n name = groups[1];\n message = groups[2];\n }\n\n const event = {\n exception: {\n values: [\n {\n type: name,\n value: message,\n },\n ],\n },\n };\n\n return _enhanceEventWithInitialFrame(event, url, line, column);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _enhanceEventWithInitialFrame(event: Event, url: any, line: any, column: any): Event {\n // event.exception\n const e = (event.exception = event.exception || {});\n // event.exception.values\n const ev = (e.values = e.values || []);\n // event.exception.values[0]\n const ev0 = (ev[0] = ev[0] || {});\n // event.exception.values[0].stacktrace\n const ev0s = (ev0.stacktrace = ev0.stacktrace || {});\n // event.exception.values[0].stacktrace.frames\n const ev0sf = (ev0s.frames = ev0s.frames || []);\n\n const colno = isNaN(parseInt(column, 10)) ? undefined : column;\n const lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n const filename = isString(url) && url.length > 0 ? url : getLocationHref();\n\n // event.exception.values[0].stacktrace.frames\n if (ev0sf.length === 0) {\n ev0sf.push({\n colno,\n filename,\n function: '?',\n in_app: true,\n lineno,\n });\n }\n\n return event;\n}\n\nfunction globalHandlerLog(type: string): void {\n DEBUG_BUILD && logger.log(`Global Handler attached: ${type}`);\n}\n\nfunction getOptions(): { stackParser: StackParser; attachStacktrace?: boolean } {\n const client = getClient();\n const options = (client && client.getOptions()) || {\n stackParser: () => [],\n attachStacktrace: false,\n };\n return options;\n}\n","import { convertIntegrationFnToClass } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\n\nimport { WINDOW } from '../helpers';\n\nconst INTEGRATION_NAME = 'HttpContext';\n\nconst httpContextIntegration: IntegrationFn = () => {\n return {\n name: INTEGRATION_NAME,\n preprocessEvent(event) {\n // if none of the information we want exists, don't bother\n if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n return;\n }\n\n // grab as much info as exists and add it to the event\n const url = (event.request && event.request.url) || (WINDOW.location && WINDOW.location.href);\n const { referrer } = WINDOW.document || {};\n const { userAgent } = WINDOW.navigator || {};\n\n const headers = {\n ...(event.request && event.request.headers),\n ...(referrer && { Referer: referrer }),\n ...(userAgent && { 'User-Agent': userAgent }),\n };\n const request = { ...event.request, ...(url && { url }), headers };\n\n event.request = request;\n },\n };\n};\n\n/** HttpContext integration collects information about HTTP request headers */\n// eslint-disable-next-line deprecation/deprecation\nexport const HttpContext = convertIntegrationFnToClass(INTEGRATION_NAME, httpContextIntegration);\n","import { convertIntegrationFnToClass } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\nimport { applyAggregateErrorsToEvent } from '@sentry/utils';\nimport { exceptionFromError } from '../eventbuilder';\n\ninterface LinkedErrorsOptions {\n key?: string;\n limit?: number;\n}\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\nconst INTEGRATION_NAME = 'LinkedErrors';\n\nconst linkedErrorsIntegration: IntegrationFn = (options: LinkedErrorsOptions = {}) => {\n const limit = options.limit || DEFAULT_LIMIT;\n const key = options.key || DEFAULT_KEY;\n\n return {\n name: INTEGRATION_NAME,\n preprocessEvent(event, hint, client) {\n const options = client.getOptions();\n\n applyAggregateErrorsToEvent(\n // This differs from the LinkedErrors integration in core by using a different exceptionFromError function\n exceptionFromError,\n options.stackParser,\n options.maxValueLength,\n key,\n limit,\n event,\n hint,\n );\n },\n };\n};\n\n/** Aggregrate linked errors in an event. */\n// eslint-disable-next-line deprecation/deprecation\nexport const LinkedErrors = convertIntegrationFnToClass(INTEGRATION_NAME, linkedErrorsIntegration);\n","import { convertIntegrationFnToClass } from '@sentry/core';\nimport type { IntegrationFn, WrappedFunction } from '@sentry/types';\nimport { fill, getFunctionName, getOriginalFunction } from '@sentry/utils';\n\nimport { WINDOW, wrap } from '../helpers';\n\nconst DEFAULT_EVENT_TARGET = [\n 'EventTarget',\n 'Window',\n 'Node',\n 'ApplicationCache',\n 'AudioTrackList',\n 'BroadcastChannel',\n 'ChannelMergerNode',\n 'CryptoOperation',\n 'EventSource',\n 'FileReader',\n 'HTMLUnknownElement',\n 'IDBDatabase',\n 'IDBRequest',\n 'IDBTransaction',\n 'KeyOperation',\n 'MediaController',\n 'MessagePort',\n 'ModalWindow',\n 'Notification',\n 'SVGElementInstance',\n 'Screen',\n 'SharedWorker',\n 'TextTrack',\n 'TextTrackCue',\n 'TextTrackList',\n 'WebSocket',\n 'WebSocketWorker',\n 'Worker',\n 'XMLHttpRequest',\n 'XMLHttpRequestEventTarget',\n 'XMLHttpRequestUpload',\n];\n\nconst INTEGRATION_NAME = 'TryCatch';\n\ntype XMLHttpRequestProp = 'onload' | 'onerror' | 'onprogress' | 'onreadystatechange';\n\ninterface TryCatchOptions {\n setTimeout: boolean;\n setInterval: boolean;\n requestAnimationFrame: boolean;\n XMLHttpRequest: boolean;\n eventTarget: boolean | string[];\n}\n\nconst tryCatchIntegration: IntegrationFn = (options: Partial = {}) => {\n const _options = {\n XMLHttpRequest: true,\n eventTarget: true,\n requestAnimationFrame: true,\n setInterval: true,\n setTimeout: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO: This currently only works for the first client this is setup\n // We may want to adjust this to check for client etc.\n setupOnce() {\n if (_options.setTimeout) {\n fill(WINDOW, 'setTimeout', _wrapTimeFunction);\n }\n\n if (_options.setInterval) {\n fill(WINDOW, 'setInterval', _wrapTimeFunction);\n }\n\n if (_options.requestAnimationFrame) {\n fill(WINDOW, 'requestAnimationFrame', _wrapRAF);\n }\n\n if (_options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {\n fill(XMLHttpRequest.prototype, 'send', _wrapXHR);\n }\n\n const eventTargetOption = _options.eventTarget;\n if (eventTargetOption) {\n const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;\n eventTarget.forEach(_wrapEventTarget);\n }\n },\n };\n};\n\n/** Wrap timer functions and event targets to catch errors and provide better meta data */\n// eslint-disable-next-line deprecation/deprecation\nexport const TryCatch = convertIntegrationFnToClass(INTEGRATION_NAME, tryCatchIntegration);\n\nfunction _wrapTimeFunction(original: () => void): () => number {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (this: any, ...args: any[]): number {\n const originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n data: { function: getFunctionName(original) },\n handled: false,\n type: 'instrument',\n },\n });\n return original.apply(this, args);\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _wrapRAF(original: any): (callback: () => void) => any {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (this: any, callback: () => void): () => void {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return original.apply(this, [\n wrap(callback, {\n mechanism: {\n data: {\n function: 'requestAnimationFrame',\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'instrument',\n },\n }),\n ]);\n };\n}\n\nfunction _wrapXHR(originalSend: () => void): () => void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (this: XMLHttpRequest, ...args: any[]): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const xhr = this;\n const xmlHttpRequestProps: XMLHttpRequestProp[] = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n xmlHttpRequestProps.forEach(prop => {\n if (prop in xhr && typeof xhr[prop] === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fill(xhr, prop, function (original: WrappedFunction): () => any {\n const wrapOptions = {\n mechanism: {\n data: {\n function: prop,\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'instrument',\n },\n };\n\n // If Instrument integration has been called before TryCatch, get the name of original function\n const originalFunction = getOriginalFunction(original);\n if (originalFunction) {\n wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);\n }\n\n // Otherwise wrap directly\n return wrap(original, wrapOptions);\n });\n }\n });\n\n return originalSend.apply(this, args);\n };\n}\n\nfunction _wrapEventTarget(target: string): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const globalObject = WINDOW as { [key: string]: any };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const proto = globalObject[target] && globalObject[target].prototype;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (original: VoidFunction,): (\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ) => void {\n return function (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this: any,\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): (eventName: string, fn: EventListenerObject, capture?: boolean, secure?: boolean) => void {\n try {\n if (typeof fn.handleEvent === 'function') {\n // ESlint disable explanation:\n // First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would\n // introduce a bug here, because bind returns a new function that doesn't have our\n // flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.\n // Without those flags, every call to addEventListener wraps the function again, causing a memory leak.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n fn.handleEvent = wrap(fn.handleEvent, {\n mechanism: {\n data: {\n function: 'handleEvent',\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'instrument',\n },\n });\n }\n } catch (err) {\n // can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n return original.apply(this, [\n eventName,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrap(fn as any as WrappedFunction, {\n mechanism: {\n data: {\n function: 'addEventListener',\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'instrument',\n },\n }),\n options,\n ]);\n };\n });\n\n fill(\n proto,\n 'removeEventListener',\n function (\n originalRemoveEventListener: () => void,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): (this: any, eventName: string, fn: EventListenerObject, options?: boolean | EventListenerOptions) => () => void {\n return function (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this: any,\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | EventListenerOptions,\n ): () => void {\n /**\n * There are 2 possible scenarios here:\n *\n * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n * as a pass-through, and call original `removeEventListener` with it.\n *\n * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n *\n * When someone adds a handler prior to initialization, and then do it again, but after,\n * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n * to get rid of the initial handler and it'd stick there forever.\n */\n const wrappedEventHandler = fn as unknown as WrappedFunction;\n try {\n const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n } catch (e) {\n // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n };\n },\n );\n}\n","export const DEFAULT_ENVIRONMENT = 'production';\n","declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n","import type { Event, EventHint, EventProcessor } from '@sentry/types';\nimport { SyncPromise, getGlobalSingleton, isThenable, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from './debug-build';\n\n/**\n * Returns the global event processors.\n * @deprecated Global event processors will be removed in v8.\n */\nexport function getGlobalEventProcessors(): EventProcessor[] {\n return getGlobalSingleton('globalEventProcessors', () => []);\n}\n\n/**\n * Add a EventProcessor to be kept globally.\n * @deprecated Use `addEventProcessor` instead. Global event processors will be removed in v8.\n */\nexport function addGlobalEventProcessor(callback: EventProcessor): void {\n // eslint-disable-next-line deprecation/deprecation\n getGlobalEventProcessors().push(callback);\n}\n\n/**\n * Process an array of event processors, returning the processed event (or `null` if the event was dropped).\n */\nexport function notifyEventProcessors(\n processors: EventProcessor[],\n event: Event | null,\n hint: EventHint,\n index: number = 0,\n): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n const processor = processors[index];\n if (event === null || typeof processor !== 'function') {\n resolve(event);\n } else {\n const result = processor({ ...event }, hint) as Event | null;\n\n DEBUG_BUILD && processor.id && result === null && logger.log(`Event processor \"${processor.id}\" dropped event`);\n\n if (isThenable(result)) {\n void result\n .then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n .then(null, reject);\n } else {\n void notifyEventProcessors(processors, result, hint, index + 1)\n .then(resolve)\n .then(null, reject);\n }\n }\n });\n}\n","import type {\n Breadcrumb,\n BreadcrumbHint,\n CaptureContext,\n CheckIn,\n Client,\n CustomSamplingContext,\n Event,\n EventHint,\n Extra,\n Extras,\n FinishedCheckIn,\n MonitorConfig,\n Primitive,\n Scope as ScopeInterface,\n Session,\n SessionContext,\n Severity,\n SeverityLevel,\n TransactionContext,\n User,\n} from '@sentry/types';\nimport { GLOBAL_OBJ, isThenable, logger, timestampInSeconds, uuid4 } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from './constants';\nimport { DEBUG_BUILD } from './debug-build';\nimport type { Hub } from './hub';\nimport { getCurrentHub, getIsolationScope } from './hub';\nimport type { Scope } from './scope';\nimport { closeSession, makeSession, updateSession } from './session';\nimport type { ExclusiveEventHintOrCaptureContext } from './utils/prepareEvent';\nimport { parseEventHintOrCaptureContext } from './utils/prepareEvent';\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param hint Optinal additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\nexport function captureException(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n exception: any,\n hint?: ExclusiveEventHintOrCaptureContext,\n): string {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureException(exception, parseEventHintOrCaptureContext(hint));\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param captureContext Define the level of the message or pass in additional data to attach to the message.\n * @returns the id of the captured message.\n */\nexport function captureMessage(\n message: string,\n // eslint-disable-next-line deprecation/deprecation\n captureContext?: CaptureContext | Severity | SeverityLevel,\n): string {\n // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n const level = typeof captureContext === 'string' ? captureContext : undefined;\n const context = typeof captureContext !== 'string' ? { captureContext } : undefined;\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureMessage(message, level, context);\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param exception The event to send to Sentry.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\nexport function captureEvent(event: Event, hint?: EventHint): string {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureEvent(event, hint);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n *\n * @deprecated Use getCurrentScope() directly.\n */\nexport function configureScope(callback: (scope: Scope) => void): ReturnType {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().configureScope(callback);\n}\n\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\nexport function addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): ReturnType {\n getCurrentHub().addBreadcrumb(breadcrumb, hint);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function setContext(name: string, context: { [key: string]: any } | null): ReturnType {\n getCurrentHub().setContext(name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\nexport function setExtras(extras: Extras): ReturnType {\n getCurrentHub().setExtras(extras);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\nexport function setExtra(key: string, extra: Extra): ReturnType {\n getCurrentHub().setExtra(key, extra);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\nexport function setTags(tags: { [key: string]: Primitive }): ReturnType {\n getCurrentHub().setTags(tags);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\nexport function setTag(key: string, value: Primitive): ReturnType {\n getCurrentHub().setTag(key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\nexport function setUser(user: User | null): ReturnType {\n getCurrentHub().setUser(user);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n */\nexport function withScope(callback: (scope: Scope) => T): T;\n/**\n * Set the given scope as the active scope in the callback.\n */\nexport function withScope(scope: ScopeInterface | undefined, callback: (scope: Scope) => T): T;\n/**\n * Either creates a new active scope, or sets the given scope as active scope in the given callback.\n */\nexport function withScope(\n ...rest: [callback: (scope: Scope) => T] | [scope: ScopeInterface | undefined, callback: (scope: Scope) => T]\n): T {\n // If a scope is defined, we want to make this the active scope instead of the default one\n if (rest.length === 2) {\n const [scope, callback] = rest;\n if (!scope) {\n return getCurrentHub().withScope(callback);\n }\n\n const hub = getCurrentHub();\n return hub.withScope(() => {\n hub.getStackTop().scope = scope as Scope;\n return callback(scope as Scope);\n });\n }\n\n return getCurrentHub().withScope(rest[0]);\n}\n\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.end()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call\n * `startTransaction` directly on the hub.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\nexport function startTransaction(\n context: TransactionContext,\n customSamplingContext?: CustomSamplingContext,\n): ReturnType {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().startTransaction({ ...context }, customSamplingContext);\n}\n\n/**\n * Create a cron monitor check in and send it to Sentry.\n *\n * @param checkIn An object that describes a check in.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nexport function captureCheckIn(checkIn: CheckIn, upsertMonitorConfig?: MonitorConfig): string {\n const scope = getCurrentScope();\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. No client defined.');\n } else if (!client.captureCheckIn) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. Client does not support sending check-ins.');\n } else {\n return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);\n }\n\n return uuid4();\n}\n\n/**\n * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes.\n *\n * @param monitorSlug The distinct slug of the monitor.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nexport function withMonitor(\n monitorSlug: CheckIn['monitorSlug'],\n callback: () => T,\n upsertMonitorConfig?: MonitorConfig,\n): T {\n const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig);\n const now = timestampInSeconds();\n\n function finishCheckIn(status: FinishedCheckIn['status']): void {\n captureCheckIn({ monitorSlug, status, checkInId, duration: timestampInSeconds() - now });\n }\n\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback();\n } catch (e) {\n finishCheckIn('error');\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n Promise.resolve(maybePromiseResult).then(\n () => {\n finishCheckIn('ok');\n },\n () => {\n finishCheckIn('error');\n },\n );\n } else {\n finishCheckIn('ok');\n }\n\n return maybePromiseResult;\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function flush(timeout?: number): Promise {\n const client = getClient();\n if (client) {\n return client.flush(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function close(timeout?: number): Promise {\n const client = getClient();\n if (client) {\n return client.close(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events and disable SDK. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n * @deprecated This function will be removed in the next major version of the Sentry SDK.\n */\nexport function lastEventId(): string | undefined {\n return getCurrentHub().lastEventId();\n}\n\n/**\n * Get the currently active client.\n */\nexport function getClient(): C | undefined {\n return getCurrentHub().getClient();\n}\n\n/**\n * Get the currently active scope.\n */\nexport function getCurrentScope(): Scope {\n return getCurrentHub().getScope();\n}\n\n/**\n * Start a session on the current isolation scope.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns the new active session\n */\nexport function startSession(context?: SessionContext): Session {\n const client = getClient();\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n release,\n environment,\n user: isolationScope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = isolationScope.getSession();\n if (currentSession && currentSession.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n\n endSession();\n\n // Afterwards we set the new session on the scope\n isolationScope.setSession(session);\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession(session);\n\n return session;\n}\n\n/**\n * End the session on the current isolation scope.\n */\nexport function endSession(): void {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const session = isolationScope.getSession();\n if (session) {\n closeSession(session);\n }\n _sendSessionUpdate();\n\n // the session is over; take it off of the scope\n isolationScope.setSession();\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession();\n}\n\n/**\n * Sends the current Session on the scope\n */\nfunction _sendSessionUpdate(): void {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n const client = getClient();\n // TODO (v8): Remove currentScope and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session && client && client.captureSession) {\n client.captureSession(session);\n }\n}\n\n/**\n * Sends the current session on the scope to Sentry\n *\n * @param end If set the session will be marked as exited and removed from the scope.\n * Defaults to `false`.\n */\nexport function captureSession(end: boolean = false): void {\n // both send the update and pull the session from the scope\n if (end) {\n endSession();\n return;\n }\n\n // only send the update\n _sendSessionUpdate();\n}\n","/* eslint-disable max-lines */\nimport type {\n Breadcrumb,\n BreadcrumbHint,\n Client,\n CustomSamplingContext,\n Event,\n EventHint,\n Extra,\n Extras,\n Hub as HubInterface,\n Integration,\n IntegrationClass,\n Primitive,\n Session,\n SessionContext,\n Severity,\n SeverityLevel,\n Transaction,\n TransactionContext,\n User,\n} from '@sentry/types';\nimport {\n GLOBAL_OBJ,\n consoleSandbox,\n dateTimestampInSeconds,\n getGlobalSingleton,\n isThenable,\n logger,\n uuid4,\n} from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from './constants';\nimport { DEBUG_BUILD } from './debug-build';\nimport { Scope } from './scope';\nimport { closeSession, makeSession, updateSession } from './session';\nimport { SDK_VERSION } from './version';\n\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\nexport const API_VERSION = parseFloat(SDK_VERSION);\n\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\nconst DEFAULT_BREADCRUMBS = 100;\n\nexport interface RunWithAsyncContextOptions {\n /** Whether to reuse an existing async context if one exists. Defaults to false. */\n reuseExisting?: boolean;\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Strategy used to track async context.\n */\nexport interface AsyncContextStrategy {\n /**\n * Gets the current async context. Returns undefined if there is no current async context.\n */\n getCurrentHub: () => Hub | undefined;\n /**\n * Runs the supplied callback in its own async context.\n */\n runWithAsyncContext(callback: () => T, options: RunWithAsyncContextOptions): T;\n}\n\n/**\n * A layer in the process stack.\n * @hidden\n */\nexport interface Layer {\n client?: Client;\n scope: Scope;\n}\n\n/**\n * An object that contains a hub and maintains a scope stack.\n * @hidden\n */\nexport interface Carrier {\n __SENTRY__?: {\n hub?: Hub;\n acs?: AsyncContextStrategy;\n /**\n * Extra Hub properties injected by various SDKs\n */\n integrations?: Integration[];\n extensions?: {\n /** Extension methods for the hub, which are bound to the current Hub instance */\n // eslint-disable-next-line @typescript-eslint/ban-types\n [key: string]: Function;\n };\n };\n}\n\n/**\n * @inheritDoc\n */\nexport class Hub implements HubInterface {\n /** Is a {@link Layer}[] containing the client and scope */\n private readonly _stack: Layer[];\n\n /** Contains the last event id of a captured event. */\n private _lastEventId?: string;\n\n private _isolationScope: Scope;\n\n /**\n * Creates a new instance of the hub, will push one {@link Layer} into the\n * internal stack on creation.\n *\n * @param client bound to the hub.\n * @param scope bound to the hub.\n * @param version number, higher number means higher priority.\n */\n public constructor(\n client?: Client,\n scope?: Scope,\n isolationScope?: Scope,\n private readonly _version: number = API_VERSION,\n ) {\n let assignedScope;\n if (!scope) {\n assignedScope = new Scope();\n assignedScope.setClient(client);\n } else {\n assignedScope = scope;\n }\n\n let assignedIsolationScope;\n if (!isolationScope) {\n assignedIsolationScope = new Scope();\n assignedIsolationScope.setClient(client);\n } else {\n assignedIsolationScope = isolationScope;\n }\n\n this._stack = [{ scope: assignedScope }];\n\n if (client) {\n this.bindClient(client);\n }\n\n this._isolationScope = assignedIsolationScope;\n }\n\n /**\n * @inheritDoc\n */\n public isOlderThan(version: number): boolean {\n return this._version < version;\n }\n\n /**\n * @inheritDoc\n */\n public bindClient(client?: Client): void {\n const top = this.getStackTop();\n top.client = client;\n top.scope.setClient(client);\n if (client && client.setupIntegrations) {\n client.setupIntegrations();\n }\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `withScope` instead.\n */\n public pushScope(): Scope {\n // We want to clone the content of prev scope\n const scope = this.getScope().clone();\n this.getStack().push({\n client: this.getClient(),\n scope,\n });\n return scope;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `withScope` instead.\n */\n public popScope(): boolean {\n if (this.getStack().length <= 1) return false;\n return !!this.getStack().pop();\n }\n\n /**\n * @inheritDoc\n */\n public withScope(callback: (scope: Scope) => T): T {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.pushScope();\n\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback(scope);\n } catch (e) {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n // @ts-expect-error - isThenable returns the wrong type\n return maybePromiseResult.then(\n res => {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n return res;\n },\n e => {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n throw e;\n },\n );\n }\n\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n return maybePromiseResult;\n }\n\n /**\n * @inheritDoc\n */\n public getClient(): C | undefined {\n return this.getStackTop().client as C;\n }\n\n /** Returns the scope of the top stack. */\n public getScope(): Scope {\n return this.getStackTop().scope;\n }\n\n /** @inheritdoc */\n public getIsolationScope(): Scope {\n return this._isolationScope;\n }\n\n /** Returns the scope stack for domains or the process. */\n public getStack(): Layer[] {\n return this._stack;\n }\n\n /** Returns the topmost scope layer in the order domain > local > process. */\n public getStackTop(): Layer {\n return this._stack[this._stack.length - 1];\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureException()` instead.\n */\n public captureException(exception: unknown, hint?: EventHint): string {\n const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n const syntheticException = new Error('Sentry syntheticException');\n this.getScope().captureException(exception, {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureMessage()` instead.\n */\n public captureMessage(\n message: string,\n // eslint-disable-next-line deprecation/deprecation\n level?: Severity | SeverityLevel,\n hint?: EventHint,\n ): string {\n const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n const syntheticException = new Error(message);\n this.getScope().captureMessage(message, level, {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureEvent()` instead.\n */\n public captureEvent(event: Event, hint?: EventHint): string {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n if (!event.type) {\n this._lastEventId = eventId;\n }\n\n this.getScope().captureEvent(event, { ...hint, event_id: eventId });\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public lastEventId(): string | undefined {\n return this._lastEventId;\n }\n\n /**\n * @inheritDoc\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void {\n const { scope, client } = this.getStackTop();\n\n if (!client) return;\n\n const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =\n (client.getOptions && client.getOptions()) || {};\n\n if (maxBreadcrumbs <= 0) return;\n\n const timestamp = dateTimestampInSeconds();\n const mergedBreadcrumb = { timestamp, ...breadcrumb };\n const finalBreadcrumb = beforeBreadcrumb\n ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) as Breadcrumb | null)\n : mergedBreadcrumb;\n\n if (finalBreadcrumb === null) return;\n\n if (client.emit) {\n client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint);\n }\n\n scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);\n }\n\n /**\n * @inheritDoc\n */\n public setUser(user: User | null): void {\n this.getScope().setUser(user);\n }\n\n /**\n * @inheritDoc\n */\n public setTags(tags: { [key: string]: Primitive }): void {\n this.getScope().setTags(tags);\n }\n\n /**\n * @inheritDoc\n */\n public setExtras(extras: Extras): void {\n this.getScope().setExtras(extras);\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: Primitive): void {\n this.getScope().setTag(key, value);\n }\n\n /**\n * @inheritDoc\n */\n public setExtra(key: string, extra: Extra): void {\n this.getScope().setExtra(key, extra);\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setContext(name: string, context: { [key: string]: any } | null): void {\n this.getScope().setContext(name, context);\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `getScope()` directly.\n */\n public configureScope(callback: (scope: Scope) => void): void {\n const { scope, client } = this.getStackTop();\n if (client) {\n callback(scope);\n }\n }\n\n /**\n * @inheritDoc\n */\n public run(callback: (hub: Hub) => void): void {\n const oldHub = makeMain(this);\n try {\n callback(this);\n } finally {\n makeMain(oldHub);\n }\n }\n\n /**\n * @inheritDoc\n */\n public getIntegration(integration: IntegrationClass): T | null {\n const client = this.getClient();\n if (!client) return null;\n try {\n return client.getIntegration(integration);\n } catch (_oO) {\n DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);\n return null;\n }\n }\n\n /**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.end()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\n public startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction {\n const result = this._callExtensionMethod('startTransaction', context, customSamplingContext);\n\n if (DEBUG_BUILD && !result) {\n const client = this.getClient();\n if (!client) {\n logger.warn(\n \"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'\",\n );\n } else {\n logger.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n`);\n }\n }\n\n return result;\n }\n\n /**\n * @inheritDoc\n */\n public traceHeaders(): { [key: string]: string } {\n return this._callExtensionMethod<{ [key: string]: string }>('traceHeaders');\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use top level `captureSession` instead.\n */\n public captureSession(endSession: boolean = false): void {\n // both send the update and pull the session from the scope\n if (endSession) {\n // eslint-disable-next-line deprecation/deprecation\n return this.endSession();\n }\n\n // only send the update\n this._sendSessionUpdate();\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top level `endSession` instead.\n */\n public endSession(): void {\n const layer = this.getStackTop();\n const scope = layer.scope;\n const session = scope.getSession();\n if (session) {\n closeSession(session);\n }\n this._sendSessionUpdate();\n\n // the session is over; take it off of the scope\n scope.setSession();\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top level `startSession` instead.\n */\n public startSession(context?: SessionContext): Session {\n const { scope, client } = this.getStackTop();\n const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n release,\n environment,\n user: scope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = scope.getSession && scope.getSession();\n if (currentSession && currentSession.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n // eslint-disable-next-line deprecation/deprecation\n this.endSession();\n\n // Afterwards we set the new session on the scope\n scope.setSession(session);\n\n return session;\n }\n\n /**\n * Returns if default PII should be sent to Sentry and propagated in ourgoing requests\n * when Tracing is used.\n *\n * @deprecated Use top-level `getClient().getOptions().sendDefaultPii` instead. This function\n * only unnecessarily increased API surface but only wrapped accessing the option.\n */\n public shouldSendDefaultPii(): boolean {\n const client = this.getClient();\n const options = client && client.getOptions();\n return Boolean(options && options.sendDefaultPii);\n }\n\n /**\n * Sends the current Session on the scope\n */\n private _sendSessionUpdate(): void {\n const { scope, client } = this.getStackTop();\n\n const session = scope.getSession();\n if (session && client && client.captureSession) {\n client.captureSession(session);\n }\n }\n\n /**\n * Internal helper function to call a method on the top client if it exists.\n *\n * @param method The method to call on the client.\n * @param args Arguments to pass to the client function.\n */\n private _withClient(callback: (client: Client, scope: Scope) => void): void {\n const { scope, client } = this.getStackTop();\n if (client) {\n callback(client, scope);\n }\n }\n\n /**\n * Calls global extension method and binding current instance to the function call\n */\n // @ts-expect-error Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _callExtensionMethod(method: string, ...args: any[]): T {\n const carrier = getMainCarrier();\n const sentry = carrier.__SENTRY__;\n if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n return sentry.extensions[method].apply(this, args);\n }\n DEBUG_BUILD && logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);\n }\n}\n\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\nexport function getMainCarrier(): Carrier {\n GLOBAL_OBJ.__SENTRY__ = GLOBAL_OBJ.__SENTRY__ || {\n extensions: {},\n hub: undefined,\n };\n return GLOBAL_OBJ;\n}\n\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n */\nexport function makeMain(hub: Hub): Hub {\n const registry = getMainCarrier();\n const oldHub = getHubFromCarrier(registry);\n setHubOnCarrier(registry, hub);\n return oldHub;\n}\n\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n */\nexport function getCurrentHub(): Hub {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n\n if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n const hub = registry.__SENTRY__.acs.getCurrentHub();\n\n if (hub) {\n return hub;\n }\n }\n\n // Return hub that lives on a global object\n return getGlobalHub(registry);\n}\n\n/**\n * Get the currently active isolation scope.\n * The isolation scope is active for the current exection context,\n * meaning that it will remain stable for the same Hub.\n */\nexport function getIsolationScope(): Scope {\n return getCurrentHub().getIsolationScope();\n}\n\nfunction getGlobalHub(registry: Carrier = getMainCarrier()): Hub {\n // If there's no hub, or its an old API, assign a new one\n if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {\n setHubOnCarrier(registry, new Hub());\n }\n\n // Return hub that lives on a global object\n return getHubFromCarrier(registry);\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * If the carrier does not contain a hub, a new hub is created with the global hub client and scope.\n */\nexport function ensureHubOnCarrier(carrier: Carrier, parent: Hub = getGlobalHub()): void {\n // If there's no hub on current domain, or it's an old API, assign a new one\n if (!hasHubOnCarrier(carrier) || getHubFromCarrier(carrier).isOlderThan(API_VERSION)) {\n const client = parent.getClient();\n const scope = parent.getScope();\n const isolationScope = parent.getIsolationScope();\n setHubOnCarrier(carrier, new Hub(client, scope.clone(), isolationScope.clone()));\n }\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nexport function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n registry.__SENTRY__ = registry.__SENTRY__ || {};\n registry.__SENTRY__.acs = strategy;\n}\n\n/**\n * Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.\n *\n * @param callback The callback to run in its own async context\n * @param options Options to pass to the async context strategy\n * @returns The result of the callback\n */\nexport function runWithAsyncContext(callback: () => T, options: RunWithAsyncContextOptions = {}): T {\n const registry = getMainCarrier();\n\n if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n return registry.__SENTRY__.acs.runWithAsyncContext(callback, options);\n }\n\n // if there was no strategy, fallback to just calling the callback\n return callback();\n}\n\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\nfunction hasHubOnCarrier(carrier: Carrier): boolean {\n return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\nexport function getHubFromCarrier(carrier: Carrier): Hub {\n return getGlobalSingleton('hub', () => new Hub(), carrier);\n}\n\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n * @returns A boolean indicating success or failure\n */\nexport function setHubOnCarrier(carrier: Carrier, hub: Hub): boolean {\n if (!carrier) return false;\n const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});\n __SENTRY__.hub = hub;\n return true;\n}\n","import type { Client, Event, EventHint, EventProcessor, Hub, Integration, IntegrationFn, Options } from '@sentry/types';\nimport { arrayify, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { addGlobalEventProcessor } from './eventProcessors';\nimport { getClient } from './exports';\nimport { getCurrentHub } from './hub';\n\ndeclare module '@sentry/types' {\n interface Integration {\n isDefaultInstance?: boolean;\n }\n}\n\nexport const installedIntegrations: string[] = [];\n\n/** Map of integrations assigned to a client */\nexport type IntegrationIndex = {\n [key: string]: Integration;\n};\n\n/**\n * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to\n * preseve the order of integrations in the array.\n *\n * @private\n */\nfunction filterDuplicates(integrations: Integration[]): Integration[] {\n const integrationsByName: { [key: string]: Integration } = {};\n\n integrations.forEach(currentInstance => {\n const { name } = currentInstance;\n\n const existingInstance = integrationsByName[name];\n\n // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a\n // default instance to overwrite an existing user instance\n if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {\n return;\n }\n\n integrationsByName[name] = currentInstance;\n });\n\n return Object.keys(integrationsByName).map(k => integrationsByName[k]);\n}\n\n/** Gets integrations to install */\nexport function getIntegrationsToSetup(options: Pick): Integration[] {\n const defaultIntegrations = options.defaultIntegrations || [];\n const userIntegrations = options.integrations;\n\n // We flag default instances, so that later we can tell them apart from any user-created instances of the same class\n defaultIntegrations.forEach(integration => {\n integration.isDefaultInstance = true;\n });\n\n let integrations: Integration[];\n\n if (Array.isArray(userIntegrations)) {\n integrations = [...defaultIntegrations, ...userIntegrations];\n } else if (typeof userIntegrations === 'function') {\n integrations = arrayify(userIntegrations(defaultIntegrations));\n } else {\n integrations = defaultIntegrations;\n }\n\n const finalIntegrations = filterDuplicates(integrations);\n\n // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or\n // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event\n // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore\n // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array.\n const debugIndex = findIndex(finalIntegrations, integration => integration.name === 'Debug');\n if (debugIndex !== -1) {\n const [debugInstance] = finalIntegrations.splice(debugIndex, 1);\n finalIntegrations.push(debugInstance);\n }\n\n return finalIntegrations;\n}\n\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\nexport function setupIntegrations(client: Client, integrations: Integration[]): IntegrationIndex {\n const integrationIndex: IntegrationIndex = {};\n\n integrations.forEach(integration => {\n // guard against empty provided integrations\n if (integration) {\n setupIntegration(client, integration, integrationIndex);\n }\n });\n\n return integrationIndex;\n}\n\n/** Setup a single integration. */\nexport function setupIntegration(client: Client, integration: Integration, integrationIndex: IntegrationIndex): void {\n if (integrationIndex[integration.name]) {\n DEBUG_BUILD && logger.log(`Integration skipped because it was already installed: ${integration.name}`);\n return;\n }\n integrationIndex[integration.name] = integration;\n\n // `setupOnce` is only called the first time\n if (installedIntegrations.indexOf(integration.name) === -1) {\n // eslint-disable-next-line deprecation/deprecation\n integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n installedIntegrations.push(integration.name);\n }\n\n // `setup` is run for each client\n if (integration.setup && typeof integration.setup === 'function') {\n integration.setup(client);\n }\n\n if (client.on && typeof integration.preprocessEvent === 'function') {\n const callback = integration.preprocessEvent.bind(integration) as typeof integration.preprocessEvent;\n client.on('preprocessEvent', (event, hint) => callback(event, hint, client));\n }\n\n if (client.addEventProcessor && typeof integration.processEvent === 'function') {\n const callback = integration.processEvent.bind(integration) as typeof integration.processEvent;\n\n const processor = Object.assign((event: Event, hint: EventHint) => callback(event, hint, client), {\n id: integration.name,\n });\n\n client.addEventProcessor(processor);\n }\n\n DEBUG_BUILD && logger.log(`Integration installed: ${integration.name}`);\n}\n\n/** Add an integration to the current hub's client. */\nexport function addIntegration(integration: Integration): void {\n const client = getClient();\n\n if (!client || !client.addIntegration) {\n DEBUG_BUILD && logger.warn(`Cannot add integration \"${integration.name}\" because no SDK Client is available.`);\n return;\n }\n\n client.addIntegration(integration);\n}\n\n// Polyfill for Array.findIndex(), which is not supported in ES5\nfunction findIndex(arr: T[], callback: (item: T) => boolean): number {\n for (let i = 0; i < arr.length; i++) {\n if (callback(arr[i]) === true) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n * Convert a new integration function to the legacy class syntax.\n * In v8, we can remove this and instead export the integration functions directly.\n *\n * @deprecated This will be removed in v8!\n */\nexport function convertIntegrationFnToClass(\n name: string,\n fn: Fn,\n): Integration & {\n id: string;\n new (...args: Parameters): Integration &\n ReturnType & {\n setupOnce: (addGlobalEventProcessor?: (callback: EventProcessor) => void, getCurrentHub?: () => Hub) => void;\n };\n} {\n return Object.assign(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function ConvertedIntegration(...rest: Parameters) {\n return {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setupOnce: () => {},\n ...fn(...rest),\n };\n },\n { id: name },\n ) as unknown as Integration & {\n id: string;\n new (...args: Parameters): Integration &\n ReturnType & {\n setupOnce: (addGlobalEventProcessor?: (callback: EventProcessor) => void, getCurrentHub?: () => Hub) => void;\n };\n };\n}\n","import type { IntegrationFn, WrappedFunction } from '@sentry/types';\nimport { getOriginalFunction } from '@sentry/utils';\nimport { convertIntegrationFnToClass } from '../integration';\n\nlet originalFunctionToString: () => void;\n\nconst INTEGRATION_NAME = 'FunctionToString';\n\nconst functionToStringIntegration: IntegrationFn = () => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n originalFunctionToString = Function.prototype.toString;\n\n // intrinsics (like Function.prototype) might be immutable in some environments\n // e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal)\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Function.prototype.toString = function (this: WrappedFunction, ...args: any[]): string {\n const context = getOriginalFunction(this) || this;\n return originalFunctionToString.apply(context, args);\n };\n } catch {\n // ignore errors here, just don't patch this\n }\n },\n };\n};\n\n/** Patch toString calls to return proper name for wrapped functions */\n// eslint-disable-next-line deprecation/deprecation\nexport const FunctionToString = convertIntegrationFnToClass(INTEGRATION_NAME, functionToStringIntegration);\n","import type { Event, IntegrationFn, StackFrame } from '@sentry/types';\nimport { getEventDescription, logger, stringMatchesSomePattern } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { convertIntegrationFnToClass } from '../integration';\n\n// \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\nconst DEFAULT_IGNORE_ERRORS = [/^Script error\\.?$/, /^Javascript error: Script error\\.? on line 0$/];\n\nconst DEFAULT_IGNORE_TRANSACTIONS = [\n /^.*\\/healthcheck$/,\n /^.*\\/healthy$/,\n /^.*\\/live$/,\n /^.*\\/ready$/,\n /^.*\\/heartbeat$/,\n /^.*\\/health$/,\n /^.*\\/healthz$/,\n];\n\n/** Options for the InboundFilters integration */\nexport interface InboundFiltersOptions {\n allowUrls: Array;\n denyUrls: Array;\n ignoreErrors: Array;\n ignoreTransactions: Array;\n ignoreInternal: boolean;\n disableErrorDefaults: boolean;\n disableTransactionDefaults: boolean;\n}\n\nconst INTEGRATION_NAME = 'InboundFilters';\nconst inboundFiltersIntegration: IntegrationFn = (options: Partial) => {\n return {\n name: INTEGRATION_NAME,\n processEvent(event, _hint, client) {\n const clientOptions = client.getOptions();\n const mergedOptions = _mergeOptions(options, clientOptions);\n return _shouldDropEvent(event, mergedOptions) ? null : event;\n },\n };\n};\n\n/** Inbound filters configurable by the user */\n// eslint-disable-next-line deprecation/deprecation\nexport const InboundFilters = convertIntegrationFnToClass(INTEGRATION_NAME, inboundFiltersIntegration);\n\nfunction _mergeOptions(\n internalOptions: Partial = {},\n clientOptions: Partial = {},\n): Partial {\n return {\n allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])],\n denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])],\n ignoreErrors: [\n ...(internalOptions.ignoreErrors || []),\n ...(clientOptions.ignoreErrors || []),\n ...(internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS),\n ],\n ignoreTransactions: [\n ...(internalOptions.ignoreTransactions || []),\n ...(clientOptions.ignoreTransactions || []),\n ...(internalOptions.disableTransactionDefaults ? [] : DEFAULT_IGNORE_TRANSACTIONS),\n ],\n ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,\n };\n}\n\nfunction _shouldDropEvent(event: Event, options: Partial): boolean {\n if (options.ignoreInternal && _isSentryError(event)) {\n DEBUG_BUILD &&\n logger.warn(`Event dropped due to being internal Sentry Error.\\nEvent: ${getEventDescription(event)}`);\n return true;\n }\n if (_isIgnoredError(event, options.ignoreErrors)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`ignoreErrors\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (_isIgnoredTransaction(event, options.ignoreTransactions)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`ignoreTransactions\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (_isDeniedUrl(event, options.denyUrls)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`denyUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n );\n return true;\n }\n if (!_isAllowedUrl(event, options.allowUrls)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to not being matched by \\`allowUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n );\n return true;\n }\n return false;\n}\n\nfunction _isIgnoredError(event: Event, ignoreErrors?: Array): boolean {\n // If event.type, this is not an error\n if (event.type || !ignoreErrors || !ignoreErrors.length) {\n return false;\n }\n\n return _getPossibleEventMessages(event).some(message => stringMatchesSomePattern(message, ignoreErrors));\n}\n\nfunction _isIgnoredTransaction(event: Event, ignoreTransactions?: Array): boolean {\n if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) {\n return false;\n }\n\n const name = event.transaction;\n return name ? stringMatchesSomePattern(name, ignoreTransactions) : false;\n}\n\nfunction _isDeniedUrl(event: Event, denyUrls?: Array): boolean {\n // TODO: Use Glob instead?\n if (!denyUrls || !denyUrls.length) {\n return false;\n }\n const url = _getEventFilterUrl(event);\n return !url ? false : stringMatchesSomePattern(url, denyUrls);\n}\n\nfunction _isAllowedUrl(event: Event, allowUrls?: Array): boolean {\n // TODO: Use Glob instead?\n if (!allowUrls || !allowUrls.length) {\n return true;\n }\n const url = _getEventFilterUrl(event);\n return !url ? true : stringMatchesSomePattern(url, allowUrls);\n}\n\nfunction _getPossibleEventMessages(event: Event): string[] {\n const possibleMessages: string[] = [];\n\n if (event.message) {\n possibleMessages.push(event.message);\n }\n\n let lastException;\n try {\n // @ts-expect-error Try catching to save bundle size\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n lastException = event.exception.values[event.exception.values.length - 1];\n } catch (e) {\n // try catching to save bundle size checking existence of variables\n }\n\n if (lastException) {\n if (lastException.value) {\n possibleMessages.push(lastException.value);\n if (lastException.type) {\n possibleMessages.push(`${lastException.type}: ${lastException.value}`);\n }\n }\n }\n\n if (DEBUG_BUILD && possibleMessages.length === 0) {\n logger.error(`Could not extract message for event ${getEventDescription(event)}`);\n }\n\n return possibleMessages;\n}\n\nfunction _isSentryError(event: Event): boolean {\n try {\n // @ts-expect-error can't be a sentry error if undefined\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return event.exception.values[0].type === 'SentryError';\n } catch (e) {\n // ignore\n }\n return false;\n}\n\nfunction _getLastValidUrl(frames: StackFrame[] = []): string | null {\n for (let i = frames.length - 1; i >= 0; i--) {\n const frame = frames[i];\n\n if (frame && frame.filename !== '' && frame.filename !== '[native code]') {\n return frame.filename || null;\n }\n }\n\n return null;\n}\n\nfunction _getEventFilterUrl(event: Event): string | null {\n try {\n let frames;\n try {\n // @ts-expect-error we only care about frames if the whole thing here is defined\n frames = event.exception.values[0].stacktrace.frames;\n } catch (e) {\n // ignore\n }\n return frames ? _getLastValidUrl(frames) : null;\n } catch (oO) {\n DEBUG_BUILD && logger.error(`Cannot extract url for event ${getEventDescription(event)}`);\n return null;\n }\n}\n","/* eslint-disable max-lines */\nimport type {\n Attachment,\n Breadcrumb,\n CaptureContext,\n Client,\n Context,\n Contexts,\n Event,\n EventHint,\n EventProcessor,\n Extra,\n Extras,\n Primitive,\n PropagationContext,\n RequestSession,\n Scope as ScopeInterface,\n ScopeContext,\n ScopeData,\n Session,\n Severity,\n SeverityLevel,\n Span,\n Transaction,\n User,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, isPlainObject, logger, uuid4 } from '@sentry/utils';\n\nimport { getGlobalEventProcessors, notifyEventProcessors } from './eventProcessors';\nimport { updateSession } from './session';\nimport { applyScopeDataToEvent } from './utils/applyScopeDataToEvent';\n\n/**\n * Default value for maximum number of breadcrumbs added to an event.\n */\nconst DEFAULT_MAX_BREADCRUMBS = 100;\n\n/**\n * The global scope is kept in this module.\n * When accessing this via `getGlobalScope()` we'll make sure to set one if none is currently present.\n */\nlet globalScope: ScopeInterface | undefined;\n\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\nexport class Scope implements ScopeInterface {\n /** Flag if notifying is happening. */\n protected _notifyingListeners: boolean;\n\n /** Callback for client to receive scope changes. */\n protected _scopeListeners: Array<(scope: Scope) => void>;\n\n /** Callback list that will be called after {@link applyToEvent}. */\n protected _eventProcessors: EventProcessor[];\n\n /** Array of breadcrumbs. */\n protected _breadcrumbs: Breadcrumb[];\n\n /** User */\n protected _user: User;\n\n /** Tags */\n protected _tags: { [key: string]: Primitive };\n\n /** Extra */\n protected _extra: Extras;\n\n /** Contexts */\n protected _contexts: Contexts;\n\n /** Attachments */\n protected _attachments: Attachment[];\n\n /** Propagation Context for distributed tracing */\n protected _propagationContext: PropagationContext;\n\n /**\n * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n * sent to Sentry\n */\n protected _sdkProcessingMetadata: { [key: string]: unknown };\n\n /** Fingerprint */\n protected _fingerprint?: string[];\n\n /** Severity */\n // eslint-disable-next-line deprecation/deprecation\n protected _level?: Severity | SeverityLevel;\n\n /**\n * Transaction Name\n */\n protected _transactionName?: string;\n\n /** Span */\n protected _span?: Span;\n\n /** Session */\n protected _session?: Session;\n\n /** Request Mode Session Status */\n protected _requestSession?: RequestSession;\n\n /** The client on this scope */\n protected _client?: Client;\n\n // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.\n\n public constructor() {\n this._notifyingListeners = false;\n this._scopeListeners = [];\n this._eventProcessors = [];\n this._breadcrumbs = [];\n this._attachments = [];\n this._user = {};\n this._tags = {};\n this._extra = {};\n this._contexts = {};\n this._sdkProcessingMetadata = {};\n this._propagationContext = generatePropagationContext();\n }\n\n /**\n * Inherit values from the parent scope.\n * @deprecated Use `scope.clone()` and `new Scope()` instead.\n */\n public static clone(scope?: Scope): Scope {\n return scope ? scope.clone() : new Scope();\n }\n\n /**\n * Clone this scope instance.\n */\n public clone(): Scope {\n const newScope = new Scope();\n newScope._breadcrumbs = [...this._breadcrumbs];\n newScope._tags = { ...this._tags };\n newScope._extra = { ...this._extra };\n newScope._contexts = { ...this._contexts };\n newScope._user = this._user;\n newScope._level = this._level;\n newScope._span = this._span;\n newScope._session = this._session;\n newScope._transactionName = this._transactionName;\n newScope._fingerprint = this._fingerprint;\n newScope._eventProcessors = [...this._eventProcessors];\n newScope._requestSession = this._requestSession;\n newScope._attachments = [...this._attachments];\n newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };\n newScope._propagationContext = { ...this._propagationContext };\n newScope._client = this._client;\n\n return newScope;\n }\n\n /** Update the client on the scope. */\n public setClient(client: Client | undefined): void {\n this._client = client;\n }\n\n /**\n * Get the client assigned to this scope.\n *\n * It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing.\n */\n public getClient(): Client | undefined {\n return this._client;\n }\n\n /**\n * Add internal on change listener. Used for sub SDKs that need to store the scope.\n * @hidden\n */\n public addScopeListener(callback: (scope: Scope) => void): void {\n this._scopeListeners.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n public addEventProcessor(callback: EventProcessor): this {\n this._eventProcessors.push(callback);\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setUser(user: User | null): this {\n this._user = user || {};\n if (this._session) {\n updateSession(this._session, { user });\n }\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getUser(): User | undefined {\n return this._user;\n }\n\n /**\n * @inheritDoc\n */\n public getRequestSession(): RequestSession | undefined {\n return this._requestSession;\n }\n\n /**\n * @inheritDoc\n */\n public setRequestSession(requestSession?: RequestSession): this {\n this._requestSession = requestSession;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setTags(tags: { [key: string]: Primitive }): this {\n this._tags = {\n ...this._tags,\n ...tags,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: Primitive): this {\n this._tags = { ...this._tags, [key]: value };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setExtras(extras: Extras): this {\n this._extra = {\n ...this._extra,\n ...extras,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setExtra(key: string, extra: Extra): this {\n this._extra = { ...this._extra, [key]: extra };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setFingerprint(fingerprint: string[]): this {\n this._fingerprint = fingerprint;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setLevel(\n // eslint-disable-next-line deprecation/deprecation\n level: Severity | SeverityLevel,\n ): this {\n this._level = level;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the transaction name on the scope for future events.\n * @deprecated Use extra or tags instead.\n */\n public setTransactionName(name?: string): this {\n this._transactionName = name;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setContext(key: string, context: Context | null): this {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts[key] = context;\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the Span on the scope.\n * @param span Span\n * @deprecated Instead of setting a span on a scope, use `startSpan()`/`startSpanManual()` instead.\n */\n public setSpan(span?: Span): this {\n this._span = span;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Returns the `Span` if there is one.\n * @deprecated Use `getActiveSpan()` instead.\n */\n public getSpan(): Span | undefined {\n return this._span;\n }\n\n /**\n * Returns the `Transaction` attached to the scope (if there is one).\n * @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.\n */\n public getTransaction(): Transaction | undefined {\n // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will\n // have a pointer to the currently-active transaction.\n const span = this._span;\n return span && span.transaction;\n }\n\n /**\n * @inheritDoc\n */\n public setSession(session?: Session): this {\n if (!session) {\n delete this._session;\n } else {\n this._session = session;\n }\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getSession(): Session | undefined {\n return this._session;\n }\n\n /**\n * @inheritDoc\n */\n public update(captureContext?: CaptureContext): this {\n if (!captureContext) {\n return this;\n }\n\n if (typeof captureContext === 'function') {\n const updatedScope = (captureContext as (scope: T) => T)(this);\n return updatedScope instanceof Scope ? updatedScope : this;\n }\n\n if (captureContext instanceof Scope) {\n this._tags = { ...this._tags, ...captureContext._tags };\n this._extra = { ...this._extra, ...captureContext._extra };\n this._contexts = { ...this._contexts, ...captureContext._contexts };\n if (captureContext._user && Object.keys(captureContext._user).length) {\n this._user = captureContext._user;\n }\n if (captureContext._level) {\n this._level = captureContext._level;\n }\n if (captureContext._fingerprint) {\n this._fingerprint = captureContext._fingerprint;\n }\n if (captureContext._requestSession) {\n this._requestSession = captureContext._requestSession;\n }\n if (captureContext._propagationContext) {\n this._propagationContext = captureContext._propagationContext;\n }\n } else if (isPlainObject(captureContext)) {\n // eslint-disable-next-line no-param-reassign\n captureContext = captureContext as ScopeContext;\n this._tags = { ...this._tags, ...captureContext.tags };\n this._extra = { ...this._extra, ...captureContext.extra };\n this._contexts = { ...this._contexts, ...captureContext.contexts };\n if (captureContext.user) {\n this._user = captureContext.user;\n }\n if (captureContext.level) {\n this._level = captureContext.level;\n }\n if (captureContext.fingerprint) {\n this._fingerprint = captureContext.fingerprint;\n }\n if (captureContext.requestSession) {\n this._requestSession = captureContext.requestSession;\n }\n if (captureContext.propagationContext) {\n this._propagationContext = captureContext.propagationContext;\n }\n }\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public clear(): this {\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._contexts = {};\n this._level = undefined;\n this._transactionName = undefined;\n this._fingerprint = undefined;\n this._requestSession = undefined;\n this._span = undefined;\n this._session = undefined;\n this._notifyScopeListeners();\n this._attachments = [];\n this._propagationContext = generatePropagationContext();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;\n\n // No data has been changed, so don't notify scope listeners\n if (maxCrumbs <= 0) {\n return this;\n }\n\n const mergedBreadcrumb = {\n timestamp: dateTimestampInSeconds(),\n ...breadcrumb,\n };\n\n const breadcrumbs = this._breadcrumbs;\n breadcrumbs.push(mergedBreadcrumb);\n this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs;\n\n this._notifyScopeListeners();\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getLastBreadcrumb(): Breadcrumb | undefined {\n return this._breadcrumbs[this._breadcrumbs.length - 1];\n }\n\n /**\n * @inheritDoc\n */\n public clearBreadcrumbs(): this {\n this._breadcrumbs = [];\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public addAttachment(attachment: Attachment): this {\n this._attachments.push(attachment);\n return this;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `getScopeData()` instead.\n */\n public getAttachments(): Attachment[] {\n const data = this.getScopeData();\n\n return data.attachments;\n }\n\n /**\n * @inheritDoc\n */\n public clearAttachments(): this {\n this._attachments = [];\n return this;\n }\n\n /** @inheritDoc */\n public getScopeData(): ScopeData {\n const {\n _breadcrumbs,\n _attachments,\n _contexts,\n _tags,\n _extra,\n _user,\n _level,\n _fingerprint,\n _eventProcessors,\n _propagationContext,\n _sdkProcessingMetadata,\n _transactionName,\n _span,\n } = this;\n\n return {\n breadcrumbs: _breadcrumbs,\n attachments: _attachments,\n contexts: _contexts,\n tags: _tags,\n extra: _extra,\n user: _user,\n level: _level,\n fingerprint: _fingerprint || [],\n eventProcessors: _eventProcessors,\n propagationContext: _propagationContext,\n sdkProcessingMetadata: _sdkProcessingMetadata,\n transactionName: _transactionName,\n span: _span,\n };\n }\n\n /**\n * Applies data from the scope to the event and runs all event processors on it.\n *\n * @param event Event\n * @param hint Object containing additional information about the original exception, for use by the event processors.\n * @hidden\n * @deprecated Use `applyScopeDataToEvent()` directly\n */\n public applyToEvent(\n event: Event,\n hint: EventHint = {},\n additionalEventProcessors: EventProcessor[] = [],\n ): PromiseLike {\n applyScopeDataToEvent(event, this.getScopeData());\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors: EventProcessor[] = [\n ...additionalEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n ...this._eventProcessors,\n ];\n\n return notifyEventProcessors(eventProcessors, event, hint);\n }\n\n /**\n * Add data which will be accessible during event processing but won't get sent to Sentry\n */\n public setSDKProcessingMetadata(newData: { [key: string]: unknown }): this {\n this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setPropagationContext(context: PropagationContext): this {\n this._propagationContext = context;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getPropagationContext(): PropagationContext {\n return this._propagationContext;\n }\n\n /**\n * Capture an exception for this scope.\n *\n * @param exception The exception to capture.\n * @param hint Optinal additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\n public captureException(exception: unknown, hint?: EventHint): string {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture exception!');\n return eventId;\n }\n\n const syntheticException = new Error('Sentry syntheticException');\n\n this._client.captureException(\n exception,\n {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Capture a message for this scope.\n *\n * @param message The message to capture.\n * @param level An optional severity level to report the message with.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured message.\n */\n public captureMessage(message: string, level?: SeverityLevel, hint?: EventHint): string {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture message!');\n return eventId;\n }\n\n const syntheticException = new Error(message);\n\n this._client.captureMessage(\n message,\n level,\n {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Captures a manually created event for this scope and sends it to Sentry.\n *\n * @param exception The event to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\n public captureEvent(event: Event, hint?: EventHint): string {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture event!');\n return eventId;\n }\n\n this._client.captureEvent(event, { ...hint, event_id: eventId }, this);\n\n return eventId;\n }\n\n /**\n * This will be called on every set call.\n */\n protected _notifyScopeListeners(): void {\n // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n this._scopeListeners.forEach(callback => {\n callback(this);\n });\n this._notifyingListeners = false;\n }\n }\n}\n\n/**\n * Get the global scope.\n * This scope is applied to _all_ events.\n */\nexport function getGlobalScope(): ScopeInterface {\n if (!globalScope) {\n globalScope = new Scope();\n }\n\n return globalScope;\n}\n\n/**\n * This is mainly needed for tests.\n * DO NOT USE this, as this is an internal API and subject to change.\n * @hidden\n */\nexport function setGlobalScope(scope: ScopeInterface | undefined): void {\n globalScope = scope;\n}\n\nfunction generatePropagationContext(): PropagationContext {\n return {\n traceId: uuid4(),\n spanId: uuid4().substring(16),\n };\n}\n","import type { SerializedSession, Session, SessionContext, SessionStatus } from '@sentry/types';\nimport { dropUndefinedKeys, timestampInSeconds, uuid4 } from '@sentry/utils';\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nexport function makeSession(context?: Omit): Session {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\n const session: Session = {\n sid: uuid4(),\n init: true,\n timestamp: startingTime,\n started: startingTime,\n duration: 0,\n status: 'ok',\n errors: 0,\n ignoreDuration: false,\n toJSON: () => sessionToJSON(session),\n };\n\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nexport function updateSession(session: Session, context: SessionContext = {}): void {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\n */\nexport function closeSession(session: Session, status?: Exclude): void {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session: Session): SerializedSession {\n return dropUndefinedKeys({\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n duration: session.duration,\n abnormal_mechanism: session.abnormal_mechanism,\n attrs: {\n release: session.release,\n environment: session.environment,\n ip_address: session.ipAddress,\n user_agent: session.userAgent,\n },\n });\n}\n","import type { Client, DynamicSamplingContext, Scope, Span, Transaction } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from '../constants';\nimport { getClient, getCurrentScope } from '../exports';\nimport { spanIsSampled, spanToJSON } from '../utils/spanUtils';\n\n/**\n * Creates a dynamic sampling context from a client.\n *\n * Dispatches the `createDsc` lifecycle hook as a side effect.\n */\nexport function getDynamicSamplingContextFromClient(\n trace_id: string,\n client: Client,\n scope?: Scope,\n): DynamicSamplingContext {\n const options = client.getOptions();\n\n const { publicKey: public_key } = client.getDsn() || {};\n const { segment: user_segment } = (scope && scope.getUser()) || {};\n\n const dsc = dropUndefinedKeys({\n environment: options.environment || DEFAULT_ENVIRONMENT,\n release: options.release,\n user_segment,\n public_key,\n trace_id,\n }) as DynamicSamplingContext;\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\n/**\n * A Span with a frozen dynamic sampling context.\n */\ntype TransactionWithV7FrozenDsc = Transaction & { _frozenDynamicSamplingContext?: DynamicSamplingContext };\n\n/**\n * Creates a dynamic sampling context from a span (and client and scope)\n *\n * @param span the span from which a few values like the root span name and sample rate are extracted.\n *\n * @returns a dynamic sampling context\n */\nexport function getDynamicSamplingContextFromSpan(span: Span): Readonly> {\n const client = getClient();\n if (!client) {\n return {};\n }\n\n // passing emit=false here to only emit later once the DSC is actually populated\n const dsc = getDynamicSamplingContextFromClient(spanToJSON(span).trace_id || '', client, getCurrentScope());\n\n // As long as we use `Transaction`s internally, this should be fine.\n // TODO: We need to replace this with a `getRootSpan(span)` function though\n const txn = span.transaction as TransactionWithV7FrozenDsc | undefined;\n if (!txn) {\n return dsc;\n }\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n // For now we need to avoid breaking users who directly created a txn with a DSC, where this field is still set.\n // @see Transaction class constructor\n const v7FrozenDsc = txn && txn._frozenDynamicSamplingContext;\n if (v7FrozenDsc) {\n return v7FrozenDsc;\n }\n\n // TODO (v8): Replace txn.metadata with txn.attributes[]\n // We can't do this yet because attributes aren't always set yet.\n // eslint-disable-next-line deprecation/deprecation\n const { sampleRate: maybeSampleRate, source } = txn.metadata;\n if (maybeSampleRate != null) {\n dsc.sample_rate = `${maybeSampleRate}`;\n }\n\n // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n const jsonSpan = spanToJSON(txn);\n\n // after JSON conversion, txn.name becomes jsonSpan.description\n if (source && source !== 'url') {\n dsc.transaction = jsonSpan.description;\n }\n\n dsc.sampled = String(spanIsSampled(txn));\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n","import type { Breadcrumb, Event, PropagationContext, ScopeData, Span } from '@sentry/types';\nimport { arrayify } from '@sentry/utils';\nimport { getDynamicSamplingContextFromSpan } from '../tracing/dynamicSamplingContext';\nimport { spanToJSON, spanToTraceContext } from './spanUtils';\n\n/**\n * Applies data from the scope to the event and runs all event processors on it.\n */\nexport function applyScopeDataToEvent(event: Event, data: ScopeData): void {\n const { fingerprint, span, breadcrumbs, sdkProcessingMetadata, propagationContext } = data;\n\n // Apply general data\n applyDataToEvent(event, data);\n\n // We want to set the trace context for normal events only if there isn't already\n // a trace context on the event. There is a product feature in place where we link\n // errors with transaction and it relies on that.\n if (span) {\n applySpanToEvent(event, span);\n }\n\n applyFingerprintToEvent(event, fingerprint);\n applyBreadcrumbsToEvent(event, breadcrumbs);\n applySdkMetadataToEvent(event, sdkProcessingMetadata, propagationContext);\n}\n\n/** Merge data of two scopes together. */\nexport function mergeScopeData(data: ScopeData, mergeData: ScopeData): void {\n const {\n extra,\n tags,\n user,\n contexts,\n level,\n sdkProcessingMetadata,\n breadcrumbs,\n fingerprint,\n eventProcessors,\n attachments,\n propagationContext,\n // eslint-disable-next-line deprecation/deprecation\n transactionName,\n span,\n } = mergeData;\n\n mergePropOverwrite(data, 'extra', extra);\n mergePropOverwrite(data, 'tags', tags);\n mergePropOverwrite(data, 'user', user);\n mergePropOverwrite(data, 'contexts', contexts);\n mergePropOverwrite(data, 'sdkProcessingMetadata', sdkProcessingMetadata);\n\n if (level) {\n data.level = level;\n }\n\n if (transactionName) {\n // eslint-disable-next-line deprecation/deprecation\n data.transactionName = transactionName;\n }\n\n if (span) {\n data.span = span;\n }\n\n if (breadcrumbs.length) {\n data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs];\n }\n\n if (fingerprint.length) {\n data.fingerprint = [...data.fingerprint, ...fingerprint];\n }\n\n if (eventProcessors.length) {\n data.eventProcessors = [...data.eventProcessors, ...eventProcessors];\n }\n\n if (attachments.length) {\n data.attachments = [...data.attachments, ...attachments];\n }\n\n data.propagationContext = { ...data.propagationContext, ...propagationContext };\n}\n\n/**\n * Merge properties, overwriting existing keys.\n * Exported only for tests.\n */\nexport function mergePropOverwrite<\n Prop extends 'extra' | 'tags' | 'user' | 'contexts' | 'sdkProcessingMetadata',\n Data extends ScopeData | Event,\n>(data: Data, prop: Prop, mergeVal: Data[Prop]): void {\n if (mergeVal && Object.keys(mergeVal).length) {\n data[prop] = { ...data[prop], ...mergeVal };\n }\n}\n\n/**\n * Merge properties, keeping existing keys.\n * Exported only for tests.\n */\nexport function mergePropKeep<\n Prop extends 'extra' | 'tags' | 'user' | 'contexts' | 'sdkProcessingMetadata',\n Data extends ScopeData | Event,\n>(data: Data, prop: Prop, mergeVal: Data[Prop]): void {\n if (mergeVal && Object.keys(mergeVal).length) {\n data[prop] = { ...mergeVal, ...data[prop] };\n }\n}\n\n/** Exported only for tests */\nexport function mergeArray(\n event: Event,\n prop: Prop,\n mergeVal: ScopeData[Prop],\n): void {\n const prevVal = event[prop];\n // If we are not merging any new values,\n // we only need to proceed if there was an empty array before (as we want to replace it with undefined)\n if (!mergeVal.length && (!prevVal || prevVal.length)) {\n return;\n }\n\n const merged = [...(prevVal || []), ...mergeVal] as ScopeData[Prop];\n event[prop] = merged.length ? merged : undefined;\n}\n\nfunction applyDataToEvent(event: Event, data: ScopeData): void {\n const {\n extra,\n tags,\n user,\n contexts,\n level,\n // eslint-disable-next-line deprecation/deprecation\n transactionName,\n } = data;\n\n if (extra && Object.keys(extra).length) {\n event.extra = { ...extra, ...event.extra };\n }\n if (tags && Object.keys(tags).length) {\n event.tags = { ...tags, ...event.tags };\n }\n if (user && Object.keys(user).length) {\n event.user = { ...user, ...event.user };\n }\n if (contexts && Object.keys(contexts).length) {\n event.contexts = { ...contexts, ...event.contexts };\n }\n if (level) {\n event.level = level;\n }\n if (transactionName) {\n event.transaction = transactionName;\n }\n}\n\nfunction applyBreadcrumbsToEvent(event: Event, breadcrumbs: Breadcrumb[]): void {\n const mergedBreadcrumbs = [...(event.breadcrumbs || []), ...breadcrumbs];\n event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : undefined;\n}\n\nfunction applySdkMetadataToEvent(\n event: Event,\n sdkProcessingMetadata: ScopeData['sdkProcessingMetadata'],\n propagationContext: PropagationContext,\n): void {\n event.sdkProcessingMetadata = {\n ...event.sdkProcessingMetadata,\n ...sdkProcessingMetadata,\n propagationContext: propagationContext,\n };\n}\n\nfunction applySpanToEvent(event: Event, span: Span): void {\n event.contexts = { trace: spanToTraceContext(span), ...event.contexts };\n const transaction = span.transaction;\n if (transaction) {\n event.sdkProcessingMetadata = {\n dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),\n ...event.sdkProcessingMetadata,\n };\n const transactionName = spanToJSON(transaction).description;\n if (transactionName) {\n event.tags = { transaction: transactionName, ...event.tags };\n }\n }\n}\n\n/**\n * Applies fingerprint from the scope to the event if there's one,\n * uses message if there's one instead or get rid of empty fingerprint\n */\nfunction applyFingerprintToEvent(event: Event, fingerprint: ScopeData['fingerprint'] | undefined): void {\n // Make sure it's an array first and we actually have something in place\n event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : [];\n\n // If we have something on the scope, then merge it with event\n if (fingerprint) {\n event.fingerprint = event.fingerprint.concat(fingerprint);\n }\n\n // If we have no data at all, remove empty array default\n if (event.fingerprint && !event.fingerprint.length) {\n delete event.fingerprint;\n }\n}\n","import type {\n CaptureContext,\n Client,\n ClientOptions,\n Event,\n EventHint,\n Scope as ScopeInterface,\n ScopeContext,\n StackFrame,\n StackParser,\n} from '@sentry/types';\nimport { GLOBAL_OBJ, addExceptionMechanism, dateTimestampInSeconds, normalize, truncate, uuid4 } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from '../constants';\nimport { getGlobalEventProcessors, notifyEventProcessors } from '../eventProcessors';\nimport { Scope, getGlobalScope } from '../scope';\nimport { applyScopeDataToEvent, mergeScopeData } from './applyScopeDataToEvent';\nimport { spanToJSON } from './spanUtils';\n\n/**\n * This type makes sure that we get either a CaptureContext, OR an EventHint.\n * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:\n * { user: { id: '123' }, mechanism: { handled: false } }\n */\nexport type ExclusiveEventHintOrCaptureContext =\n | (CaptureContext & Partial<{ [key in keyof EventHint]: never }>)\n | (EventHint & Partial<{ [key in keyof ScopeContext]: never }>);\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nexport function prepareEvent(\n options: ClientOptions,\n event: Event,\n hint: EventHint,\n scope?: Scope,\n client?: Client,\n isolationScope?: Scope,\n): PromiseLike {\n const { normalizeDepth = 3, normalizeMaxBreadth = 1_000 } = options;\n const prepared: Event = {\n ...event,\n event_id: event.event_id || hint.event_id || uuid4(),\n timestamp: event.timestamp || dateTimestampInSeconds(),\n };\n const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n applyClientOptions(prepared, options);\n applyIntegrationsMetadata(prepared, integrations);\n\n // Only put debug IDs onto frames for error events.\n if (event.type === undefined) {\n applyDebugIds(prepared, options.stackParser);\n }\n\n // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n const finalScope = getFinalScope(scope, hint.captureContext);\n\n if (hint.mechanism) {\n addExceptionMechanism(prepared, hint.mechanism);\n }\n\n const clientEventProcessors = client && client.getEventProcessors ? client.getEventProcessors() : [];\n\n // This should be the last thing called, since we want that\n // {@link Hub.addEventProcessor} gets the finished prepared event.\n // Merge scope data together\n const data = getGlobalScope().getScopeData();\n\n if (isolationScope) {\n const isolationData = isolationScope.getScopeData();\n mergeScopeData(data, isolationData);\n }\n\n if (finalScope) {\n const finalScopeData = finalScope.getScopeData();\n mergeScopeData(data, finalScopeData);\n }\n\n const attachments = [...(hint.attachments || []), ...data.attachments];\n if (attachments.length) {\n hint.attachments = attachments;\n }\n\n applyScopeDataToEvent(prepared, data);\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors = [\n ...clientEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n // Run scope event processors _after_ all other processors\n ...data.eventProcessors,\n ];\n\n const result = notifyEventProcessors(eventProcessors, prepared, hint);\n\n return result.then(evt => {\n if (evt) {\n // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified\n // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.\n // This should not cause any PII issues, since we're only moving data that is already on the event and not adding\n // any new data\n applyDebugMeta(evt);\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n }\n return evt;\n });\n}\n\n/**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event: Event, options: ClientOptions): void {\n const { environment, release, dist, maxValueLength = 250 } = options;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n const exception = event.exception && event.exception.values && event.exception.values[0];\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n const request = event.request;\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n}\n\nconst debugIdStackParserCache = new WeakMap>();\n\n/**\n * Puts debug IDs into the stack frames of an error event.\n */\nexport function applyDebugIds(event: Event, stackParser: StackParser): void {\n const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n if (!debugIdMap) {\n return;\n }\n\n let debugIdStackFramesCache: Map;\n const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n if (cachedDebugIdStackFrameCache) {\n debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n } else {\n debugIdStackFramesCache = new Map();\n debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n }\n\n // Build a map of filename -> debug_id\n const filenameDebugIdMap = Object.keys(debugIdMap).reduce>((acc, debugIdStackTrace) => {\n let parsedStack: StackFrame[];\n const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n if (cachedParsedStack) {\n parsedStack = cachedParsedStack;\n } else {\n parsedStack = stackParser(debugIdStackTrace);\n debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n }\n\n for (let i = parsedStack.length - 1; i >= 0; i--) {\n const stackFrame = parsedStack[i];\n if (stackFrame.filename) {\n acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];\n break;\n }\n }\n return acc;\n }, {});\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event!.exception!.values!.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace!.frames!.forEach(frame => {\n if (frame.filename) {\n frame.debug_id = filenameDebugIdMap[frame.filename];\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n}\n\n/**\n * Moves debug IDs from the stack frames of an error event into the debug_meta field.\n */\nexport function applyDebugMeta(event: Event): void {\n // Extract debug IDs and filenames from the stack frames on the event.\n const filenameDebugIdMap: Record = {};\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception!.values!.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace!.frames!.forEach(frame => {\n if (frame.debug_id) {\n if (frame.abs_path) {\n filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n } else if (frame.filename) {\n filenameDebugIdMap[frame.filename] = frame.debug_id;\n }\n delete frame.debug_id;\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n\n if (Object.keys(filenameDebugIdMap).length === 0) {\n return;\n }\n\n // Fill debug_meta information\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n const images = event.debug_meta.images;\n Object.keys(filenameDebugIdMap).forEach(filename => {\n images.push({\n type: 'sourcemap',\n code_file: filename,\n debug_id: filenameDebugIdMap[filename],\n });\n });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event: Event, integrationNames: string[]): void {\n if (integrationNames.length > 0) {\n event.sdk = event.sdk || {};\n event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event: Event | null, depth: number, maxBreadth: number): Event | null {\n if (!event) {\n return null;\n }\n\n const normalized: Event = {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth, maxBreadth),\n }),\n })),\n }),\n ...(event.user && {\n user: normalize(event.user, depth, maxBreadth),\n }),\n ...(event.contexts && {\n contexts: normalize(event.contexts, depth, maxBreadth),\n }),\n ...(event.extra && {\n extra: normalize(event.extra, depth, maxBreadth),\n }),\n };\n\n // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n if (event.contexts && event.contexts.trace && normalized.contexts) {\n normalized.contexts.trace = event.contexts.trace;\n\n // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n if (event.contexts.trace.data) {\n normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n }\n }\n\n // event.spans[].data may contain circular/dangerous data so we need to normalize it\n if (event.spans) {\n normalized.spans = event.spans.map(span => {\n const data = spanToJSON(span).data;\n\n if (data) {\n // This is a bit weird, as we generally have `Span` instances here, but to be safe we do not assume so\n // eslint-disable-next-line deprecation/deprecation\n span.data = normalize(data, depth, maxBreadth);\n }\n\n return span;\n });\n }\n\n return normalized;\n}\n\nfunction getFinalScope(scope: Scope | undefined, captureContext: CaptureContext | undefined): Scope | undefined {\n if (!captureContext) {\n return scope;\n }\n\n const finalScope = scope ? scope.clone() : new Scope();\n finalScope.update(captureContext);\n return finalScope;\n}\n\n/**\n * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.\n * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.\n */\nexport function parseEventHintOrCaptureContext(\n hint: ExclusiveEventHintOrCaptureContext | undefined,\n): EventHint | undefined {\n if (!hint) {\n return undefined;\n }\n\n // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext\n if (hintIsScopeOrFunction(hint)) {\n return { captureContext: hint };\n }\n\n if (hintIsScopeContext(hint)) {\n return {\n captureContext: hint,\n };\n }\n\n return hint;\n}\n\nfunction hintIsScopeOrFunction(\n hint: CaptureContext | EventHint,\n): hint is ScopeInterface | ((scope: ScopeInterface) => ScopeInterface) {\n return hint instanceof Scope || typeof hint === 'function';\n}\n\ntype ScopeContextProperty = keyof ScopeContext;\nconst captureContextKeys: readonly ScopeContextProperty[] = [\n 'user',\n 'level',\n 'extra',\n 'contexts',\n 'tags',\n 'fingerprint',\n 'requestSession',\n 'propagationContext',\n] as const;\n\nfunction hintIsScopeContext(hint: Partial | EventHint): hint is Partial {\n return Object.keys(hint).some(key => captureContextKeys.includes(key as ScopeContextProperty));\n}\n","import type { Span, SpanJSON, SpanTimeInput, TraceContext } from '@sentry/types';\nimport { dropUndefinedKeys, generateSentryTraceHeader, timestampInSeconds } from '@sentry/utils';\nimport type { Span as SpanClass } from '../tracing/span';\n\n// These are aligned with OpenTelemetry trace flags\nexport const TRACE_FLAG_NONE = 0x0;\nexport const TRACE_FLAG_SAMPLED = 0x1;\n\n/**\n * Convert a span to a trace context, which can be sent as the `trace` context in an event.\n */\nexport function spanToTraceContext(span: Span): TraceContext {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n const { data, op, parent_span_id, status, tags, origin } = spanToJSON(span);\n\n return dropUndefinedKeys({\n data,\n op,\n parent_span_id,\n span_id,\n status,\n tags,\n trace_id,\n origin,\n });\n}\n\n/**\n * Convert a Span to a Sentry trace header.\n */\nexport function spanToTraceHeader(span: Span): string {\n const { traceId, spanId } = span.spanContext();\n const sampled = spanIsSampled(span);\n return generateSentryTraceHeader(traceId, spanId, sampled);\n}\n\n/**\n * Convert a span time input intp a timestamp in seconds.\n */\nexport function spanTimeInputToSeconds(input: SpanTimeInput | undefined): number {\n if (typeof input === 'number') {\n return ensureTimestampInSeconds(input);\n }\n\n if (Array.isArray(input)) {\n // See {@link HrTime} for the array-based time format\n return input[0] + input[1] / 1e9;\n }\n\n if (input instanceof Date) {\n return ensureTimestampInSeconds(input.getTime());\n }\n\n return timestampInSeconds();\n}\n\n/**\n * Converts a timestamp to second, if it was in milliseconds, or keeps it as second.\n */\nfunction ensureTimestampInSeconds(timestamp: number): number {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp / 1000 : timestamp;\n}\n\n/**\n * Convert a span to a JSON representation.\n * Note that all fields returned here are optional and need to be guarded against.\n *\n * Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json).\n * This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility.\n * And `spanToJSON` needs the Span class from `span.ts` to check here.\n * TODO v8: When we remove the deprecated stuff from `span.ts`, we can remove the circular dependency again.\n */\nexport function spanToJSON(span: Span): Partial {\n if (spanIsSpanClass(span)) {\n return span.getSpanJSON();\n }\n\n // Fallback: We also check for `.toJSON()` here...\n // eslint-disable-next-line deprecation/deprecation\n if (typeof span.toJSON === 'function') {\n // eslint-disable-next-line deprecation/deprecation\n return span.toJSON();\n }\n\n return {};\n}\n\n/**\n * Sadly, due to circular dependency checks we cannot actually import the Span class here and check for instanceof.\n * :( So instead we approximate this by checking if it has the `getSpanJSON` method.\n */\nfunction spanIsSpanClass(span: Span): span is SpanClass {\n return typeof (span as SpanClass).getSpanJSON === 'function';\n}\n\n/**\n * Returns true if a span is sampled.\n * In most cases, you should just use `span.isRecording()` instead.\n * However, this has a slightly different semantic, as it also returns false if the span is finished.\n * So in the case where this distinction is important, use this method.\n */\nexport function spanIsSampled(span: Span): boolean {\n // We align our trace flags with the ones OpenTelemetry use\n // So we also check for sampled the same way they do.\n const { traceFlags } = span.spanContext();\n // eslint-disable-next-line no-bitwise\n return Boolean(traceFlags & TRACE_FLAG_SAMPLED);\n}\n","export const SDK_VERSION = '7.93.0';\n","import { captureException, captureMessage, convertIntegrationFnToClass, getClient, withScope } from '@sentry/core';\nimport type { CaptureContext, IntegrationFn } from '@sentry/types';\nimport {\n CONSOLE_LEVELS,\n GLOBAL_OBJ,\n addConsoleInstrumentationHandler,\n addExceptionMechanism,\n safeJoin,\n severityLevelFromString,\n} from '@sentry/utils';\n\ninterface CaptureConsoleOptions {\n levels?: string[];\n}\n\nconst INTEGRATION_NAME = 'CaptureConsole';\n\nconst captureConsoleIntegration = ((options: CaptureConsoleOptions = {}) => {\n const levels = options.levels || CONSOLE_LEVELS;\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n if (!('console' in GLOBAL_OBJ)) {\n return;\n }\n\n addConsoleInstrumentationHandler(({ args, level }) => {\n if (getClient() !== client || !levels.includes(level)) {\n return;\n }\n\n consoleHandler(args, level);\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/** Send Console API calls as Sentry Events */\n// eslint-disable-next-line deprecation/deprecation\nexport const CaptureConsole = convertIntegrationFnToClass(INTEGRATION_NAME, captureConsoleIntegration);\n\nfunction consoleHandler(args: unknown[], level: string): void {\n const captureContext: CaptureContext = {\n level: severityLevelFromString(level),\n extra: {\n arguments: args,\n },\n };\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n event.logger = 'console';\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'console',\n });\n\n return event;\n });\n\n if (level === 'assert' && args[0] === false) {\n const message = `Assertion failed: ${safeJoin(args.slice(1), ' ') || 'console.assert'}`;\n scope.setExtra('arguments', args.slice(1));\n captureMessage(message, captureContext);\n return;\n }\n\n const error = args.find(arg => arg instanceof Error);\n if (level === 'error' && error) {\n captureException(error, captureContext);\n return;\n }\n\n const message = safeJoin(args, ' ');\n captureMessage(message, captureContext);\n });\n}\n","import type { Event, EventHint, Exception, ExtendedError, StackParser } from '@sentry/types';\n\nimport { isInstanceOf } from './is';\nimport { truncate } from './string';\n\n/**\n * Creates exceptions inside `event.exception.values` for errors that are nested on properties based on the `key` parameter.\n */\nexport function applyAggregateErrorsToEvent(\n exceptionFromErrorImplementation: (stackParser: StackParser, ex: Error) => Exception,\n parser: StackParser,\n maxValueLimit: number = 250,\n key: string,\n limit: number,\n event: Event,\n hint?: EventHint,\n): void {\n if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n // Generally speaking the last item in `event.exception.values` is the exception originating from the original Error\n const originalException: Exception | undefined =\n event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : undefined;\n\n // We only create exception grouping if there is an exception in the event.\n if (originalException) {\n event.exception.values = truncateAggregateExceptions(\n aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n hint.originalException as ExtendedError,\n key,\n event.exception.values,\n originalException,\n 0,\n ),\n maxValueLimit,\n );\n }\n}\n\nfunction aggregateExceptionsFromError(\n exceptionFromErrorImplementation: (stackParser: StackParser, ex: Error) => Exception,\n parser: StackParser,\n limit: number,\n error: ExtendedError,\n key: string,\n prevExceptions: Exception[],\n exception: Exception,\n exceptionId: number,\n): Exception[] {\n if (prevExceptions.length >= limit + 1) {\n return prevExceptions;\n }\n\n let newExceptions = [...prevExceptions];\n\n if (isInstanceOf(error[key], Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId);\n const newException = exceptionFromErrorImplementation(parser, error[key]);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n error[key],\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n\n // This will create exception grouping for AggregateErrors\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError\n if (Array.isArray(error.errors)) {\n error.errors.forEach((childError, i) => {\n if (isInstanceOf(childError, Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId);\n const newException = exceptionFromErrorImplementation(parser, childError);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n childError,\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n });\n }\n\n return newExceptions;\n}\n\nfunction applyExceptionGroupFieldsForParentException(exception: Exception, exceptionId: number): void {\n // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n exception.mechanism = {\n ...exception.mechanism,\n is_exception_group: true,\n exception_id: exceptionId,\n };\n}\n\nfunction applyExceptionGroupFieldsForChildException(\n exception: Exception,\n source: string,\n exceptionId: number,\n parentId: number | undefined,\n): void {\n // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n exception.mechanism = {\n ...exception.mechanism,\n type: 'chained',\n source,\n exception_id: exceptionId,\n parent_id: parentId,\n };\n}\n\n/**\n * Truncate the message (exception.value) of all exceptions in the event.\n * Because this event processor is ran after `applyClientOptions`,\n * we need to truncate the message of the added exceptions here.\n */\nfunction truncateAggregateExceptions(exceptions: Exception[], maxValueLength: number): Exception[] {\n return exceptions.map(exception => {\n if (exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n return exception;\n });\n}\n","import type { DynamicSamplingContext } from '@sentry/types';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { isString } from './is';\nimport { logger } from './logger';\n\nexport const BAGGAGE_HEADER_NAME = 'baggage';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;\n\n/**\n * Max length of a serialized baggage string\n *\n * https://www.w3.org/TR/baggage/#limits\n */\nexport const MAX_BAGGAGE_STRING_LENGTH = 8192;\n\n/**\n * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the \"sentry-\" prefixed values\n * from it.\n *\n * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.\n * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.\n */\nexport function baggageHeaderToDynamicSamplingContext(\n // Very liberal definition of what any incoming header might look like\n baggageHeader: string | string[] | number | null | undefined | boolean,\n): Partial | undefined {\n if (!isString(baggageHeader) && !Array.isArray(baggageHeader)) {\n return undefined;\n }\n\n // Intermediary object to store baggage key value pairs of incoming baggage headers on.\n // It is later used to read Sentry-DSC-values from.\n let baggageObject: Readonly> = {};\n\n if (Array.isArray(baggageHeader)) {\n // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it\n baggageObject = baggageHeader.reduce>((acc, curr) => {\n const currBaggageObject = baggageHeaderToObject(curr);\n for (const key of Object.keys(currBaggageObject)) {\n acc[key] = currBaggageObject[key];\n }\n return acc;\n }, {});\n } else {\n // Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but\n // this is how we choose to handle it)\n if (!baggageHeader) {\n return undefined;\n }\n\n baggageObject = baggageHeaderToObject(baggageHeader);\n }\n\n // Read all \"sentry-\" prefixed values out of the baggage object and put it onto a dynamic sampling context object.\n const dynamicSamplingContext = Object.entries(baggageObject).reduce>((acc, [key, value]) => {\n if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) {\n const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);\n acc[nonPrefixedKey] = value;\n }\n return acc;\n }, {});\n\n // Only return a dynamic sampling context object if there are keys in it.\n // A keyless object means there were no sentry values on the header, which means that there is no DSC.\n if (Object.keys(dynamicSamplingContext).length > 0) {\n return dynamicSamplingContext as Partial;\n } else {\n return undefined;\n }\n}\n\n/**\n * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with \"sentry-\".\n *\n * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility\n * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is\n * `undefined` the function will return `undefined`.\n * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`\n * was `undefined`, or if `dynamicSamplingContext` didn't contain any values.\n */\nexport function dynamicSamplingContextToSentryBaggageHeader(\n // this also takes undefined for convenience and bundle size in other places\n dynamicSamplingContext?: Partial,\n): string | undefined {\n if (!dynamicSamplingContext) {\n return undefined;\n }\n\n // Prefix all DSC keys with \"sentry-\" and put them into a new object\n const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce>(\n (acc, [dscKey, dscValue]) => {\n if (dscValue) {\n acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;\n }\n return acc;\n },\n {},\n );\n\n return objectToBaggageHeader(sentryPrefixedDSC);\n}\n\n/**\n * Will parse a baggage header, which is a simple key-value map, into a flat object.\n *\n * @param baggageHeader The baggage header to parse.\n * @returns a flat object containing all the key-value pairs from `baggageHeader`.\n */\nfunction baggageHeaderToObject(baggageHeader: string): Record {\n return baggageHeader\n .split(',')\n .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim())))\n .reduce>((acc, [key, value]) => {\n acc[key] = value;\n return acc;\n }, {});\n}\n\n/**\n * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs.\n *\n * @param object The object to turn into a baggage header.\n * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header\n * is not spec compliant.\n */\nfunction objectToBaggageHeader(object: Record): string | undefined {\n if (Object.keys(object).length === 0) {\n // An empty baggage header is not spec compliant: We return undefined.\n return undefined;\n }\n\n return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {\n const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;\n const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;\n if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {\n DEBUG_BUILD &&\n logger.warn(\n `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`,\n );\n return baggageHeader;\n } else {\n return newBaggageHeader;\n }\n }, '');\n}\n","import { isString } from './is';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject();\n\nconst DEFAULT_MAX_STRING_LENGTH = 80;\n\ntype SimpleNode = {\n parentNode: SimpleNode;\n} | null;\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nexport function htmlTreeAsString(\n elem: unknown,\n options: string[] | { keyAttrs?: string[]; maxStringLength?: number } = {},\n): string {\n if (!elem) {\n return '';\n }\n\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n let currentElem = elem as SimpleNode;\n const MAX_TRAVERSE_HEIGHT = 5;\n const out = [];\n let height = 0;\n let len = 0;\n const separator = ' > ';\n const sepLength = separator.length;\n let nextStr;\n const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;\n const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem, keyAttrs);\n // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds maxStringLength\n // (ignore this limit if we are on the first iteration)\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {\n break;\n }\n\n out.push(nextStr);\n\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch (_oO) {\n return '';\n }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el: unknown, keyAttrs?: string[]): string {\n const elem = el as {\n tagName?: string;\n id?: string;\n className?: string;\n getAttribute(key: string): string;\n };\n\n const out = [];\n let className;\n let classes;\n let key;\n let attr;\n let i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n // @ts-expect-error WINDOW has HTMLElement\n if (WINDOW.HTMLElement) {\n // If using the component name annotation plugin, this value may be available on the DOM node\n if (elem instanceof HTMLElement && elem.dataset && elem.dataset['sentryComponent']) {\n return elem.dataset['sentryComponent'];\n }\n }\n\n out.push(elem.tagName.toLowerCase());\n\n // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n const keyAttrPairs =\n keyAttrs && keyAttrs.length\n ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n : null;\n\n if (keyAttrPairs && keyAttrPairs.length) {\n keyAttrPairs.forEach(keyAttrPair => {\n out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n });\n } else {\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n // eslint-disable-next-line prefer-const\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push(`.${classes[i]}`);\n }\n }\n }\n const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt'];\n for (i = 0; i < allowedAttrs.length; i++) {\n key = allowedAttrs[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push(`[${key}=\"${attr}\"]`);\n }\n }\n return out.join('');\n}\n\n/**\n * A safe form of location.href\n */\nexport function getLocationHref(): string {\n try {\n return WINDOW.document.location.href;\n } catch (oO) {\n return '';\n }\n}\n\n/**\n * Gets a DOM element by using document.querySelector.\n *\n * This wrapper will first check for the existance of the function before\n * actually calling it so that we don't have to take care of this check,\n * every time we want to access the DOM.\n *\n * Reason: DOM/querySelector is not available in all environments.\n *\n * We have to cast to any because utils can be consumed by a variety of environments,\n * and we don't want to break TS users. If you know what element will be selected by\n * `document.querySelector`, specify it as part of the generic call. For example,\n * `const element = getDomElement('selector');`\n *\n * @param selector the selector string passed on to document.querySelector\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getDomElement(selector: string): E | null {\n if (WINDOW.document && WINDOW.document.querySelector) {\n return WINDOW.document.querySelector(selector) as unknown as E;\n }\n return null;\n}\n\n/**\n * Given a DOM element, traverses up the tree until it finds the first ancestor node\n * that has the `data-sentry-component` attribute. This attribute is added at build-time\n * by projects that have the component name annotation plugin installed.\n *\n * @returns a string representation of the component for the provided DOM element, or `null` if not found\n */\nexport function getComponentName(elem: unknown): string | null {\n // @ts-expect-error WINDOW has HTMLElement\n if (!WINDOW.HTMLElement) {\n return null;\n }\n\n let currentElem = elem as SimpleNode;\n const MAX_TRAVERSE_HEIGHT = 5;\n for (let i = 0; i < MAX_TRAVERSE_HEIGHT; i++) {\n if (!currentElem) {\n return null;\n }\n\n if (currentElem instanceof HTMLElement && currentElem.dataset['sentryComponent']) {\n return currentElem.dataset['sentryComponent'];\n }\n\n currentElem = currentElem.parentNode;\n }\n\n return null;\n}\n","import { DEBUG_BUILD } from '../debug-build';\nimport { logger } from '../logger';\nimport { getFunctionName } from '../stacktrace';\n\nexport type InstrumentHandlerType = 'console' | 'dom' | 'fetch' | 'history' | 'xhr' | 'error' | 'unhandledrejection';\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type InstrumentHandlerCallback = (data: any) => void;\n\n// We keep the handlers globally\nconst handlers: { [key in InstrumentHandlerType]?: InstrumentHandlerCallback[] } = {};\nconst instrumented: { [key in InstrumentHandlerType]?: boolean } = {};\n\n/** Add a handler function. */\nexport function addHandler(type: InstrumentHandlerType, handler: InstrumentHandlerCallback): void {\n handlers[type] = handlers[type] || [];\n (handlers[type] as InstrumentHandlerCallback[]).push(handler);\n}\n\n/**\n * Reset all instrumentation handlers.\n * This can be used by tests to ensure we have a clean slate of instrumentation handlers.\n */\nexport function resetInstrumentationHandlers(): void {\n Object.keys(handlers).forEach(key => {\n handlers[key as InstrumentHandlerType] = undefined;\n });\n}\n\n/** Maybe run an instrumentation function, unless it was already called. */\nexport function maybeInstrument(type: InstrumentHandlerType, instrumentFn: () => void): void {\n if (!instrumented[type]) {\n instrumentFn();\n instrumented[type] = true;\n }\n}\n\n/** Trigger handlers for a given instrumentation type. */\nexport function triggerHandlers(type: InstrumentHandlerType, data: unknown): void {\n const typeHandlers = type && handlers[type];\n if (!typeHandlers) {\n return;\n }\n\n for (const handler of typeHandlers) {\n try {\n handler(data);\n } catch (e) {\n DEBUG_BUILD &&\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n e,\n );\n }\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { ConsoleLevel, HandlerDataConsole } from '@sentry/types';\n\nimport { CONSOLE_LEVELS, originalConsoleMethods } from '../logger';\nimport { fill } from '../object';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\n/**\n * Add an instrumentation handler for when a console.xxx method is called.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addConsoleInstrumentationHandler(handler: (data: HandlerDataConsole) => void): void {\n const type = 'console';\n addHandler(type, handler);\n maybeInstrument(type, instrumentConsole);\n}\n\nfunction instrumentConsole(): void {\n if (!('console' in GLOBAL_OBJ)) {\n return;\n }\n\n CONSOLE_LEVELS.forEach(function (level: ConsoleLevel): void {\n if (!(level in GLOBAL_OBJ.console)) {\n return;\n }\n\n fill(GLOBAL_OBJ.console, level, function (originalConsoleMethod: () => any): Function {\n originalConsoleMethods[level] = originalConsoleMethod;\n\n return function (...args: any[]): void {\n const handlerData: HandlerDataConsole = { args, level };\n triggerHandlers('console', handlerData);\n\n const log = originalConsoleMethods[level];\n log && log.apply(GLOBAL_OBJ.console, args);\n };\n });\n });\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { HandlerDataFetch } from '@sentry/types';\n\nimport { fill } from '../object';\nimport { supportsNativeFetch } from '../supports';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\ntype FetchResource = string | { toString(): string } | { url: string };\n\n/**\n * Add an instrumentation handler for when a fetch request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addFetchInstrumentationHandler(handler: (data: HandlerDataFetch) => void): void {\n const type = 'fetch';\n addHandler(type, handler);\n maybeInstrument(type, instrumentFetch);\n}\n\nfunction instrumentFetch(): void {\n if (!supportsNativeFetch()) {\n return;\n }\n\n fill(GLOBAL_OBJ, 'fetch', function (originalFetch: () => void): () => void {\n return function (...args: any[]): void {\n const { method, url } = parseFetchArgs(args);\n\n const handlerData: HandlerDataFetch = {\n args,\n fetchData: {\n method,\n url,\n },\n startTimestamp: Date.now(),\n };\n\n triggerHandlers('fetch', {\n ...handlerData,\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalFetch.apply(GLOBAL_OBJ, args).then(\n (response: Response) => {\n const finishedHandlerData: HandlerDataFetch = {\n ...handlerData,\n endTimestamp: Date.now(),\n response,\n };\n\n triggerHandlers('fetch', finishedHandlerData);\n return response;\n },\n (error: Error) => {\n const erroredHandlerData: HandlerDataFetch = {\n ...handlerData,\n endTimestamp: Date.now(),\n error,\n };\n\n triggerHandlers('fetch', erroredHandlerData);\n // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n // it means the sentry.javascript SDK caught an error invoking your application code.\n // This is expected behavior and NOT indicative of a bug with sentry.javascript.\n throw error;\n },\n );\n };\n });\n}\n\nfunction hasProp(obj: unknown, prop: T): obj is Record {\n return !!obj && typeof obj === 'object' && !!(obj as Record)[prop];\n}\n\nfunction getUrlFromResource(resource: FetchResource): string {\n if (typeof resource === 'string') {\n return resource;\n }\n\n if (!resource) {\n return '';\n }\n\n if (hasProp(resource, 'url')) {\n return resource.url;\n }\n\n if (resource.toString) {\n return resource.toString();\n }\n\n return '';\n}\n\n/**\n * Parses the fetch arguments to find the used Http method and the url of the request.\n * Exported for tests only.\n */\nexport function parseFetchArgs(fetchArgs: unknown[]): { method: string; url: string } {\n if (fetchArgs.length === 0) {\n return { method: 'GET', url: '' };\n }\n\n if (fetchArgs.length === 2) {\n const [url, options] = fetchArgs as [FetchResource, object];\n\n return {\n url: getUrlFromResource(url),\n method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET',\n };\n }\n\n const arg = fetchArgs[0];\n return {\n url: getUrlFromResource(arg as FetchResource),\n method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET',\n };\n}\n","import type { HandlerDataError } from '@sentry/types';\n\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\nlet _oldOnErrorHandler: (typeof GLOBAL_OBJ)['onerror'] | null = null;\n\n/**\n * Add an instrumentation handler for when an error is captured by the global error handler.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addGlobalErrorInstrumentationHandler(handler: (data: HandlerDataError) => void): void {\n const type = 'error';\n addHandler(type, handler);\n maybeInstrument(type, instrumentError);\n}\n\nfunction instrumentError(): void {\n _oldOnErrorHandler = GLOBAL_OBJ.onerror;\n\n GLOBAL_OBJ.onerror = function (\n msg: string | object,\n url?: string,\n line?: number,\n column?: number,\n error?: Error,\n ): boolean {\n const handlerData: HandlerDataError = {\n column,\n error,\n line,\n msg,\n url,\n };\n triggerHandlers('error', handlerData);\n\n if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnErrorHandler.apply(this, arguments);\n }\n\n return false;\n };\n\n GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { HandlerDataUnhandledRejection } from '@sentry/types';\n\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\nlet _oldOnUnhandledRejectionHandler: (typeof GLOBAL_OBJ)['onunhandledrejection'] | null = null;\n\n/**\n * Add an instrumentation handler for when an unhandled promise rejection is captured.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addGlobalUnhandledRejectionInstrumentationHandler(\n handler: (data: HandlerDataUnhandledRejection) => void,\n): void {\n const type = 'unhandledrejection';\n addHandler(type, handler);\n maybeInstrument(type, instrumentUnhandledRejection);\n}\n\nfunction instrumentUnhandledRejection(): void {\n _oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection;\n\n GLOBAL_OBJ.onunhandledrejection = function (e: any): boolean {\n const handlerData: HandlerDataUnhandledRejection = e;\n triggerHandlers('unhandledrejection', handlerData);\n\n if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n }\n\n return true;\n };\n\n GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;\n}\n","// Based on https://github.com/angular/angular.js/pull/13945/files\n// The MIT License\n\n// Copyright (c) 2010-2016 Google, Inc. http://angularjs.org\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport { getGlobalObject } from '../worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject();\n\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsHistory(): boolean {\n // NOTE: in Chrome App environment, touching history.pushState, *even inside\n // a try/catch block*, will cause Chrome to output an error to console.error\n // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const chrome = (WINDOW as any).chrome;\n const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState;\n\n return !isChromePackagedApp && hasHistoryApi;\n}\n","// TODO(v8): Move everything in this file into the browser package. Nothing here is generic and we run risk of leaking browser types into non-browser packages.\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { HandlerDataHistory } from '@sentry/types';\n\nimport { fill } from '../object';\nimport { supportsHistory } from '../supports';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\nconst WINDOW = GLOBAL_OBJ as unknown as Window;\n\nlet lastHref: string | undefined;\n\n/**\n * Add an instrumentation handler for when a fetch request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addHistoryInstrumentationHandler(handler: (data: HandlerDataHistory) => void): void {\n const type = 'history';\n addHandler(type, handler);\n maybeInstrument(type, instrumentHistory);\n}\n\nfunction instrumentHistory(): void {\n if (!supportsHistory()) {\n return;\n }\n\n const oldOnPopState = WINDOW.onpopstate;\n WINDOW.onpopstate = function (this: WindowEventHandlers, ...args: any[]): any {\n const to = WINDOW.location.href;\n // keep track of the current URL state, as we always receive only the updated state\n const from = lastHref;\n lastHref = to;\n const handlerData: HandlerDataHistory = { from, to };\n triggerHandlers('history', handlerData);\n if (oldOnPopState) {\n // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.\n // https://github.com/getsentry/sentry-javascript/issues/3344\n // https://github.com/bugsnag/bugsnag-js/issues/469\n try {\n return oldOnPopState.apply(this, args);\n } catch (_oO) {\n // no-empty\n }\n }\n };\n\n function historyReplacementFunction(originalHistoryFunction: () => void): () => void {\n return function (this: History, ...args: any[]): void {\n const url = args.length > 2 ? args[2] : undefined;\n if (url) {\n // coerce to string (this is what pushState does)\n const from = lastHref;\n const to = String(url);\n // keep track of the current URL state, as we always receive only the updated state\n lastHref = to;\n const handlerData: HandlerDataHistory = { from, to };\n triggerHandlers('history', handlerData);\n }\n return originalHistoryFunction.apply(this, args);\n };\n }\n\n fill(WINDOW.history, 'pushState', historyReplacementFunction);\n fill(WINDOW.history, 'replaceState', historyReplacementFunction);\n}\n","// TODO(v8): Move everything in this file into the browser package. Nothing here is generic and we run risk of leaking browser types into non-browser packages.\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { HandlerDataXhr, SentryWrappedXMLHttpRequest, WrappedFunction } from '@sentry/types';\n\nimport { isString } from '../is';\nimport { fill } from '../object';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\nconst WINDOW = GLOBAL_OBJ as unknown as Window;\n\nexport const SENTRY_XHR_DATA_KEY = '__sentry_xhr_v3__';\n\n/**\n * Add an instrumentation handler for when an XHR request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addXhrInstrumentationHandler(handler: (data: HandlerDataXhr) => void): void {\n const type = 'xhr';\n addHandler(type, handler);\n maybeInstrument(type, instrumentXHR);\n}\n\n/** Exported only for tests. */\nexport function instrumentXHR(): void {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!(WINDOW as any).XMLHttpRequest) {\n return;\n }\n\n const xhrproto = XMLHttpRequest.prototype;\n\n fill(xhrproto, 'open', function (originalOpen: () => void): () => void {\n return function (this: XMLHttpRequest & SentryWrappedXMLHttpRequest, ...args: any[]): void {\n const startTimestamp = Date.now();\n\n // open() should always be called with two or more arguments\n // But to be on the safe side, we actually validate this and bail out if we don't have a method & url\n const method = isString(args[0]) ? args[0].toUpperCase() : undefined;\n const url = parseUrl(args[1]);\n\n if (!method || !url) {\n return originalOpen.apply(this, args);\n }\n\n this[SENTRY_XHR_DATA_KEY] = {\n method,\n url,\n request_headers: {},\n };\n\n // if Sentry key appears in URL, don't capture it as a request\n if (method === 'POST' && url.match(/sentry_key/)) {\n this.__sentry_own_request__ = true;\n }\n\n const onreadystatechangeHandler: () => void = () => {\n // For whatever reason, this is not the same instance here as from the outer method\n const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n if (!xhrInfo) {\n return;\n }\n\n if (this.readyState === 4) {\n try {\n // touching statusCode in some platforms throws\n // an exception\n xhrInfo.status_code = this.status;\n } catch (e) {\n /* do nothing */\n }\n\n const handlerData: HandlerDataXhr = {\n args: [method, url],\n endTimestamp: Date.now(),\n startTimestamp,\n xhr: this,\n };\n triggerHandlers('xhr', handlerData);\n }\n };\n\n if ('onreadystatechange' in this && typeof this.onreadystatechange === 'function') {\n fill(this, 'onreadystatechange', function (original: WrappedFunction): Function {\n return function (this: SentryWrappedXMLHttpRequest, ...readyStateArgs: any[]): void {\n onreadystatechangeHandler();\n return original.apply(this, readyStateArgs);\n };\n });\n } else {\n this.addEventListener('readystatechange', onreadystatechangeHandler);\n }\n\n // Intercepting `setRequestHeader` to access the request headers of XHR instance.\n // This will only work for user/library defined headers, not for the default/browser-assigned headers.\n // Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`.\n fill(this, 'setRequestHeader', function (original: WrappedFunction): Function {\n return function (this: SentryWrappedXMLHttpRequest, ...setRequestHeaderArgs: unknown[]): void {\n const [header, value] = setRequestHeaderArgs;\n\n const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n if (xhrInfo && isString(header) && isString(value)) {\n xhrInfo.request_headers[header.toLowerCase()] = value;\n }\n\n return original.apply(this, setRequestHeaderArgs);\n };\n });\n\n return originalOpen.apply(this, args);\n };\n });\n\n fill(xhrproto, 'send', function (originalSend: () => void): () => void {\n return function (this: XMLHttpRequest & SentryWrappedXMLHttpRequest, ...args: any[]): void {\n const sentryXhrData = this[SENTRY_XHR_DATA_KEY];\n\n if (!sentryXhrData) {\n return originalSend.apply(this, args);\n }\n\n if (args[0] !== undefined) {\n sentryXhrData.body = args[0];\n }\n\n const handlerData: HandlerDataXhr = {\n args: [sentryXhrData.method, sentryXhrData.url],\n startTimestamp: Date.now(),\n xhr: this,\n };\n triggerHandlers('xhr', handlerData);\n\n return originalSend.apply(this, args);\n };\n });\n}\n\nfunction parseUrl(url: string | unknown): string | undefined {\n if (isString(url)) {\n return url;\n }\n\n try {\n // url can be a string or URL\n // but since URL is not available in IE11, we do not check for it,\n // but simply assume it is an URL and return `toString()` from it (which returns the full URL)\n // If that fails, we just return undefined\n return (url as URL).toString();\n } catch {} // eslint-disable-line no-empty\n\n return undefined;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport type { ParameterizedString, PolymorphicEvent, Primitive } from '@sentry/types';\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst objectToString = Object.prototype.toString;\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isError(wat: unknown): wat is Error {\n switch (objectToString.call(wat)) {\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n return true;\n default:\n return isInstanceOf(wat, Error);\n }\n}\n/**\n * Checks whether given value is an instance of the given built-in class.\n *\n * @param wat The value to be checked\n * @param className\n * @returns A boolean representing the result.\n */\nfunction isBuiltin(wat: unknown, className: string): boolean {\n return objectToString.call(wat) === `[object ${className}]`;\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isErrorEvent(wat: unknown): boolean {\n return isBuiltin(wat, 'ErrorEvent');\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMError(wat: unknown): boolean {\n return isBuiltin(wat, 'DOMError');\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMException(wat: unknown): boolean {\n return isBuiltin(wat, 'DOMException');\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isString(wat: unknown): wat is string {\n return isBuiltin(wat, 'String');\n}\n\n/**\n * Checks whether given string is parameterized\n * {@link isParameterizedString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isParameterizedString(wat: unknown): wat is ParameterizedString {\n return (\n typeof wat === 'object' &&\n wat !== null &&\n '__sentry_template_string__' in wat &&\n '__sentry_template_values__' in wat\n );\n}\n\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPrimitive(wat: unknown): wat is Primitive {\n return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPlainObject(wat: unknown): wat is Record {\n return isBuiltin(wat, 'Object');\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isEvent(wat: unknown): wat is PolymorphicEvent {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isElement(wat: unknown): boolean {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isRegExp(wat: unknown): wat is RegExp {\n return isBuiltin(wat, 'RegExp');\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nexport function isThenable(wat: any): wat is PromiseLike {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isSyntheticEvent(wat: unknown): boolean {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n\n/**\n * Checks whether given value is NaN\n * {@link isNaN}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isNaN(wat: unknown): boolean {\n return typeof wat === 'number' && wat !== wat;\n}\n\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nexport function isInstanceOf(wat: any, base: any): boolean {\n try {\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}\n\ninterface VueViewModel {\n // Vue3\n __isVue?: boolean;\n // Vue2\n _isVue?: boolean;\n}\n/**\n * Checks whether given value's type is a Vue ViewModel.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isVueViewModel(wat: unknown): boolean {\n // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property.\n return !!(typeof wat === 'object' && wat !== null && ((wat as VueViewModel).__isVue || (wat as VueViewModel)._isVue));\n}\n","import type { ConsoleLevel } from '@sentry/types';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { GLOBAL_OBJ } from './worldwide';\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\nexport const CONSOLE_LEVELS: readonly ConsoleLevel[] = [\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'log',\n 'assert',\n 'trace',\n] as const;\n\ntype LoggerMethod = (...args: unknown[]) => void;\ntype LoggerConsoleMethods = Record;\n\n/** This may be mutated by the console instrumentation. */\nexport const originalConsoleMethods: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key in ConsoleLevel]?: (...args: any[]) => void;\n} = {};\n\n/** JSDoc */\ninterface Logger extends LoggerConsoleMethods {\n disable(): void;\n enable(): void;\n isEnabled(): boolean;\n}\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nexport function consoleSandbox(callback: () => T): T {\n if (!('console' in GLOBAL_OBJ)) {\n return callback();\n }\n\n const console = GLOBAL_OBJ.console as Console;\n const wrappedFuncs: Partial = {};\n\n const wrappedLevels = Object.keys(originalConsoleMethods) as ConsoleLevel[];\n\n // Restore all wrapped console methods\n wrappedLevels.forEach(level => {\n const originalConsoleMethod = originalConsoleMethods[level] as LoggerMethod;\n wrappedFuncs[level] = console[level] as LoggerMethod | undefined;\n console[level] = originalConsoleMethod;\n });\n\n try {\n return callback();\n } finally {\n // Revert restoration to wrapped state\n wrappedLevels.forEach(level => {\n console[level] = wrappedFuncs[level] as LoggerMethod;\n });\n }\n}\n\nfunction makeLogger(): Logger {\n let enabled = false;\n const logger: Partial = {\n enable: () => {\n enabled = true;\n },\n disable: () => {\n enabled = false;\n },\n isEnabled: () => enabled,\n };\n\n if (DEBUG_BUILD) {\n CONSOLE_LEVELS.forEach(name => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n logger[name] = (...args: any[]) => {\n if (enabled) {\n consoleSandbox(() => {\n GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);\n });\n }\n };\n });\n } else {\n CONSOLE_LEVELS.forEach(name => {\n logger[name] = () => undefined;\n });\n }\n\n return logger as Logger;\n}\n\nexport const logger = makeLogger();\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Event, Exception, Mechanism, StackFrame } from '@sentry/types';\n\nimport { addNonEnumerableProperty } from './object';\nimport { snipLine } from './string';\nimport { GLOBAL_OBJ } from './worldwide';\n\ninterface CryptoInternal {\n getRandomValues(array: Uint8Array): Uint8Array;\n randomUUID?(): string;\n}\n\n/** An interface for common properties on global */\ninterface CryptoGlobal {\n msCrypto?: CryptoInternal;\n crypto?: CryptoInternal;\n}\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nexport function uuid4(): string {\n const gbl = GLOBAL_OBJ as typeof GLOBAL_OBJ & CryptoGlobal;\n const crypto = gbl.crypto || gbl.msCrypto;\n\n let getRandomByte = (): number => Math.random() * 16;\n try {\n if (crypto && crypto.randomUUID) {\n return crypto.randomUUID().replace(/-/g, '');\n }\n if (crypto && crypto.getRandomValues) {\n getRandomByte = () => {\n // crypto.getRandomValues might return undefined instead of the typed array\n // in old Chromium versions (e.g. 23.0.1235.0 (151422))\n // However, `typedArray` is still filled in-place.\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#typedarray\n const typedArray = new Uint8Array(1);\n crypto.getRandomValues(typedArray);\n return typedArray[0];\n };\n }\n } catch (_) {\n // some runtimes can crash invoking crypto\n // https://github.com/getsentry/sentry-javascript/issues/8935\n }\n\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n return (([1e7] as unknown as string) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>\n // eslint-disable-next-line no-bitwise\n ((c as unknown as number) ^ ((getRandomByte() & 15) >> ((c as unknown as number) / 4))).toString(16),\n );\n}\n\nfunction getFirstException(event: Event): Exception | undefined {\n return event.exception && event.exception.values ? event.exception.values[0] : undefined;\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nexport function getEventDescription(event: Event): string {\n const { message, event_id: eventId } = event;\n if (message) {\n return message;\n }\n\n const firstException = getFirstException(event);\n if (firstException) {\n if (firstException.type && firstException.value) {\n return `${firstException.type}: ${firstException.value}`;\n }\n return firstException.type || firstException.value || eventId || '';\n }\n return eventId || '';\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nexport function addExceptionTypeValue(event: Event, value?: string, type?: string): void {\n const exception = (event.exception = event.exception || {});\n const values = (exception.values = exception.values || []);\n const firstException = (values[0] = values[0] || {});\n if (!firstException.value) {\n firstException.value = value || '';\n }\n if (!firstException.type) {\n firstException.type = type || 'Error';\n }\n}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nexport function addExceptionMechanism(event: Event, newMechanism?: Partial): void {\n const firstException = getFirstException(event);\n if (!firstException) {\n return;\n }\n\n const defaultMechanism = { type: 'generic', handled: true };\n const currentMechanism = firstException.mechanism;\n firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n if (newMechanism && 'data' in newMechanism) {\n const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };\n firstException.mechanism.data = mergedData;\n }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\ninterface SemVer {\n major?: number;\n minor?: number;\n patch?: number;\n prerelease?: string;\n buildmetadata?: string;\n}\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nexport function parseSemver(input: string): SemVer {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = parseInt(match[1], 10);\n const minor = parseInt(match[2], 10);\n const patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nexport function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext: number = 5): void {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping\n if (frame.lineno === undefined) {\n return;\n }\n\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line: string) => snipLine(line, 0));\n\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line: string) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nexport function checkOrSetAlreadyCaught(exception: unknown): boolean {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (exception && (exception as any).__sentry_captured__) {\n return true;\n }\n\n try {\n // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n // `ExtraErrorData` integration\n addNonEnumerableProperty(exception as { [key: string]: unknown }, '__sentry_captured__', true);\n } catch (err) {\n // `exception` is a primitive, so we can't mark it seen\n }\n\n return false;\n}\n\n/**\n * Checks whether the given input is already an array, and if it isn't, wraps it in one.\n *\n * @param maybeArray Input to turn into an array, if necessary\n * @returns The input, if already an array, or an array with the input as the only element, if not\n */\nexport function arrayify(maybeArray: T | T[]): T[] {\n return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}\n","import type { Primitive } from '@sentry/types';\n\nimport { isNaN, isSyntheticEvent, isVueViewModel } from './is';\nimport type { MemoFunc } from './memo';\nimport { memoBuilder } from './memo';\nimport { convertToPlainObject } from './object';\nimport { getFunctionName } from './stacktrace';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n// This is a hack to placate TS, relying on the fact that technically, arrays are objects with integer keys. Normally we\n// think of those keys as actual numbers, but `arr['0']` turns out to work just as well as `arr[0]`, and doing it this\n// way lets us use a single type in the places where behave as if we are only dealing with objects, even if some of them\n// might be arrays.\ntype ObjOrArray = { [key: string]: T };\n\n/**\n * Recursively normalizes the given object.\n *\n * - Creates a copy to prevent original input mutation\n * - Skips non-enumerable properties\n * - When stringifying, calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format\n * - Translates known global objects/classes to a string representations\n * - Takes care of `Error` object serialization\n * - Optionally limits depth of final output\n * - Optionally limits number of properties/elements included in any single object/array\n *\n * @param input The object to be normalized.\n * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)\n * @param maxProperties The max number of elements or properties to be included in any single array or\n * object in the normallized output.\n * @returns A normalized version of the object, or `\"**non-serializable**\"` if any errors are thrown during normalization.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function normalize(input: unknown, depth: number = 100, maxProperties: number = +Infinity): any {\n try {\n // since we're at the outermost level, we don't provide a key\n return visit('', input, depth, maxProperties);\n } catch (err) {\n return { ERROR: `**non-serializable** (${err})` };\n }\n}\n\n/** JSDoc */\nexport function normalizeToSize(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n object: { [key: string]: any },\n // Default Node.js REPL depth\n depth: number = 3,\n // 100kB, as 200kB is max payload size, so half sounds reasonable\n maxSize: number = 100 * 1024,\n): T {\n const normalized = normalize(object, depth);\n\n if (jsonSize(normalized) > maxSize) {\n return normalizeToSize(object, depth - 1, maxSize);\n }\n\n return normalized as T;\n}\n\n/**\n * Visits a node to perform normalization on it\n *\n * @param key The key corresponding to the given node\n * @param value The node to be visited\n * @param depth Optional number indicating the maximum recursion depth\n * @param maxProperties Optional maximum number of properties/elements included in any single object/array\n * @param memo Optional Memo class handling decycling\n */\nfunction visit(\n key: string,\n value: unknown,\n depth: number = +Infinity,\n maxProperties: number = +Infinity,\n memo: MemoFunc = memoBuilder(),\n): Primitive | ObjOrArray {\n const [memoize, unmemoize] = memo;\n\n // Get the simple cases out of the way first\n if (\n value == null || // this matches null and undefined -> eqeq not eqeqeq\n (['number', 'boolean', 'string'].includes(typeof value) && !isNaN(value))\n ) {\n return value as Primitive;\n }\n\n const stringified = stringifyValue(key, value);\n\n // Anything we could potentially dig into more (objects or arrays) will have come back as `\"[object XXXX]\"`.\n // Everything else will have already been serialized, so if we don't see that pattern, we're done.\n if (!stringified.startsWith('[object ')) {\n return stringified;\n }\n\n // From here on, we can assert that `value` is either an object or an array.\n\n // Do not normalize objects that we know have already been normalized. As a general rule, the\n // \"__sentry_skip_normalization__\" property should only be used sparingly and only should only be set on objects that\n // have already been normalized.\n if ((value as ObjOrArray)['__sentry_skip_normalization__']) {\n return value as ObjOrArray;\n }\n\n // We can set `__sentry_override_normalization_depth__` on an object to ensure that from there\n // We keep a certain amount of depth.\n // This should be used sparingly, e.g. we use it for the redux integration to ensure we get a certain amount of state.\n const remainingDepth =\n typeof (value as ObjOrArray)['__sentry_override_normalization_depth__'] === 'number'\n ? ((value as ObjOrArray)['__sentry_override_normalization_depth__'] as number)\n : depth;\n\n // We're also done if we've reached the max depth\n if (remainingDepth === 0) {\n // At this point we know `serialized` is a string of the form `\"[object XXXX]\"`. Clean it up so it's just `\"[XXXX]\"`.\n return stringified.replace('object ', '');\n }\n\n // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.\n if (memoize(value)) {\n return '[Circular ~]';\n }\n\n // If the value has a `toJSON` method, we call it to extract more information\n const valueWithToJSON = value as unknown & { toJSON?: () => unknown };\n if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {\n try {\n const jsonValue = valueWithToJSON.toJSON();\n // We need to normalize the return value of `.toJSON()` in case it has circular references\n return visit('', jsonValue, remainingDepth - 1, maxProperties, memo);\n } catch (err) {\n // pass (The built-in `toJSON` failed, but we can still try to do it ourselves)\n }\n }\n\n // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse\n // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each\n // property/entry, and keep track of the number of items we add to it.\n const normalized = (Array.isArray(value) ? [] : {}) as ObjOrArray;\n let numAdded = 0;\n\n // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant\n // properties are non-enumerable and otherwise would get missed.\n const visitable = convertToPlainObject(value as ObjOrArray);\n\n for (const visitKey in visitable) {\n // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {\n continue;\n }\n\n if (numAdded >= maxProperties) {\n normalized[visitKey] = '[MaxProperties ~]';\n break;\n }\n\n // Recursively visit all the child nodes\n const visitValue = visitable[visitKey];\n normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo);\n\n numAdded++;\n }\n\n // Once we've visited all the branches, remove the parent from memo storage\n unmemoize(value);\n\n // Return accumulated values\n return normalized;\n}\n\n/**\n * @deprecated This export will be removed in v8.\n */\nexport { visit as walk };\n\n/* eslint-disable complexity */\n/**\n * Stringify the given value. Handles various known special values and types.\n *\n * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn\n * the number 1231 into \"[Object Number]\", nor on `null`, as it will throw.\n *\n * @param value The value to stringify\n * @returns A stringified representation of the given value\n */\nfunction stringifyValue(\n key: unknown,\n // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for\n // our internal use, it'll do\n value: Exclude,\n): string {\n try {\n if (key === 'domain' && value && typeof value === 'object' && (value as { _events: unknown })._events) {\n return '[Domain]';\n }\n\n if (key === 'domainEmitter') {\n return '[DomainEmitter]';\n }\n\n // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first\n // which won't throw if they are not present.\n\n if (typeof global !== 'undefined' && value === global) {\n return '[Global]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof window !== 'undefined' && value === window) {\n return '[Window]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof document !== 'undefined' && value === document) {\n return '[Document]';\n }\n\n if (isVueViewModel(value)) {\n return '[VueViewModel]';\n }\n\n // React's SyntheticEvent thingy\n if (isSyntheticEvent(value)) {\n return '[SyntheticEvent]';\n }\n\n if (typeof value === 'number' && value !== value) {\n return '[NaN]';\n }\n\n if (typeof value === 'function') {\n return `[Function: ${getFunctionName(value)}]`;\n }\n\n if (typeof value === 'symbol') {\n return `[${String(value)}]`;\n }\n\n // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion\n if (typeof value === 'bigint') {\n return `[BigInt: ${String(value)}]`;\n }\n\n // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting\n // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as\n // `\"[object Object]\"`. If we instead look at the constructor's name (which is the same as the name of the class),\n // we can make sure that only plain objects come out that way.\n const objName = getConstructorName(value);\n\n // Handle HTML Elements\n if (/^HTML(\\w*)Element$/.test(objName)) {\n return `[HTMLElement: ${objName}]`;\n }\n\n return `[object ${objName}]`;\n } catch (err) {\n return `**non-serializable** (${err})`;\n }\n}\n/* eslint-enable complexity */\n\nfunction getConstructorName(value: unknown): string {\n const prototype: Prototype | null = Object.getPrototypeOf(value);\n\n return prototype ? prototype.constructor.name : 'null prototype';\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value: string): number {\n // eslint-disable-next-line no-bitwise\n return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction jsonSize(value: any): number {\n return utf8Length(JSON.stringify(value));\n}\n\n/**\n * Normalizes URLs in exceptions and stacktraces to a base path so Sentry can fingerprint\n * across platforms and working directory.\n *\n * @param url The URL to be normalized.\n * @param basePath The application base path.\n * @returns The normalized URL.\n */\nexport function normalizeUrlToBase(url: string, basePath: string): string {\n const escapedBase = basePath\n // Backslash to forward\n .replace(/\\\\/g, '/')\n // Escape RegExp special characters\n .replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n\n let newUrl = url;\n try {\n newUrl = decodeURI(url);\n } catch (_Oo) {\n // Sometime this breaks\n }\n return (\n newUrl\n .replace(/\\\\/g, '/')\n .replace(/webpack:\\/?/g, '') // Remove intermediate base path\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\n .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///')\n );\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport type MemoFunc = [\n // memoize\n (obj: any) => boolean,\n // unmemoize\n (obj: any) => void,\n];\n\n/**\n * Helper to decycle json objects\n */\nexport function memoBuilder(): MemoFunc {\n const hasWeakSet = typeof WeakSet === 'function';\n const inner: any = hasWeakSet ? new WeakSet() : [];\n function memoize(obj: any): boolean {\n if (hasWeakSet) {\n if (inner.has(obj)) {\n return true;\n }\n inner.add(obj);\n return false;\n }\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < inner.length; i++) {\n const value = inner[i];\n if (value === obj) {\n return true;\n }\n }\n inner.push(obj);\n return false;\n }\n\n function unmemoize(obj: any): void {\n if (hasWeakSet) {\n inner.delete(obj);\n } else {\n for (let i = 0; i < inner.length; i++) {\n if (inner[i] === obj) {\n inner.splice(i, 1);\n break;\n }\n }\n }\n }\n return [memoize, unmemoize];\n}\n","/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { WrappedFunction } from '@sentry/types';\n\nimport { htmlTreeAsString } from './browser';\nimport { DEBUG_BUILD } from './debug-build';\nimport { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive } from './is';\nimport { logger } from './logger';\nimport { truncate } from './string';\n\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, )` or `origMethod.apply(this, [])` (rather than being called directly), again to preserve `this`.\n * @returns void\n */\nexport function fill(source: { [key: string]: any }, name: string, replacementFactory: (...args: any[]) => any): void {\n if (!(name in source)) {\n return;\n }\n\n const original = source[name] as () => any;\n const wrapped = replacementFactory(original) as WrappedFunction;\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (typeof wrapped === 'function') {\n markFunctionWrapped(wrapped, original);\n }\n\n source[name] = wrapped;\n}\n\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\n */\nexport function addNonEnumerableProperty(obj: object, name: string, value: unknown): void {\n try {\n Object.defineProperty(obj, name, {\n // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n value: value,\n writable: true,\n configurable: true,\n });\n } catch (o_O) {\n DEBUG_BUILD && logger.log(`Failed to add non-enumerable property \"${name}\" to object`, obj);\n }\n}\n\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\n */\nexport function markFunctionWrapped(wrapped: WrappedFunction, original: WrappedFunction): void {\n try {\n const proto = original.prototype || {};\n wrapped.prototype = original.prototype = proto;\n addNonEnumerableProperty(wrapped, '__sentry_original__', original);\n } catch (o_O) {} // eslint-disable-line no-empty\n}\n\n/**\n * This extracts the original function if available. See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\nexport function getOriginalFunction(func: WrappedFunction): WrappedFunction | undefined {\n return func.__sentry_original__;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nexport function urlEncode(object: { [key: string]: any }): string {\n return Object.keys(object)\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)\n .join('&');\n}\n\n/**\n * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their\n * non-enumerable properties attached.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor\n * an Error.\n */\nexport function convertToPlainObject(\n value: V,\n):\n | {\n [ownProps: string]: unknown;\n type: string;\n target: string;\n currentTarget: string;\n detail?: unknown;\n }\n | {\n [ownProps: string]: unknown;\n message: string;\n name: string;\n stack?: string;\n }\n | V {\n if (isError(value)) {\n return {\n message: value.message,\n name: value.name,\n stack: value.stack,\n ...getOwnProperties(value),\n };\n } else if (isEvent(value)) {\n const newObj: {\n [ownProps: string]: unknown;\n type: string;\n target: string;\n currentTarget: string;\n detail?: unknown;\n } = {\n type: value.type,\n target: serializeEventTarget(value.target),\n currentTarget: serializeEventTarget(value.currentTarget),\n ...getOwnProperties(value),\n };\n\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n newObj.detail = value.detail;\n }\n\n return newObj;\n } else {\n return value;\n }\n}\n\n/** Creates a string representation of the target of an `Event` object */\nfunction serializeEventTarget(target: unknown): string {\n try {\n return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);\n } catch (_oO) {\n return '';\n }\n}\n\n/** Filters out all but an object's own properties */\nfunction getOwnProperties(obj: unknown): { [key: string]: unknown } {\n if (typeof obj === 'object' && obj !== null) {\n const extractedProps: { [key: string]: unknown } = {};\n for (const property in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, property)) {\n extractedProps[property] = (obj as Record)[property];\n }\n }\n return extractedProps;\n } else {\n return {};\n }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nexport function extractExceptionKeysForMessage(exception: Record, maxLength: number = 40): string {\n const keys = Object.keys(convertToPlainObject(exception));\n keys.sort();\n\n if (!keys.length) {\n return '[object has no keys]';\n }\n\n if (keys[0].length >= maxLength) {\n return truncate(keys[0], maxLength);\n }\n\n for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n const serialized = keys.slice(0, includedKeys).join(', ');\n if (serialized.length > maxLength) {\n continue;\n }\n if (includedKeys === keys.length) {\n return serialized;\n }\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n\n/**\n * Given any object, return a new object having removed all fields whose value was `undefined`.\n * Works recursively on objects and arrays.\n *\n * Attention: This function keeps circular references in the returned object.\n */\nexport function dropUndefinedKeys(inputValue: T): T {\n // This map keeps track of what already visited nodes map to.\n // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular\n // references as the input object.\n const memoizationMap = new Map();\n\n // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API\n return _dropUndefinedKeys(inputValue, memoizationMap);\n}\n\nfunction _dropUndefinedKeys(inputValue: T, memoizationMap: Map): T {\n if (isPlainObject(inputValue)) {\n // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal as T;\n }\n\n const returnValue: { [key: string]: any } = {};\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n for (const key of Object.keys(inputValue)) {\n if (typeof inputValue[key] !== 'undefined') {\n returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);\n }\n }\n\n return returnValue as T;\n }\n\n if (Array.isArray(inputValue)) {\n // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal as T;\n }\n\n const returnValue: unknown[] = [];\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n inputValue.forEach((item: unknown) => {\n returnValue.push(_dropUndefinedKeys(item, memoizationMap));\n });\n\n return returnValue as unknown as T;\n }\n\n return inputValue;\n}\n\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\nexport function objectify(wat: unknown): typeof Object {\n let objectified;\n switch (true) {\n case wat === undefined || wat === null:\n objectified = new String(wat);\n break;\n\n // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n // an object in order to wrap it.\n case typeof wat === 'symbol' || typeof wat === 'bigint':\n objectified = Object(wat);\n break;\n\n // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n case isPrimitive(wat):\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n objectified = new (wat as any).constructor(wat);\n break;\n\n // by process of elimination, at this point we know that `wat` must already be an object\n default:\n objectified = wat;\n break;\n }\n return objectified;\n}\n","/* eslint-disable deprecation/deprecation */\nimport type { Severity, SeverityLevel } from '@sentry/types';\n\n// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either\n//\n// a) moving `validSeverityLevels` to `@sentry/types`,\n// b) moving the`SeverityLevel` type here, or\n// c) importing `validSeverityLevels` from here into `@sentry/types`.\n//\n// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would\n// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the\n// type, reminding anyone who changes it to change this list also, will have to do.\n\nexport const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'];\n\n/**\n * Converts a string-based level into a member of the deprecated {@link Severity} enum.\n *\n * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead.\n *\n * @param level String representation of Severity\n * @returns Severity\n */\nexport function severityFromString(level: Severity | SeverityLevel | string): Severity {\n return severityLevelFromString(level) as Severity;\n}\n\n/**\n * Converts a string-based level into a `SeverityLevel`, normalizing it along the way.\n *\n * @param level String representation of desired `SeverityLevel`.\n * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.\n */\nexport function severityLevelFromString(level: SeverityLevel | string): SeverityLevel {\n return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') as SeverityLevel;\n}\n","import type { StackFrame, StackLineParser, StackParser } from '@sentry/types';\n\nimport type { GetModuleFn } from './node-stack-trace';\nimport { filenameIsInApp, node } from './node-stack-trace';\n\nexport { filenameIsInApp };\n\nconst STACKTRACE_FRAME_LIMIT = 50;\n// Used to sanitize webpack (error: *) wrapped stack errors\nconst WEBPACK_ERROR_REGEXP = /\\(error: (.*)\\)/;\nconst STRIP_FRAME_REGEXP = /captureMessage|captureException/;\n\n/**\n * Creates a stack parser with the supplied line parsers\n *\n * StackFrames are returned in the correct order for Sentry Exception\n * frames and with Sentry SDK internal frames removed from the top and bottom\n *\n */\nexport function createStackParser(...parsers: StackLineParser[]): StackParser {\n const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]);\n\n return (stack: string, skipFirst: number = 0): StackFrame[] => {\n const frames: StackFrame[] = [];\n const lines = stack.split('\\n');\n\n for (let i = skipFirst; i < lines.length; i++) {\n const line = lines[i];\n // Ignore lines over 1kb as they are unlikely to be stack frames.\n // Many of the regular expressions use backtracking which results in run time that increases exponentially with\n // input size. Huge strings can result in hangs/Denial of Service:\n // https://github.com/getsentry/sentry-javascript/issues/2286\n if (line.length > 1024) {\n continue;\n }\n\n // https://github.com/getsentry/sentry-javascript/issues/5459\n // Remove webpack (error: *) wrappers\n const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;\n\n // https://github.com/getsentry/sentry-javascript/issues/7813\n // Skip Error: lines\n if (cleanedLine.match(/\\S*Error: /)) {\n continue;\n }\n\n for (const parser of sortedParsers) {\n const frame = parser(cleanedLine);\n\n if (frame) {\n frames.push(frame);\n break;\n }\n }\n\n if (frames.length >= STACKTRACE_FRAME_LIMIT) {\n break;\n }\n }\n\n return stripSentryFramesAndReverse(frames);\n };\n}\n\n/**\n * Gets a stack parser implementation from Options.stackParser\n * @see Options\n *\n * If options contains an array of line parsers, it is converted into a parser\n */\nexport function stackParserFromStackParserOptions(stackParser: StackParser | StackLineParser[]): StackParser {\n if (Array.isArray(stackParser)) {\n return createStackParser(...stackParser);\n }\n return stackParser;\n}\n\n/**\n * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames.\n * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the\n * function that caused the crash is the last frame in the array.\n * @hidden\n */\nexport function stripSentryFramesAndReverse(stack: ReadonlyArray): StackFrame[] {\n if (!stack.length) {\n return [];\n }\n\n const localStack = Array.from(stack);\n\n // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n if (/sentryWrapped/.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n }\n\n // Reversing in the middle of the procedure allows us to just pop the values off the stack\n localStack.reverse();\n\n // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n\n // When using synthetic events, we will have a 2 levels deep stack, as `new Error('Sentry syntheticException')`\n // is produced within the hub itself, making it:\n //\n // Sentry.captureException()\n // getCurrentHub().captureException()\n //\n // instead of just the top `Sentry` call itself.\n // This forces us to possibly strip an additional frame in the exact same was as above.\n if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n }\n }\n\n return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map(frame => ({\n ...frame,\n filename: frame.filename || localStack[localStack.length - 1].filename,\n function: frame.function || '?',\n }));\n}\n\nconst defaultFunctionName = '';\n\n/**\n * Safely extract function name from itself\n */\nexport function getFunctionName(fn: unknown): string {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}\n\n/**\n * Node.js stack line parser\n *\n * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.\n * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain\n */\nexport function nodeStackLineParser(getModule?: GetModuleFn): StackLineParser {\n return [90, node(getModule)];\n}\n","import { isRegExp, isString, isVueViewModel } from './is';\n\nexport { escapeStringForRegex } from './vendor/escapeStringForRegex';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\nexport function truncate(str: string, max: number = 0): string {\n if (typeof str !== 'string' || max === 0) {\n return str;\n }\n return str.length <= max ? str : `${str.slice(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nexport function snipLine(line: string, colno: number): string {\n let newLine = line;\n const lineLength = newLine.length;\n if (lineLength <= 150) {\n return newLine;\n }\n if (colno > lineLength) {\n // eslint-disable-next-line no-param-reassign\n colno = lineLength;\n }\n\n let start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n\n let end = Math.min(start + 140, lineLength);\n if (end > lineLength - 5) {\n end = lineLength;\n }\n if (end === lineLength) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = `'{snip} ${newLine}`;\n }\n if (end < lineLength) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function safeJoin(input: any[], delimiter?: string): string {\n if (!Array.isArray(input)) {\n return '';\n }\n\n const output = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < input.length; i++) {\n const value = input[i];\n try {\n // This is a hack to fix a Vue3-specific bug that causes an infinite loop of\n // console warnings. This happens when a Vue template is rendered with\n // an undeclared variable, which we try to stringify, ultimately causing\n // Vue to issue another warning which repeats indefinitely.\n // see: https://github.com/getsentry/sentry-javascript/pull/8981\n if (isVueViewModel(value)) {\n output.push('[VueViewModel]');\n } else {\n output.push(String(value));\n }\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n\n/**\n * Checks if the given value matches a regex or string\n *\n * @param value The string to test\n * @param pattern Either a regex or a string against which `value` will be matched\n * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match\n * `pattern` if it contains `pattern`. Only applies to string-type patterns.\n */\nexport function isMatchingPattern(\n value: string,\n pattern: RegExp | string,\n requireExactStringMatch: boolean = false,\n): boolean {\n if (!isString(value)) {\n return false;\n }\n\n if (isRegExp(pattern)) {\n return pattern.test(value);\n }\n if (isString(pattern)) {\n return requireExactStringMatch ? value === pattern : value.includes(pattern);\n }\n\n return false;\n}\n\n/**\n * Test the given string against an array of strings and regexes. By default, string matching is done on a\n * substring-inclusion basis rather than a strict equality basis\n *\n * @param testString The string to test\n * @param patterns The patterns against which to test the string\n * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to\n * count. If false, `testString` will match a string pattern if it contains that pattern.\n * @returns\n */\nexport function stringMatchesSomePattern(\n testString: string,\n patterns: Array = [],\n requireExactStringMatch: boolean = false,\n): boolean {\n return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));\n}\n","import { DEBUG_BUILD } from './debug-build';\nimport { logger } from './logger';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject();\n\ndeclare const EdgeRuntime: string | undefined;\n\nexport { supportsHistory } from './vendor/supportsHistory';\n\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsErrorEvent(): boolean {\n try {\n new ErrorEvent('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMError(): boolean {\n try {\n // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n // 1 argument required, but only 0 present.\n // @ts-expect-error It really needs 1 argument, not 0.\n new DOMError('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMException(): boolean {\n try {\n new DOMException('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsFetch(): boolean {\n if (!('fetch' in WINDOW)) {\n return false;\n }\n\n try {\n new Headers();\n new Request('http://www.example.com');\n new Response();\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isNativeFetch(func: Function): boolean {\n return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\nexport function supportsNativeFetch(): boolean {\n if (typeof EdgeRuntime === 'string') {\n return true;\n }\n\n if (!supportsFetch()) {\n return false;\n }\n\n // Fast path to avoid DOM I/O\n // eslint-disable-next-line @typescript-eslint/unbound-method\n if (isNativeFetch(WINDOW.fetch)) {\n return true;\n }\n\n // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n // so create a \"pure\" iframe to see if that has native fetch\n let result = false;\n const doc = WINDOW.document;\n // eslint-disable-next-line deprecation/deprecation\n if (doc && typeof (doc.createElement as unknown) === 'function') {\n try {\n const sandbox = doc.createElement('iframe');\n sandbox.hidden = true;\n doc.head.appendChild(sandbox);\n if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n result = isNativeFetch(sandbox.contentWindow.fetch);\n }\n doc.head.removeChild(sandbox);\n } catch (err) {\n DEBUG_BUILD &&\n logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n }\n }\n\n return result;\n}\n\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReportingObserver(): boolean {\n return 'ReportingObserver' in WINDOW;\n}\n\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReferrerPolicy(): boolean {\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'\n // (see https://caniuse.com/#feat=referrer-policy),\n // it doesn't. And it throws an exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n\n if (!supportsFetch()) {\n return false;\n }\n\n try {\n new Request('_', {\n referrerPolicy: 'origin' as ReferrerPolicy,\n });\n return true;\n } catch (e) {\n return false;\n }\n}\n","/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/typedef */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isThenable } from './is';\n\n/** SyncPromise internal states */\nconst enum States {\n /** Pending */\n PENDING = 0,\n /** Resolved / OK */\n RESOLVED = 1,\n /** Rejected / Error */\n REJECTED = 2,\n}\n\n// Overloads so we can call resolvedSyncPromise without arguments and generic argument\nexport function resolvedSyncPromise(): PromiseLike;\nexport function resolvedSyncPromise(value: T | PromiseLike): PromiseLike;\n\n/**\n * Creates a resolved sync promise.\n *\n * @param value the value to resolve the promise with\n * @returns the resolved sync promise\n */\nexport function resolvedSyncPromise(value?: T | PromiseLike): PromiseLike {\n return new SyncPromise(resolve => {\n resolve(value);\n });\n}\n\n/**\n * Creates a rejected sync promise.\n *\n * @param value the value to reject the promise with\n * @returns the rejected sync promise\n */\nexport function rejectedSyncPromise(reason?: any): PromiseLike {\n return new SyncPromise((_, reject) => {\n reject(reason);\n });\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise implements PromiseLike {\n private _state: States;\n private _handlers: Array<[boolean, (value: T) => void, (reason: any) => any]>;\n private _value: any;\n\n public constructor(\n executor: (resolve: (value?: T | PromiseLike | null) => void, reject: (reason?: any) => void) => void,\n ) {\n this._state = States.PENDING;\n this._handlers = [];\n\n try {\n executor(this._resolve, this._reject);\n } catch (e) {\n this._reject(e);\n }\n }\n\n /** JSDoc */\n public then(\n onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null,\n onrejected?: ((reason: any) => TResult2 | PromiseLike) | null,\n ): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n this._handlers.push([\n false,\n result => {\n if (!onfulfilled) {\n // TODO: ¯\\_(ツ)_/¯\n // TODO: FIXME\n resolve(result as any);\n } else {\n try {\n resolve(onfulfilled(result));\n } catch (e) {\n reject(e);\n }\n }\n },\n reason => {\n if (!onrejected) {\n reject(reason);\n } else {\n try {\n resolve(onrejected(reason));\n } catch (e) {\n reject(e);\n }\n }\n },\n ]);\n this._executeHandlers();\n });\n }\n\n /** JSDoc */\n public catch(\n onrejected?: ((reason: any) => TResult | PromiseLike) | null,\n ): PromiseLike {\n return this.then(val => val, onrejected);\n }\n\n /** JSDoc */\n public finally(onfinally?: (() => void) | null): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n let val: TResult | any;\n let isRejected: boolean;\n\n return this.then(\n value => {\n isRejected = false;\n val = value;\n if (onfinally) {\n onfinally();\n }\n },\n reason => {\n isRejected = true;\n val = reason;\n if (onfinally) {\n onfinally();\n }\n },\n ).then(() => {\n if (isRejected) {\n reject(val);\n return;\n }\n\n resolve(val as unknown as any);\n });\n });\n }\n\n /** JSDoc */\n private readonly _resolve = (value?: T | PromiseLike | null) => {\n this._setResult(States.RESOLVED, value);\n };\n\n /** JSDoc */\n private readonly _reject = (reason?: any) => {\n this._setResult(States.REJECTED, reason);\n };\n\n /** JSDoc */\n private readonly _setResult = (state: States, value?: T | PromiseLike | any) => {\n if (this._state !== States.PENDING) {\n return;\n }\n\n if (isThenable(value)) {\n void (value as PromiseLike).then(this._resolve, this._reject);\n return;\n }\n\n this._state = state;\n this._value = value;\n\n this._executeHandlers();\n };\n\n /** JSDoc */\n private readonly _executeHandlers = () => {\n if (this._state === States.PENDING) {\n return;\n }\n\n const cachedHandlers = this._handlers.slice();\n this._handlers = [];\n\n cachedHandlers.forEach(handler => {\n if (handler[0]) {\n return;\n }\n\n if (this._state === States.RESOLVED) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n handler[1](this._value as unknown as any);\n }\n\n if (this._state === States.REJECTED) {\n handler[2](this._value);\n }\n\n handler[0] = true;\n });\n };\n}\n\nexport { SyncPromise };\n","import { GLOBAL_OBJ } from './worldwide';\n\nconst ONE_SECOND_IN_MS = 1000;\n\n/**\n * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}\n * for accessing a high-resolution monotonic clock.\n */\ninterface Performance {\n /**\n * The millisecond timestamp at which measurement began, measured in Unix time.\n */\n timeOrigin: number;\n /**\n * Returns the current millisecond timestamp, where 0 represents the start of measurement.\n */\n now(): number;\n}\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n *\n * TODO(v8): Return type should be rounded.\n */\nexport function dateTimestampInSeconds(): number {\n return Date.now() / ONE_SECOND_IN_MS;\n}\n\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\nfunction createUnixTimestampInSecondsFunc(): () => number {\n const { performance } = GLOBAL_OBJ as typeof GLOBAL_OBJ & { performance?: Performance };\n if (!performance || !performance.now) {\n return dateTimestampInSeconds;\n }\n\n // Some browser and environments don't have a timeOrigin, so we fallback to\n // using Date.now() to compute the starting time.\n const approxStartingTimeOrigin = Date.now() - performance.now();\n const timeOrigin = performance.timeOrigin == undefined ? approxStartingTimeOrigin : performance.timeOrigin;\n\n // performance.now() is a monotonic clock, which means it starts at 0 when the process begins. To get the current\n // wall clock time (actual UNIX timestamp), we need to add the starting time origin and the current time elapsed.\n //\n // TODO: This does not account for the case where the monotonic clock that powers performance.now() drifts from the\n // wall clock time, which causes the returned timestamp to be inaccurate. We should investigate how to detect and\n // correct for this.\n // See: https://github.com/getsentry/sentry-javascript/issues/2590\n // See: https://github.com/mdn/content/issues/4713\n // See: https://dev.to/noamr/when-a-millisecond-is-not-a-millisecond-3h6\n return () => {\n return (timeOrigin + performance.now()) / ONE_SECOND_IN_MS;\n };\n}\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\nexport const timestampInSeconds = createUnixTimestampInSecondsFunc();\n\n/**\n * Re-exported with an old name for backwards-compatibility.\n * TODO (v8): Remove this\n *\n * @deprecated Use `timestampInSeconds` instead.\n */\nexport const timestampWithMs = timestampInSeconds;\n\n/**\n * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.\n */\nexport let _browserPerformanceTimeOriginMode: string;\n\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\nexport const browserPerformanceTimeOrigin = ((): number | undefined => {\n // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n // data as reliable if they are within a reasonable threshold of the current time.\n\n const { performance } = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n if (!performance || !performance.now) {\n _browserPerformanceTimeOriginMode = 'none';\n return undefined;\n }\n\n const threshold = 3600 * 1000;\n const performanceNow = performance.now();\n const dateNow = Date.now();\n\n // if timeOrigin isn't available set delta to threshold so it isn't used\n const timeOriginDelta = performance.timeOrigin\n ? Math.abs(performance.timeOrigin + performanceNow - dateNow)\n : threshold;\n const timeOriginIsReliable = timeOriginDelta < threshold;\n\n // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n // Date API.\n // eslint-disable-next-line deprecation/deprecation\n const navigationStart = performance.timing && performance.timing.navigationStart;\n const hasNavigationStart = typeof navigationStart === 'number';\n // if navigationStart isn't available set delta to threshold so it isn't used\n const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n const navigationStartIsReliable = navigationStartDelta < threshold;\n\n if (timeOriginIsReliable || navigationStartIsReliable) {\n // Use the more reliable time origin\n if (timeOriginDelta <= navigationStartDelta) {\n _browserPerformanceTimeOriginMode = 'timeOrigin';\n return performance.timeOrigin;\n } else {\n _browserPerformanceTimeOriginMode = 'navigationStart';\n return navigationStart;\n }\n }\n\n // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n _browserPerformanceTimeOriginMode = 'dateNow';\n return dateNow;\n})();\n","import type { DynamicSamplingContext, PropagationContext, TraceparentData } from '@sentry/types';\n\nimport { baggageHeaderToDynamicSamplingContext } from './baggage';\nimport { uuid4 } from './misc';\n\n// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor -- RegExp is used for readability here\nexport const TRACEPARENT_REGEXP = new RegExp(\n '^[ \\\\t]*' + // whitespace\n '([0-9a-f]{32})?' + // trace_id\n '-?([0-9a-f]{16})?' + // span_id\n '-?([01])?' + // sampled\n '[ \\\\t]*$', // whitespace\n);\n\n/**\n * Extract transaction context data from a `sentry-trace` header.\n *\n * @param traceparent Traceparent string\n *\n * @returns Object containing data from the header, or undefined if traceparent string is malformed\n */\nexport function extractTraceparentData(traceparent?: string): TraceparentData | undefined {\n if (!traceparent) {\n return undefined;\n }\n\n const matches = traceparent.match(TRACEPARENT_REGEXP);\n if (!matches) {\n return undefined;\n }\n\n let parentSampled: boolean | undefined;\n if (matches[3] === '1') {\n parentSampled = true;\n } else if (matches[3] === '0') {\n parentSampled = false;\n }\n\n return {\n traceId: matches[1],\n parentSampled,\n parentSpanId: matches[2],\n };\n}\n\n/**\n * Create tracing context from incoming headers.\n */\nexport function tracingContextFromHeaders(\n sentryTrace: Parameters[0],\n baggage: Parameters[0],\n): {\n traceparentData: ReturnType;\n dynamicSamplingContext: ReturnType;\n propagationContext: PropagationContext;\n} {\n const traceparentData = extractTraceparentData(sentryTrace);\n const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage);\n\n const { traceId, parentSpanId, parentSampled } = traceparentData || {};\n\n const propagationContext: PropagationContext = {\n traceId: traceId || uuid4(),\n spanId: uuid4().substring(16),\n sampled: parentSampled,\n };\n\n if (parentSpanId) {\n propagationContext.parentSpanId = parentSpanId;\n }\n\n if (dynamicSamplingContext) {\n propagationContext.dsc = dynamicSamplingContext as DynamicSamplingContext;\n }\n\n return {\n traceparentData,\n dynamicSamplingContext,\n propagationContext,\n };\n}\n\n/**\n * Create sentry-trace header from span context values.\n */\nexport function generateSentryTraceHeader(\n traceId: string = uuid4(),\n spanId: string = uuid4().substring(16),\n sampled?: boolean,\n): string {\n let sampledString = '';\n if (sampled !== undefined) {\n sampledString = sampled ? '-1' : '-0';\n }\n return `${traceId}-${spanId}${sampledString}`;\n}\n","/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n *\n * Note: This file was originally called `global.ts`, but was changed to unblock users which might be doing\n * string replaces with bundlers like Vite for `global` (would break imports that rely on importing from utils/src/global).\n *\n * Why worldwide?\n *\n * Why not?\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Integration } from '@sentry/types';\n\nimport type { SdkSource } from './env';\n\n/** Internal global with common properties and Sentry extensions */\nexport interface InternalGlobal {\n navigator?: { userAgent?: string };\n console: Console;\n Sentry?: {\n Integrations?: Integration[];\n };\n onerror?: {\n (event: object | string, source?: string, lineno?: number, colno?: number, error?: Error): any;\n __SENTRY_INSTRUMENTED__?: true;\n __SENTRY_LOADER__?: true;\n };\n onunhandledrejection?: {\n (event: unknown): boolean;\n __SENTRY_INSTRUMENTED__?: true;\n __SENTRY_LOADER__?: true;\n };\n SENTRY_ENVIRONMENT?: string;\n SENTRY_DSN?: string;\n SENTRY_RELEASE?: {\n id?: string;\n };\n SENTRY_SDK_SOURCE?: SdkSource;\n /**\n * Debug IDs are indirectly injected by Sentry CLI or bundler plugins to directly reference a particular source map\n * for resolving of a source file. The injected code will place an entry into the record for each loaded bundle/JS\n * file.\n */\n _sentryDebugIds?: Record;\n __SENTRY__: {\n globalEventProcessors: any;\n hub: any;\n logger: any;\n extensions?: {\n /** Extension methods for the hub, which are bound to the current Hub instance */\n // eslint-disable-next-line @typescript-eslint/ban-types\n [key: string]: Function;\n };\n };\n /**\n * Raw module metadata that is injected by bundler plugins.\n *\n * Keys are `error.stack` strings, values are the metadata.\n */\n _sentryModuleMetadata?: Record;\n}\n\n// The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification\n// https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js\n// core-js has the following licence:\n//\n// Copyright (c) 2014-2022 Denis Pushkarev\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/** Returns 'obj' if it's the global object, otherwise returns undefined */\nfunction isGlobalObj(obj: { Math?: Math }): any | undefined {\n return obj && obj.Math == Math ? obj : undefined;\n}\n\n/** Get's the global object for the current JavaScript runtime */\nexport const GLOBAL_OBJ: InternalGlobal =\n (typeof globalThis == 'object' && isGlobalObj(globalThis)) ||\n // eslint-disable-next-line no-restricted-globals\n (typeof window == 'object' && isGlobalObj(window)) ||\n (typeof self == 'object' && isGlobalObj(self)) ||\n (typeof global == 'object' && isGlobalObj(global)) ||\n (function (this: any) {\n return this;\n })() ||\n {};\n\n/**\n * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8\n */\nexport function getGlobalObject(): T & InternalGlobal {\n return GLOBAL_OBJ as T & InternalGlobal;\n}\n\n/**\n * Returns a global singleton contained in the global `__SENTRY__` object.\n *\n * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory\n * function and added to the `__SENTRY__` object.\n *\n * @param name name of the global singleton on __SENTRY__\n * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`\n * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value\n * @returns the singleton\n */\nexport function getGlobalSingleton(name: keyof InternalGlobal['__SENTRY__'], creator: () => T, obj?: unknown): T {\n const gbl = (obj || GLOBAL_OBJ) as InternalGlobal;\n const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {});\n const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator());\n return singleton;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.cardNumber = void 0;\nvar luhn10 = require(\"./luhn-10\");\nvar getCardTypes = require(\"credit-card-type\");\nfunction verification(card, isPotentiallyValid, isValid) {\n return {\n card: card,\n isPotentiallyValid: isPotentiallyValid,\n isValid: isValid,\n };\n}\nfunction cardNumber(value, options) {\n if (options === void 0) { options = {}; }\n var isPotentiallyValid, isValid, maxLength;\n if (typeof value !== \"string\" && typeof value !== \"number\") {\n return verification(null, false, false);\n }\n var testCardValue = String(value).replace(/-|\\s/g, \"\");\n if (!/^\\d*$/.test(testCardValue)) {\n return verification(null, false, false);\n }\n var potentialTypes = getCardTypes(testCardValue);\n if (potentialTypes.length === 0) {\n return verification(null, false, false);\n }\n else if (potentialTypes.length !== 1) {\n return verification(null, true, false);\n }\n var cardType = potentialTypes[0];\n if (options.maxLength && testCardValue.length > options.maxLength) {\n return verification(cardType, false, false);\n }\n if (options.skipLuhnValidation === true ||\n (cardType.type === getCardTypes.types.UNIONPAY &&\n options.luhnValidateUnionPay !== true)) {\n isValid = true;\n }\n else {\n isValid = luhn10(testCardValue);\n }\n maxLength = Math.max.apply(null, cardType.lengths);\n if (options.maxLength) {\n maxLength = Math.min(options.maxLength, maxLength);\n }\n for (var i = 0; i < cardType.lengths.length; i++) {\n if (cardType.lengths[i] === testCardValue.length) {\n isPotentiallyValid = testCardValue.length < maxLength || isValid;\n return verification(cardType, isPotentiallyValid, isValid);\n }\n }\n return verification(cardType, testCardValue.length < maxLength, false);\n}\nexports.cardNumber = cardNumber;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.cardholderName = void 0;\nvar CARD_NUMBER_REGEX = /^[\\d\\s-]*$/;\nvar MAX_LENGTH = 255;\nfunction verification(isValid, isPotentiallyValid) {\n return { isValid: isValid, isPotentiallyValid: isPotentiallyValid };\n}\nfunction cardholderName(value) {\n if (typeof value !== \"string\") {\n return verification(false, false);\n }\n if (value.length === 0) {\n return verification(false, true);\n }\n if (value.length > MAX_LENGTH) {\n return verification(false, false);\n }\n if (CARD_NUMBER_REGEX.test(value)) {\n return verification(false, true);\n }\n return verification(true, true);\n}\nexports.cardholderName = cardholderName;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.cvv = void 0;\nvar DEFAULT_LENGTH = 3;\nfunction includes(array, thing) {\n for (var i = 0; i < array.length; i++) {\n if (thing === array[i]) {\n return true;\n }\n }\n return false;\n}\nfunction max(array) {\n var maximum = DEFAULT_LENGTH;\n var i = 0;\n for (; i < array.length; i++) {\n maximum = array[i] > maximum ? array[i] : maximum;\n }\n return maximum;\n}\nfunction verification(isValid, isPotentiallyValid) {\n return { isValid: isValid, isPotentiallyValid: isPotentiallyValid };\n}\nfunction cvv(value, maxLength) {\n if (maxLength === void 0) { maxLength = DEFAULT_LENGTH; }\n maxLength = maxLength instanceof Array ? maxLength : [maxLength];\n if (typeof value !== \"string\") {\n return verification(false, false);\n }\n if (!/^\\d*$/.test(value)) {\n return verification(false, false);\n }\n if (includes(maxLength, value.length)) {\n return verification(true, true);\n }\n if (value.length < Math.min.apply(null, maxLength)) {\n return verification(false, true);\n }\n if (value.length > max(maxLength)) {\n return verification(false, false);\n }\n return verification(true, true);\n}\nexports.cvv = cvv;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.expirationDate = void 0;\nvar parse_date_1 = require(\"./lib/parse-date\");\nvar expiration_month_1 = require(\"./expiration-month\");\nvar expiration_year_1 = require(\"./expiration-year\");\nfunction verification(isValid, isPotentiallyValid, month, year) {\n return {\n isValid: isValid,\n isPotentiallyValid: isPotentiallyValid,\n month: month,\n year: year,\n };\n}\nfunction expirationDate(value, maxElapsedYear) {\n var date;\n if (typeof value === \"string\") {\n value = value.replace(/^(\\d\\d) (\\d\\d(\\d\\d)?)$/, \"$1/$2\");\n date = (0, parse_date_1.parseDate)(String(value));\n }\n else if (value !== null && typeof value === \"object\") {\n var fullDate = __assign({}, value);\n date = {\n month: String(fullDate.month),\n year: String(fullDate.year),\n };\n }\n else {\n return verification(false, false, null, null);\n }\n var monthValid = (0, expiration_month_1.expirationMonth)(date.month);\n var yearValid = (0, expiration_year_1.expirationYear)(date.year, maxElapsedYear);\n if (monthValid.isValid) {\n if (yearValid.isCurrentYear) {\n var isValidForThisYear = monthValid.isValidForThisYear;\n return verification(isValidForThisYear, isValidForThisYear, date.month, date.year);\n }\n if (yearValid.isValid) {\n return verification(true, true, date.month, date.year);\n }\n }\n if (monthValid.isPotentiallyValid && yearValid.isPotentiallyValid) {\n return verification(false, true, null, null);\n }\n return verification(false, false, null, null);\n}\nexports.expirationDate = expirationDate;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.expirationMonth = void 0;\nfunction verification(isValid, isPotentiallyValid, isValidForThisYear) {\n return {\n isValid: isValid,\n isPotentiallyValid: isPotentiallyValid,\n isValidForThisYear: isValidForThisYear || false,\n };\n}\nfunction expirationMonth(value) {\n var currentMonth = new Date().getMonth() + 1;\n if (typeof value !== \"string\") {\n return verification(false, false);\n }\n if (value.replace(/\\s/g, \"\") === \"\" || value === \"0\") {\n return verification(false, true);\n }\n if (!/^\\d*$/.test(value)) {\n return verification(false, false);\n }\n var month = parseInt(value, 10);\n if (isNaN(Number(value))) {\n return verification(false, false);\n }\n var result = month > 0 && month < 13;\n return verification(result, result, result && month >= currentMonth);\n}\nexports.expirationMonth = expirationMonth;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.expirationYear = void 0;\nvar DEFAULT_VALID_NUMBER_OF_YEARS_IN_THE_FUTURE = 19;\nfunction verification(isValid, isPotentiallyValid, isCurrentYear) {\n return {\n isValid: isValid,\n isPotentiallyValid: isPotentiallyValid,\n isCurrentYear: isCurrentYear || false,\n };\n}\nfunction expirationYear(value, maxElapsedYear) {\n if (maxElapsedYear === void 0) { maxElapsedYear = DEFAULT_VALID_NUMBER_OF_YEARS_IN_THE_FUTURE; }\n var isCurrentYear;\n if (typeof value !== \"string\") {\n return verification(false, false);\n }\n if (value.replace(/\\s/g, \"\") === \"\") {\n return verification(false, true);\n }\n if (!/^\\d*$/.test(value)) {\n return verification(false, false);\n }\n var len = value.length;\n if (len < 2) {\n return verification(false, true);\n }\n var currentYear = new Date().getFullYear();\n if (len === 3) {\n // 20x === 20x\n var firstTwo = value.slice(0, 2);\n var currentFirstTwo = String(currentYear).slice(0, 2);\n return verification(false, firstTwo === currentFirstTwo);\n }\n if (len > 4) {\n return verification(false, false);\n }\n var numericValue = parseInt(value, 10);\n var twoDigitYear = Number(String(currentYear).substr(2, 2));\n var valid = false;\n if (len === 2) {\n if (String(currentYear).substr(0, 2) === value) {\n return verification(false, true);\n }\n isCurrentYear = twoDigitYear === numericValue;\n valid =\n numericValue >= twoDigitYear &&\n numericValue <= twoDigitYear + maxElapsedYear;\n }\n else if (len === 4) {\n isCurrentYear = currentYear === numericValue;\n valid =\n numericValue >= currentYear &&\n numericValue <= currentYear + maxElapsedYear;\n }\n return verification(valid, valid, isCurrentYear);\n}\nexports.expirationYear = expirationYear;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar creditCardType = __importStar(require(\"credit-card-type\"));\nvar cardholder_name_1 = require(\"./cardholder-name\");\nvar card_number_1 = require(\"./card-number\");\nvar expiration_date_1 = require(\"./expiration-date\");\nvar expiration_month_1 = require(\"./expiration-month\");\nvar expiration_year_1 = require(\"./expiration-year\");\nvar cvv_1 = require(\"./cvv\");\nvar postal_code_1 = require(\"./postal-code\");\nvar cardValidator = {\n creditCardType: creditCardType,\n cardholderName: cardholder_name_1.cardholderName,\n number: card_number_1.cardNumber,\n expirationDate: expiration_date_1.expirationDate,\n expirationMonth: expiration_month_1.expirationMonth,\n expirationYear: expiration_year_1.expirationYear,\n cvv: cvv_1.cvv,\n postalCode: postal_code_1.postalCode,\n};\nmodule.exports = cardValidator;\n","\"use strict\";\n// Polyfill taken from .\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isArray = void 0;\nexports.isArray = Array.isArray ||\n function (arg) {\n return Object.prototype.toString.call(arg) === \"[object Array]\";\n };\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseDate = void 0;\nvar expiration_year_1 = require(\"../expiration-year\");\nvar is_array_1 = require(\"./is-array\");\nfunction getNumberOfMonthDigitsInDateString(dateString) {\n var firstCharacter = Number(dateString[0]);\n var assumedYear;\n /*\n if the first character in the string starts with `0`,\n we know that the month will be 2 digits.\n \n '0122' => {month: '01', year: '22'}\n */\n if (firstCharacter === 0) {\n return 2;\n }\n /*\n if the first character in the string starts with\n number greater than 1, it must be a 1 digit month\n \n '322' => {month: '3', year: '22'}\n */\n if (firstCharacter > 1) {\n return 1;\n }\n /*\n if the first 2 characters make up a number between\n 13-19, we know that the month portion must be 1\n \n '139' => {month: '1', year: '39'}\n */\n if (firstCharacter === 1 && Number(dateString[1]) > 2) {\n return 1;\n }\n /*\n if the first 2 characters make up a number between\n 10-12, we check if the year portion would be considered\n valid if we assumed that the month was 1. If it is\n not potentially valid, we assume the month must have\n 2 digits.\n \n '109' => {month: '10', year: '9'}\n '120' => {month: '1', year: '20'} // when checked in the year 2019\n '120' => {month: '12', year: '0'} // when checked in the year 2021\n */\n if (firstCharacter === 1) {\n assumedYear = dateString.substr(1);\n return (0, expiration_year_1.expirationYear)(assumedYear).isPotentiallyValid ? 1 : 2;\n }\n /*\n If the length of the value is exactly 5 characters,\n we assume a full year was passed in, meaning the remaining\n single leading digit must be the month value.\n \n '12202' => {month: '1', year: '2202'}\n */\n if (dateString.length === 5) {\n return 1;\n }\n /*\n If the length of the value is more than five characters,\n we assume a full year was passed in addition to the month\n and therefore the month portion must be 2 digits.\n \n '112020' => {month: '11', year: '2020'}\n */\n if (dateString.length > 5) {\n return 2;\n }\n /*\n By default, the month value is the first value\n */\n return 1;\n}\nfunction parseDate(datestring) {\n var date;\n if (/^\\d{4}-\\d{1,2}$/.test(datestring)) {\n date = datestring.split(\"-\").reverse();\n }\n else if (/\\//.test(datestring)) {\n date = datestring.split(/\\s*\\/\\s*/g);\n }\n else if (/\\s/.test(datestring)) {\n date = datestring.split(/ +/g);\n }\n if ((0, is_array_1.isArray)(date)) {\n return {\n month: date[0] || \"\",\n year: date.slice(1).join(),\n };\n }\n var numberOfDigitsInMonth = getNumberOfMonthDigitsInDateString(datestring);\n var month = datestring.substr(0, numberOfDigitsInMonth);\n return {\n month: month,\n year: datestring.substr(month.length),\n };\n}\nexports.parseDate = parseDate;\n","/* eslint-disable */\n/*\n * Luhn algorithm implementation in JavaScript\n * Copyright (c) 2009 Nicholas C. Zakas\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\"use strict\";\nfunction luhn10(identifier) {\n var sum = 0;\n var alt = false;\n var i = identifier.length - 1;\n var num;\n while (i >= 0) {\n num = parseInt(identifier.charAt(i), 10);\n if (alt) {\n num *= 2;\n if (num > 9) {\n num = (num % 10) + 1; // eslint-disable-line no-extra-parens\n }\n }\n alt = !alt;\n sum += num;\n i--;\n }\n return sum % 10 === 0;\n}\nmodule.exports = luhn10;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.postalCode = void 0;\nvar DEFAULT_MIN_POSTAL_CODE_LENGTH = 3;\nvar ALPHANUM = new RegExp(/^[a-z0-9]+$/i);\nfunction verification(isValid, isPotentiallyValid) {\n return { isValid: isValid, isPotentiallyValid: isPotentiallyValid };\n}\nfunction postalCode(value, options) {\n if (options === void 0) { options = {}; }\n var minLength = options.minLength || DEFAULT_MIN_POSTAL_CODE_LENGTH;\n if (typeof value !== \"string\") {\n return verification(false, false);\n }\n else if (value.length < minLength) {\n return verification(false, true);\n }\n else if (!ALPHANUM.test(value.trim().slice(0, minLength))) {\n return verification(false, true);\n }\n return verification(true, true);\n}\nexports.postalCode = postalCode;\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar cardTypes = require(\"./lib/card-types\");\nvar add_matching_cards_to_results_1 = require(\"./lib/add-matching-cards-to-results\");\nvar is_valid_input_type_1 = require(\"./lib/is-valid-input-type\");\nvar find_best_match_1 = require(\"./lib/find-best-match\");\nvar clone_1 = require(\"./lib/clone\");\nvar customCards = {};\nvar cardNames = {\n VISA: \"visa\",\n MASTERCARD: \"mastercard\",\n AMERICAN_EXPRESS: \"american-express\",\n DINERS_CLUB: \"diners-club\",\n DISCOVER: \"discover\",\n JCB: \"jcb\",\n UNIONPAY: \"unionpay\",\n MAESTRO: \"maestro\",\n ELO: \"elo\",\n MIR: \"mir\",\n HIPER: \"hiper\",\n HIPERCARD: \"hipercard\",\n};\nvar ORIGINAL_TEST_ORDER = [\n cardNames.VISA,\n cardNames.MASTERCARD,\n cardNames.AMERICAN_EXPRESS,\n cardNames.DINERS_CLUB,\n cardNames.DISCOVER,\n cardNames.JCB,\n cardNames.UNIONPAY,\n cardNames.MAESTRO,\n cardNames.ELO,\n cardNames.MIR,\n cardNames.HIPER,\n cardNames.HIPERCARD,\n];\nvar testOrder = (0, clone_1.clone)(ORIGINAL_TEST_ORDER);\nfunction findType(cardType) {\n return customCards[cardType] || cardTypes[cardType];\n}\nfunction getAllCardTypes() {\n return testOrder.map(function (cardType) { return (0, clone_1.clone)(findType(cardType)); });\n}\nfunction getCardPosition(name, ignoreErrorForNotExisting) {\n if (ignoreErrorForNotExisting === void 0) { ignoreErrorForNotExisting = false; }\n var position = testOrder.indexOf(name);\n if (!ignoreErrorForNotExisting && position === -1) {\n throw new Error('\"' + name + '\" is not a supported card type.');\n }\n return position;\n}\nfunction creditCardType(cardNumber) {\n var results = [];\n if (!(0, is_valid_input_type_1.isValidInputType)(cardNumber)) {\n return results;\n }\n if (cardNumber.length === 0) {\n return getAllCardTypes();\n }\n testOrder.forEach(function (cardType) {\n var cardConfiguration = findType(cardType);\n (0, add_matching_cards_to_results_1.addMatchingCardsToResults)(cardNumber, cardConfiguration, results);\n });\n var bestMatch = (0, find_best_match_1.findBestMatch)(results);\n if (bestMatch) {\n return [bestMatch];\n }\n return results;\n}\ncreditCardType.getTypeInfo = function (cardType) {\n return (0, clone_1.clone)(findType(cardType));\n};\ncreditCardType.removeCard = function (name) {\n var position = getCardPosition(name);\n testOrder.splice(position, 1);\n};\ncreditCardType.addCard = function (config) {\n var existingCardPosition = getCardPosition(config.type, true);\n customCards[config.type] = config;\n if (existingCardPosition === -1) {\n testOrder.push(config.type);\n }\n};\ncreditCardType.updateCard = function (cardType, updates) {\n var originalObject = customCards[cardType] || cardTypes[cardType];\n if (!originalObject) {\n throw new Error(\"\\\"\".concat(cardType, \"\\\" is not a recognized type. Use `addCard` instead.'\"));\n }\n if (updates.type && originalObject.type !== updates.type) {\n throw new Error(\"Cannot overwrite type parameter.\");\n }\n var clonedCard = (0, clone_1.clone)(originalObject);\n clonedCard = __assign(__assign({}, clonedCard), updates);\n customCards[clonedCard.type] = clonedCard;\n};\ncreditCardType.changeOrder = function (name, position) {\n var currentPosition = getCardPosition(name);\n testOrder.splice(currentPosition, 1);\n testOrder.splice(position, 0, name);\n};\ncreditCardType.resetModifications = function () {\n testOrder = (0, clone_1.clone)(ORIGINAL_TEST_ORDER);\n customCards = {};\n};\ncreditCardType.types = cardNames;\nmodule.exports = creditCardType;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addMatchingCardsToResults = void 0;\nvar clone_1 = require(\"./clone\");\nvar matches_1 = require(\"./matches\");\nfunction addMatchingCardsToResults(cardNumber, cardConfiguration, results) {\n var i, patternLength;\n for (i = 0; i < cardConfiguration.patterns.length; i++) {\n var pattern = cardConfiguration.patterns[i];\n if (!(0, matches_1.matches)(cardNumber, pattern)) {\n continue;\n }\n var clonedCardConfiguration = (0, clone_1.clone)(cardConfiguration);\n if (Array.isArray(pattern)) {\n patternLength = String(pattern[0]).length;\n }\n else {\n patternLength = String(pattern).length;\n }\n if (cardNumber.length >= patternLength) {\n clonedCardConfiguration.matchStrength = patternLength;\n }\n results.push(clonedCardConfiguration);\n break;\n }\n}\nexports.addMatchingCardsToResults = addMatchingCardsToResults;\n","\"use strict\";\nvar cardTypes = {\n visa: {\n niceType: \"Visa\",\n type: \"visa\",\n patterns: [4],\n gaps: [4, 8, 12],\n lengths: [16, 18, 19],\n code: {\n name: \"CVV\",\n size: 3,\n },\n },\n mastercard: {\n niceType: \"Mastercard\",\n type: \"mastercard\",\n patterns: [[51, 55], [2221, 2229], [223, 229], [23, 26], [270, 271], 2720],\n gaps: [4, 8, 12],\n lengths: [16],\n code: {\n name: \"CVC\",\n size: 3,\n },\n },\n \"american-express\": {\n niceType: \"American Express\",\n type: \"american-express\",\n patterns: [34, 37],\n gaps: [4, 10],\n lengths: [15],\n code: {\n name: \"CID\",\n size: 4,\n },\n },\n \"diners-club\": {\n niceType: \"Diners Club\",\n type: \"diners-club\",\n patterns: [[300, 305], 36, 38, 39],\n gaps: [4, 10],\n lengths: [14, 16, 19],\n code: {\n name: \"CVV\",\n size: 3,\n },\n },\n discover: {\n niceType: \"Discover\",\n type: \"discover\",\n patterns: [6011, [644, 649], 65],\n gaps: [4, 8, 12],\n lengths: [16, 19],\n code: {\n name: \"CID\",\n size: 3,\n },\n },\n jcb: {\n niceType: \"JCB\",\n type: \"jcb\",\n patterns: [2131, 1800, [3528, 3589]],\n gaps: [4, 8, 12],\n lengths: [16, 17, 18, 19],\n code: {\n name: \"CVV\",\n size: 3,\n },\n },\n unionpay: {\n niceType: \"UnionPay\",\n type: \"unionpay\",\n patterns: [\n 620,\n [62100, 62182],\n [62184, 62187],\n [62185, 62197],\n [62200, 62205],\n [622010, 622999],\n 622018,\n [62207, 62209],\n [623, 626],\n 6270,\n 6272,\n 6276,\n [627700, 627779],\n [627781, 627799],\n [6282, 6289],\n 6291,\n 6292,\n 810,\n [8110, 8131],\n [8132, 8151],\n [8152, 8163],\n [8164, 8171],\n ],\n gaps: [4, 8, 12],\n lengths: [14, 15, 16, 17, 18, 19],\n code: {\n name: \"CVN\",\n size: 3,\n },\n },\n maestro: {\n niceType: \"Maestro\",\n type: \"maestro\",\n patterns: [\n 493698,\n [500000, 504174],\n [504176, 506698],\n [506779, 508999],\n [56, 59],\n 63,\n 67,\n 6,\n ],\n gaps: [4, 8, 12],\n lengths: [12, 13, 14, 15, 16, 17, 18, 19],\n code: {\n name: \"CVC\",\n size: 3,\n },\n },\n elo: {\n niceType: \"Elo\",\n type: \"elo\",\n patterns: [\n 401178,\n 401179,\n 438935,\n 457631,\n 457632,\n 431274,\n 451416,\n 457393,\n 504175,\n [506699, 506778],\n [509000, 509999],\n 627780,\n 636297,\n 636368,\n [650031, 650033],\n [650035, 650051],\n [650405, 650439],\n [650485, 650538],\n [650541, 650598],\n [650700, 650718],\n [650720, 650727],\n [650901, 650978],\n [651652, 651679],\n [655000, 655019],\n [655021, 655058],\n ],\n gaps: [4, 8, 12],\n lengths: [16],\n code: {\n name: \"CVE\",\n size: 3,\n },\n },\n mir: {\n niceType: \"Mir\",\n type: \"mir\",\n patterns: [[2200, 2204]],\n gaps: [4, 8, 12],\n lengths: [16, 17, 18, 19],\n code: {\n name: \"CVP2\",\n size: 3,\n },\n },\n hiper: {\n niceType: \"Hiper\",\n type: \"hiper\",\n patterns: [637095, 63737423, 63743358, 637568, 637599, 637609, 637612],\n gaps: [4, 8, 12],\n lengths: [16],\n code: {\n name: \"CVC\",\n size: 3,\n },\n },\n hipercard: {\n niceType: \"Hipercard\",\n type: \"hipercard\",\n patterns: [606282],\n gaps: [4, 8, 12],\n lengths: [16],\n code: {\n name: \"CVC\",\n size: 3,\n },\n },\n};\nmodule.exports = cardTypes;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.clone = void 0;\nfunction clone(originalObject) {\n if (!originalObject) {\n return null;\n }\n return JSON.parse(JSON.stringify(originalObject));\n}\nexports.clone = clone;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.findBestMatch = void 0;\nfunction hasEnoughResultsToDetermineBestMatch(results) {\n var numberOfResultsWithMaxStrengthProperty = results.filter(function (result) { return result.matchStrength; }).length;\n /*\n * if all possible results have a maxStrength property that means the card\n * number is sufficiently long enough to determine conclusively what the card\n * type is\n * */\n return (numberOfResultsWithMaxStrengthProperty > 0 &&\n numberOfResultsWithMaxStrengthProperty === results.length);\n}\nfunction findBestMatch(results) {\n if (!hasEnoughResultsToDetermineBestMatch(results)) {\n return null;\n }\n return results.reduce(function (bestMatch, result) {\n if (!bestMatch) {\n return result;\n }\n /*\n * If the current best match pattern is less specific than this result, set\n * the result as the new best match\n * */\n if (Number(bestMatch.matchStrength) < Number(result.matchStrength)) {\n return result;\n }\n return bestMatch;\n });\n}\nexports.findBestMatch = findBestMatch;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isValidInputType = void 0;\nfunction isValidInputType(cardNumber) {\n return typeof cardNumber === \"string\" || cardNumber instanceof String;\n}\nexports.isValidInputType = isValidInputType;\n","\"use strict\";\n/*\n * Adapted from https://github.com/polvo-labs/card-type/blob/aaab11f80fa1939bccc8f24905a06ae3cd864356/src/cardType.js#L37-L42\n * */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.matches = void 0;\nfunction matchesRange(cardNumber, min, max) {\n var maxLengthToCheck = String(min).length;\n var substr = cardNumber.substr(0, maxLengthToCheck);\n var integerRepresentationOfCardNumber = parseInt(substr, 10);\n min = parseInt(String(min).substr(0, substr.length), 10);\n max = parseInt(String(max).substr(0, substr.length), 10);\n return (integerRepresentationOfCardNumber >= min &&\n integerRepresentationOfCardNumber <= max);\n}\nfunction matchesPattern(cardNumber, pattern) {\n pattern = String(pattern);\n return (pattern.substring(0, cardNumber.length) ===\n cardNumber.substring(0, pattern.length));\n}\nfunction matches(cardNumber, pattern) {\n if (Array.isArray(pattern)) {\n return matchesRange(cardNumber, pattern[0], pattern[1]);\n }\n return matchesPattern(cardNumber, pattern);\n}\nexports.matches = matches;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = addLeadingZeros;\n\nfunction addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n\n while (output.length < targetLength) {\n output = '0' + output;\n }\n\n return sign + output;\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = assign;\n\nfunction assign(target, object) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n for (var property in object) {\n if (Object.prototype.hasOwnProperty.call(object, property)) {\n ;\n target[property] = object[property];\n }\n }\n\n return target;\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = cloneObject;\n\nvar _index = _interopRequireDefault(require(\"../assign/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction cloneObject(object) {\n return (0, _index.default)({}, object);\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _index = _interopRequireDefault(require(\"../../locale/en-US/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _default = _index.default;\nexports.default = _default;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getDefaultOptions = getDefaultOptions;\nexports.setDefaultOptions = setDefaultOptions;\nvar defaultOptions = {};\n\nfunction getDefaultOptions() {\n return defaultOptions;\n}\n\nfunction setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _index = _interopRequireDefault(require(\"../../../_lib/getUTCDayOfYear/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../../../_lib/getUTCISOWeek/index.js\"));\n\nvar _index3 = _interopRequireDefault(require(\"../../../_lib/getUTCISOWeekYear/index.js\"));\n\nvar _index4 = _interopRequireDefault(require(\"../../../_lib/getUTCWeek/index.js\"));\n\nvar _index5 = _interopRequireDefault(require(\"../../../_lib/getUTCWeekYear/index.js\"));\n\nvar _index6 = _interopRequireDefault(require(\"../../addLeadingZeros/index.js\"));\n\nvar _index7 = _interopRequireDefault(require(\"../lightFormatters/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar dayPeriodEnum = {\n am: 'am',\n pm: 'pm',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\nvar formatters = {\n // Era\n G: function G(date, token, localize) {\n var era = date.getUTCFullYear() > 0 ? 1 : 0;\n\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return localize.era(era, {\n width: 'abbreviated'\n });\n // A, B\n\n case 'GGGGG':\n return localize.era(era, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return localize.era(era, {\n width: 'wide'\n });\n }\n },\n // Year\n y: function y(date, token, localize) {\n // Ordinal number\n if (token === 'yo') {\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, {\n unit: 'year'\n });\n }\n\n return _index7.default.y(date, token);\n },\n // Local week-numbering year\n Y: function Y(date, token, localize, options) {\n var signedWeekYear = (0, _index5.default)(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year\n\n if (token === 'YY') {\n var twoDigitYear = weekYear % 100;\n return (0, _index6.default)(twoDigitYear, 2);\n } // Ordinal number\n\n\n if (token === 'Yo') {\n return localize.ordinalNumber(weekYear, {\n unit: 'year'\n });\n } // Padding\n\n\n return (0, _index6.default)(weekYear, token.length);\n },\n // ISO week-numbering year\n R: function R(date, token) {\n var isoWeekYear = (0, _index3.default)(date); // Padding\n\n return (0, _index6.default)(isoWeekYear, token.length);\n },\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function u(date, token) {\n var year = date.getUTCFullYear();\n return (0, _index6.default)(year, token.length);\n },\n // Quarter\n Q: function Q(date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'QQ':\n return (0, _index6.default)(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone quarter\n q: function q(date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'qq':\n return (0, _index6.default)(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Month\n M: function M(date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n case 'M':\n case 'MM':\n return _index7.default.M(date, token);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return localize.month(month, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone month\n L: function L(date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return String(month + 1);\n // 01, 02, ..., 12\n\n case 'LL':\n return (0, _index6.default)(month + 1, 2);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return localize.month(month, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Local week of year\n w: function w(date, token, localize, options) {\n var week = (0, _index4.default)(date, options);\n\n if (token === 'wo') {\n return localize.ordinalNumber(week, {\n unit: 'week'\n });\n }\n\n return (0, _index6.default)(week, token.length);\n },\n // ISO week of year\n I: function I(date, token, localize) {\n var isoWeek = (0, _index2.default)(date);\n\n if (token === 'Io') {\n return localize.ordinalNumber(isoWeek, {\n unit: 'week'\n });\n }\n\n return (0, _index6.default)(isoWeek, token.length);\n },\n // Day of the month\n d: function d(date, token, localize) {\n if (token === 'do') {\n return localize.ordinalNumber(date.getUTCDate(), {\n unit: 'date'\n });\n }\n\n return _index7.default.d(date, token);\n },\n // Day of year\n D: function D(date, token, localize) {\n var dayOfYear = (0, _index.default)(date);\n\n if (token === 'Do') {\n return localize.ordinalNumber(dayOfYear, {\n unit: 'dayOfYear'\n });\n }\n\n return (0, _index6.default)(dayOfYear, token.length);\n },\n // Day of week\n E: function E(date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Local day of week\n e: function e(date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case 'e':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'ee':\n return (0, _index6.default)(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n\n case 'eo':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'eee':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone local day of week\n c: function c(date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (same as in `e`)\n case 'c':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'cc':\n return (0, _index6.default)(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n\n case 'co':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'ccc':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // ISO day of week\n i: function i(date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n\n switch (token) {\n // 2\n case 'i':\n return String(isoDayOfWeek);\n // 02\n\n case 'ii':\n return (0, _index6.default)(isoDayOfWeek, token.length);\n // 2nd\n\n case 'io':\n return localize.ordinalNumber(isoDayOfWeek, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'iiiii':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'iiiiii':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'iiii':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM or PM\n a: function a(date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'aaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'aaaaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM, PM, midnight, noon\n b: function b(date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n }\n\n switch (token) {\n case 'b':\n case 'bb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'bbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'bbbbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // in the morning, in the afternoon, in the evening, at night\n B: function B(date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Hour [1-12]\n h: function h(date, token, localize) {\n if (token === 'ho') {\n var hours = date.getUTCHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return _index7.default.h(date, token);\n },\n // Hour [0-23]\n H: function H(date, token, localize) {\n if (token === 'Ho') {\n return localize.ordinalNumber(date.getUTCHours(), {\n unit: 'hour'\n });\n }\n\n return _index7.default.H(date, token);\n },\n // Hour [0-11]\n K: function K(date, token, localize) {\n var hours = date.getUTCHours() % 12;\n\n if (token === 'Ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return (0, _index6.default)(hours, token.length);\n },\n // Hour [1-24]\n k: function k(date, token, localize) {\n var hours = date.getUTCHours();\n if (hours === 0) hours = 24;\n\n if (token === 'ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return (0, _index6.default)(hours, token.length);\n },\n // Minute\n m: function m(date, token, localize) {\n if (token === 'mo') {\n return localize.ordinalNumber(date.getUTCMinutes(), {\n unit: 'minute'\n });\n }\n\n return _index7.default.m(date, token);\n },\n // Second\n s: function s(date, token, localize) {\n if (token === 'so') {\n return localize.ordinalNumber(date.getUTCSeconds(), {\n unit: 'second'\n });\n }\n\n return _index7.default.s(date, token);\n },\n // Fraction of second\n S: function S(date, token) {\n return _index7.default.S(date, token);\n },\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function X(date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return 'Z';\n }\n\n switch (token) {\n // Hours and optional minutes\n case 'X':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n\n case 'XXXX':\n case 'XX':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function x(date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n\n case 'xxxx':\n case 'xx':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (GMT)\n O: function O(date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'O':\n case 'OO':\n case 'OOO':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (specific non-location)\n z: function z(date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'z':\n case 'zz':\n case 'zzz':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'zzzz':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Seconds timestamp\n t: function t(date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = Math.floor(originalDate.getTime() / 1000);\n return (0, _index6.default)(timestamp, token.length);\n },\n // Milliseconds timestamp\n T: function T(date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = originalDate.getTime();\n return (0, _index6.default)(timestamp, token.length);\n }\n};\n\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = Math.floor(absOffset / 60);\n var minutes = absOffset % 60;\n\n if (minutes === 0) {\n return sign + String(hours);\n }\n\n var delimiter = dirtyDelimiter || '';\n return sign + String(hours) + delimiter + (0, _index6.default)(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {\n if (offset % 60 === 0) {\n var sign = offset > 0 ? '-' : '+';\n return sign + (0, _index6.default)(Math.abs(offset) / 60, 2);\n }\n\n return formatTimezone(offset, dirtyDelimiter);\n}\n\nfunction formatTimezone(offset, dirtyDelimiter) {\n var delimiter = dirtyDelimiter || '';\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = (0, _index6.default)(Math.floor(absOffset / 60), 2);\n var minutes = (0, _index6.default)(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n\nvar _default = formatters;\nexports.default = _default;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _index = _interopRequireDefault(require(\"../../addLeadingZeros/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\nvar formatters = {\n // Year\n y: function y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return (0, _index.default)(token === 'yy' ? year % 100 : year, token.length);\n },\n // Month\n M: function M(date, token) {\n var month = date.getUTCMonth();\n return token === 'M' ? String(month + 1) : (0, _index.default)(month + 1, 2);\n },\n // Day of the month\n d: function d(date, token) {\n return (0, _index.default)(date.getUTCDate(), token.length);\n },\n // AM or PM\n a: function a(date, token) {\n var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return dayPeriodEnumValue.toUpperCase();\n\n case 'aaa':\n return dayPeriodEnumValue;\n\n case 'aaaaa':\n return dayPeriodEnumValue[0];\n\n case 'aaaa':\n default:\n return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';\n }\n },\n // Hour [1-12]\n h: function h(date, token) {\n return (0, _index.default)(date.getUTCHours() % 12 || 12, token.length);\n },\n // Hour [0-23]\n H: function H(date, token) {\n return (0, _index.default)(date.getUTCHours(), token.length);\n },\n // Minute\n m: function m(date, token) {\n return (0, _index.default)(date.getUTCMinutes(), token.length);\n },\n // Second\n s: function s(date, token) {\n return (0, _index.default)(date.getUTCSeconds(), token.length);\n },\n // Fraction of second\n S: function S(date, token) {\n var numberOfDigits = token.length;\n var milliseconds = date.getUTCMilliseconds();\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));\n return (0, _index.default)(fractionalSeconds, token.length);\n }\n};\nvar _default = formatters;\nexports.default = _default;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar dateLongFormatter = function dateLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'P':\n return formatLong.date({\n width: 'short'\n });\n\n case 'PP':\n return formatLong.date({\n width: 'medium'\n });\n\n case 'PPP':\n return formatLong.date({\n width: 'long'\n });\n\n case 'PPPP':\n default:\n return formatLong.date({\n width: 'full'\n });\n }\n};\n\nvar timeLongFormatter = function timeLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'p':\n return formatLong.time({\n width: 'short'\n });\n\n case 'pp':\n return formatLong.time({\n width: 'medium'\n });\n\n case 'ppp':\n return formatLong.time({\n width: 'long'\n });\n\n case 'pppp':\n default:\n return formatLong.time({\n width: 'full'\n });\n }\n};\n\nvar dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {\n var matchResult = pattern.match(/(P+)(p+)?/) || [];\n var datePattern = matchResult[1];\n var timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n var dateTimeFormat;\n\n switch (datePattern) {\n case 'P':\n dateTimeFormat = formatLong.dateTime({\n width: 'short'\n });\n break;\n\n case 'PP':\n dateTimeFormat = formatLong.dateTime({\n width: 'medium'\n });\n break;\n\n case 'PPP':\n dateTimeFormat = formatLong.dateTime({\n width: 'long'\n });\n break;\n\n case 'PPPP':\n default:\n dateTimeFormat = formatLong.dateTime({\n width: 'full'\n });\n break;\n }\n\n return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));\n};\n\nvar longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter\n};\nvar _default = longFormatters;\nexports.default = _default;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getTimezoneOffsetInMilliseconds;\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nfunction getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getUTCDayOfYear;\n\nvar _index = _interopRequireDefault(require(\"../../toDate/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../requiredArgs/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar MILLISECONDS_IN_DAY = 86400000;\n\nfunction getUTCDayOfYear(dirtyDate) {\n (0, _index2.default)(1, arguments);\n var date = (0, _index.default)(dirtyDate);\n var timestamp = date.getTime();\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n var startOfYearTimestamp = date.getTime();\n var difference = timestamp - startOfYearTimestamp;\n return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getUTCISOWeek;\n\nvar _index = _interopRequireDefault(require(\"../../toDate/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../startOfUTCISOWeek/index.js\"));\n\nvar _index3 = _interopRequireDefault(require(\"../startOfUTCISOWeekYear/index.js\"));\n\nvar _index4 = _interopRequireDefault(require(\"../requiredArgs/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar MILLISECONDS_IN_WEEK = 604800000;\n\nfunction getUTCISOWeek(dirtyDate) {\n (0, _index4.default)(1, arguments);\n var date = (0, _index.default)(dirtyDate);\n var diff = (0, _index2.default)(date).getTime() - (0, _index3.default)(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getUTCISOWeekYear;\n\nvar _index = _interopRequireDefault(require(\"../../toDate/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../requiredArgs/index.js\"));\n\nvar _index3 = _interopRequireDefault(require(\"../startOfUTCISOWeek/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getUTCISOWeekYear(dirtyDate) {\n (0, _index2.default)(1, arguments);\n var date = (0, _index.default)(dirtyDate);\n var year = date.getUTCFullYear();\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = (0, _index3.default)(fourthOfJanuaryOfNextYear);\n var fourthOfJanuaryOfThisYear = new Date(0);\n fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = (0, _index3.default)(fourthOfJanuaryOfThisYear);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getUTCWeek;\n\nvar _index = _interopRequireDefault(require(\"../../toDate/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../startOfUTCWeek/index.js\"));\n\nvar _index3 = _interopRequireDefault(require(\"../startOfUTCWeekYear/index.js\"));\n\nvar _index4 = _interopRequireDefault(require(\"../requiredArgs/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar MILLISECONDS_IN_WEEK = 604800000;\n\nfunction getUTCWeek(dirtyDate, options) {\n (0, _index4.default)(1, arguments);\n var date = (0, _index.default)(dirtyDate);\n var diff = (0, _index2.default)(date, options).getTime() - (0, _index3.default)(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getUTCWeekYear;\n\nvar _index = _interopRequireDefault(require(\"../../toDate/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../requiredArgs/index.js\"));\n\nvar _index3 = _interopRequireDefault(require(\"../startOfUTCWeek/index.js\"));\n\nvar _index4 = _interopRequireDefault(require(\"../toInteger/index.js\"));\n\nvar _index5 = require(\"../defaultOptions/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getUTCWeekYear(dirtyDate, options) {\n var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;\n\n (0, _index2.default)(1, arguments);\n var date = (0, _index.default)(dirtyDate);\n var year = date.getUTCFullYear();\n var defaultOptions = (0, _index5.getDefaultOptions)();\n var firstWeekContainsDate = (0, _index4.default)((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var firstWeekOfNextYear = new Date(0);\n firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = (0, _index3.default)(firstWeekOfNextYear, options);\n var firstWeekOfThisYear = new Date(0);\n firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = (0, _index3.default)(firstWeekOfThisYear, options);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isProtectedDayOfYearToken = isProtectedDayOfYearToken;\nexports.isProtectedWeekYearToken = isProtectedWeekYearToken;\nexports.throwProtectedError = throwProtectedError;\nvar protectedDayOfYearTokens = ['D', 'DD'];\nvar protectedWeekYearTokens = ['YY', 'YYYY'];\n\nfunction isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\n\nfunction isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\n\nfunction throwProtectedError(token, format, input) {\n if (token === 'YYYY') {\n throw new RangeError(\"Use `yyyy` instead of `YYYY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\"));\n } else if (token === 'YY') {\n throw new RangeError(\"Use `yy` instead of `YY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\"));\n } else if (token === 'D') {\n throw new RangeError(\"Use `d` instead of `D` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\"));\n } else if (token === 'DD') {\n throw new RangeError(\"Use `dd` instead of `DD` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\"));\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = requiredArgs;\n\nfunction requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = startOfUTCISOWeek;\n\nvar _index = _interopRequireDefault(require(\"../../toDate/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../requiredArgs/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction startOfUTCISOWeek(dirtyDate) {\n (0, _index2.default)(1, arguments);\n var weekStartsOn = 1;\n var date = (0, _index.default)(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = startOfUTCISOWeekYear;\n\nvar _index = _interopRequireDefault(require(\"../getUTCISOWeekYear/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../startOfUTCISOWeek/index.js\"));\n\nvar _index3 = _interopRequireDefault(require(\"../requiredArgs/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction startOfUTCISOWeekYear(dirtyDate) {\n (0, _index3.default)(1, arguments);\n var year = (0, _index.default)(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setUTCFullYear(year, 0, 4);\n fourthOfJanuary.setUTCHours(0, 0, 0, 0);\n var date = (0, _index2.default)(fourthOfJanuary);\n return date;\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = startOfUTCWeek;\n\nvar _index = _interopRequireDefault(require(\"../../toDate/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../requiredArgs/index.js\"));\n\nvar _index3 = _interopRequireDefault(require(\"../toInteger/index.js\"));\n\nvar _index4 = require(\"../defaultOptions/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction startOfUTCWeek(dirtyDate, options) {\n var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;\n\n (0, _index2.default)(1, arguments);\n var defaultOptions = (0, _index4.getDefaultOptions)();\n var weekStartsOn = (0, _index3.default)((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = (0, _index.default)(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = startOfUTCWeekYear;\n\nvar _index = _interopRequireDefault(require(\"../getUTCWeekYear/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../requiredArgs/index.js\"));\n\nvar _index3 = _interopRequireDefault(require(\"../startOfUTCWeek/index.js\"));\n\nvar _index4 = _interopRequireDefault(require(\"../toInteger/index.js\"));\n\nvar _index5 = require(\"../defaultOptions/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction startOfUTCWeekYear(dirtyDate, options) {\n var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;\n\n (0, _index2.default)(1, arguments);\n var defaultOptions = (0, _index5.getDefaultOptions)();\n var firstWeekContainsDate = (0, _index4.default)((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);\n var year = (0, _index.default)(dirtyDate, options);\n var firstWeek = new Date(0);\n firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setUTCHours(0, 0, 0, 0);\n var date = (0, _index3.default)(firstWeek, options);\n return date;\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = toInteger;\n\nfunction toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n\n var number = Number(dirtyNumber);\n\n if (isNaN(number)) {\n return number;\n }\n\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = addMilliseconds;\n\nvar _index = _interopRequireDefault(require(\"../_lib/toInteger/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../toDate/index.js\"));\n\nvar _index3 = _interopRequireDefault(require(\"../_lib/requiredArgs/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\nfunction addMilliseconds(dirtyDate, dirtyAmount) {\n (0, _index3.default)(2, arguments);\n var timestamp = (0, _index2.default)(dirtyDate).getTime();\n var amount = (0, _index.default)(dirtyAmount);\n return new Date(timestamp + amount);\n}\n\nmodule.exports = exports.default;","var defaultOptions = {};\nexport function getDefaultOptions() {\n return defaultOptions;\n}\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","export default function toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n\n var number = Number(dirtyNumber);\n\n if (isNaN(number)) {\n return number;\n }\n\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} - the new date with the days added\n * @throws {TypeError} - 2 arguments required\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\n\nexport default function addDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n\n date.setDate(date.getDate() + amount);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\n\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var timestamp = toDate(dirtyDate).getTime();\n var amount = toInteger(dirtyAmount);\n return new Date(timestamp + amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_MINUTE = 60000;\n/**\n * @name addMinutes\n * @category Minute Helpers\n * @summary Add the specified number of minutes to the given date.\n *\n * @description\n * Add the specified number of minutes to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the minutes added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 30 minutes to 10 July 2014 12:00:00:\n * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 12:30:00\n */\n\nexport default function addMinutes(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE);\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nexport default function startOfUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nexport default function getUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getUTCFullYear();\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);\n var fourthOfJanuaryOfThisYear = new Date(0);\n fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nimport toInteger from \"../toInteger/index.js\";\nimport { getDefaultOptions } from \"../defaultOptions/index.js\";\nexport default function startOfUTCWeek(dirtyDate, options) {\n var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;\n\n requiredArgs(1, arguments);\n var defaultOptions = getDefaultOptions();\n var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport toInteger from \"../toInteger/index.js\";\nimport { getDefaultOptions } from \"../defaultOptions/index.js\";\nexport default function getUTCWeekYear(dirtyDate, options) {\n var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;\n\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getUTCFullYear();\n var defaultOptions = getDefaultOptions();\n var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var firstWeekOfNextYear = new Date(0);\n firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);\n var firstWeekOfThisYear = new Date(0);\n firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n\n while (output.length < targetLength) {\n output = '0' + output;\n }\n\n return sign + output;\n}","import addLeadingZeros from \"../../addLeadingZeros/index.js\";\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nvar formatters = {\n // Year\n y: function y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);\n },\n // Month\n M: function M(date, token) {\n var month = date.getUTCMonth();\n return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n // Day of the month\n d: function d(date, token) {\n return addLeadingZeros(date.getUTCDate(), token.length);\n },\n // AM or PM\n a: function a(date, token) {\n var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return dayPeriodEnumValue.toUpperCase();\n\n case 'aaa':\n return dayPeriodEnumValue;\n\n case 'aaaaa':\n return dayPeriodEnumValue[0];\n\n case 'aaaa':\n default:\n return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';\n }\n },\n // Hour [1-12]\n h: function h(date, token) {\n return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);\n },\n // Hour [0-23]\n H: function H(date, token) {\n return addLeadingZeros(date.getUTCHours(), token.length);\n },\n // Minute\n m: function m(date, token) {\n return addLeadingZeros(date.getUTCMinutes(), token.length);\n },\n // Second\n s: function s(date, token) {\n return addLeadingZeros(date.getUTCSeconds(), token.length);\n },\n // Fraction of second\n S: function S(date, token) {\n var numberOfDigits = token.length;\n var milliseconds = date.getUTCMilliseconds();\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));\n return addLeadingZeros(fractionalSeconds, token.length);\n }\n};\nexport default formatters;","import getUTCDayOfYear from \"../../../_lib/getUTCDayOfYear/index.js\";\nimport getUTCISOWeek from \"../../../_lib/getUTCISOWeek/index.js\";\nimport getUTCISOWeekYear from \"../../../_lib/getUTCISOWeekYear/index.js\";\nimport getUTCWeek from \"../../../_lib/getUTCWeek/index.js\";\nimport getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport addLeadingZeros from \"../../addLeadingZeros/index.js\";\nimport lightFormatters from \"../lightFormatters/index.js\";\nvar dayPeriodEnum = {\n am: 'am',\n pm: 'pm',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\nvar formatters = {\n // Era\n G: function G(date, token, localize) {\n var era = date.getUTCFullYear() > 0 ? 1 : 0;\n\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return localize.era(era, {\n width: 'abbreviated'\n });\n // A, B\n\n case 'GGGGG':\n return localize.era(era, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return localize.era(era, {\n width: 'wide'\n });\n }\n },\n // Year\n y: function y(date, token, localize) {\n // Ordinal number\n if (token === 'yo') {\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, {\n unit: 'year'\n });\n }\n\n return lightFormatters.y(date, token);\n },\n // Local week-numbering year\n Y: function Y(date, token, localize, options) {\n var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year\n\n if (token === 'YY') {\n var twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n } // Ordinal number\n\n\n if (token === 'Yo') {\n return localize.ordinalNumber(weekYear, {\n unit: 'year'\n });\n } // Padding\n\n\n return addLeadingZeros(weekYear, token.length);\n },\n // ISO week-numbering year\n R: function R(date, token) {\n var isoWeekYear = getUTCISOWeekYear(date); // Padding\n\n return addLeadingZeros(isoWeekYear, token.length);\n },\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function u(date, token) {\n var year = date.getUTCFullYear();\n return addLeadingZeros(year, token.length);\n },\n // Quarter\n Q: function Q(date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'QQ':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone quarter\n q: function q(date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'qq':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Month\n M: function M(date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n case 'M':\n case 'MM':\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return localize.month(month, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone month\n L: function L(date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return String(month + 1);\n // 01, 02, ..., 12\n\n case 'LL':\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return localize.month(month, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Local week of year\n w: function w(date, token, localize, options) {\n var week = getUTCWeek(date, options);\n\n if (token === 'wo') {\n return localize.ordinalNumber(week, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(week, token.length);\n },\n // ISO week of year\n I: function I(date, token, localize) {\n var isoWeek = getUTCISOWeek(date);\n\n if (token === 'Io') {\n return localize.ordinalNumber(isoWeek, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n // Day of the month\n d: function d(date, token, localize) {\n if (token === 'do') {\n return localize.ordinalNumber(date.getUTCDate(), {\n unit: 'date'\n });\n }\n\n return lightFormatters.d(date, token);\n },\n // Day of year\n D: function D(date, token, localize) {\n var dayOfYear = getUTCDayOfYear(date);\n\n if (token === 'Do') {\n return localize.ordinalNumber(dayOfYear, {\n unit: 'dayOfYear'\n });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n // Day of week\n E: function E(date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Local day of week\n e: function e(date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case 'e':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'ee':\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n\n case 'eo':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'eee':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone local day of week\n c: function c(date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (same as in `e`)\n case 'c':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'cc':\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n\n case 'co':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'ccc':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // ISO day of week\n i: function i(date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n\n switch (token) {\n // 2\n case 'i':\n return String(isoDayOfWeek);\n // 02\n\n case 'ii':\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n\n case 'io':\n return localize.ordinalNumber(isoDayOfWeek, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'iiiii':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'iiiiii':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'iiii':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM or PM\n a: function a(date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'aaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'aaaaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM, PM, midnight, noon\n b: function b(date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n }\n\n switch (token) {\n case 'b':\n case 'bb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'bbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'bbbbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // in the morning, in the afternoon, in the evening, at night\n B: function B(date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Hour [1-12]\n h: function h(date, token, localize) {\n if (token === 'ho') {\n var hours = date.getUTCHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return lightFormatters.h(date, token);\n },\n // Hour [0-23]\n H: function H(date, token, localize) {\n if (token === 'Ho') {\n return localize.ordinalNumber(date.getUTCHours(), {\n unit: 'hour'\n });\n }\n\n return lightFormatters.H(date, token);\n },\n // Hour [0-11]\n K: function K(date, token, localize) {\n var hours = date.getUTCHours() % 12;\n\n if (token === 'Ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Hour [1-24]\n k: function k(date, token, localize) {\n var hours = date.getUTCHours();\n if (hours === 0) hours = 24;\n\n if (token === 'ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Minute\n m: function m(date, token, localize) {\n if (token === 'mo') {\n return localize.ordinalNumber(date.getUTCMinutes(), {\n unit: 'minute'\n });\n }\n\n return lightFormatters.m(date, token);\n },\n // Second\n s: function s(date, token, localize) {\n if (token === 'so') {\n return localize.ordinalNumber(date.getUTCSeconds(), {\n unit: 'second'\n });\n }\n\n return lightFormatters.s(date, token);\n },\n // Fraction of second\n S: function S(date, token) {\n return lightFormatters.S(date, token);\n },\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function X(date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return 'Z';\n }\n\n switch (token) {\n // Hours and optional minutes\n case 'X':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n\n case 'XXXX':\n case 'XX':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function x(date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n\n case 'xxxx':\n case 'xx':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (GMT)\n O: function O(date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'O':\n case 'OO':\n case 'OOO':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (specific non-location)\n z: function z(date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'z':\n case 'zz':\n case 'zzz':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'zzzz':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Seconds timestamp\n t: function t(date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n // Milliseconds timestamp\n T: function T(date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n }\n};\n\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = Math.floor(absOffset / 60);\n var minutes = absOffset % 60;\n\n if (minutes === 0) {\n return sign + String(hours);\n }\n\n var delimiter = dirtyDelimiter || '';\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {\n if (offset % 60 === 0) {\n var sign = offset > 0 ? '-' : '+';\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n\n return formatTimezone(offset, dirtyDelimiter);\n}\n\nfunction formatTimezone(offset, dirtyDelimiter) {\n var delimiter = dirtyDelimiter || '';\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n var minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n\nexport default formatters;","import toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport startOfUTCWeekYear from \"../startOfUTCWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000;\nexport default function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import getUTCWeekYear from \"../getUTCWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport toInteger from \"../toInteger/index.js\";\nimport { getDefaultOptions } from \"../defaultOptions/index.js\";\nexport default function startOfUTCWeekYear(dirtyDate, options) {\n var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;\n\n requiredArgs(1, arguments);\n var defaultOptions = getDefaultOptions();\n var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);\n var year = getUTCWeekYear(dirtyDate, options);\n var firstWeek = new Date(0);\n firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCWeek(firstWeek, options);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport startOfUTCISOWeekYear from \"../startOfUTCISOWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000;\nexport default function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import getUTCISOWeekYear from \"../getUTCISOWeekYear/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nexport default function startOfUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var year = getUTCISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setUTCFullYear(year, 0, 4);\n fourthOfJanuary.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCISOWeek(fourthOfJanuary);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000;\nexport default function getUTCDayOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var timestamp = date.getTime();\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n var startOfYearTimestamp = date.getTime();\n var difference = timestamp - startOfYearTimestamp;\n return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;\n}","var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'P':\n return formatLong.date({\n width: 'short'\n });\n\n case 'PP':\n return formatLong.date({\n width: 'medium'\n });\n\n case 'PPP':\n return formatLong.date({\n width: 'long'\n });\n\n case 'PPPP':\n default:\n return formatLong.date({\n width: 'full'\n });\n }\n};\n\nvar timeLongFormatter = function timeLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'p':\n return formatLong.time({\n width: 'short'\n });\n\n case 'pp':\n return formatLong.time({\n width: 'medium'\n });\n\n case 'ppp':\n return formatLong.time({\n width: 'long'\n });\n\n case 'pppp':\n default:\n return formatLong.time({\n width: 'full'\n });\n }\n};\n\nvar dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {\n var matchResult = pattern.match(/(P+)(p+)?/) || [];\n var datePattern = matchResult[1];\n var timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n var dateTimeFormat;\n\n switch (datePattern) {\n case 'P':\n dateTimeFormat = formatLong.dateTime({\n width: 'short'\n });\n break;\n\n case 'PP':\n dateTimeFormat = formatLong.dateTime({\n width: 'medium'\n });\n break;\n\n case 'PPP':\n dateTimeFormat = formatLong.dateTime({\n width: 'long'\n });\n break;\n\n case 'PPPP':\n default:\n dateTimeFormat = formatLong.dateTime({\n width: 'full'\n });\n break;\n }\n\n return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));\n};\n\nvar longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter\n};\nexport default longFormatters;","var protectedDayOfYearTokens = ['D', 'DD'];\nvar protectedWeekYearTokens = ['YY', 'YYYY'];\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\nexport function throwProtectedError(token, format, input) {\n if (token === 'YYYY') {\n throw new RangeError(\"Use `yyyy` instead of `YYYY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\"));\n } else if (token === 'YY') {\n throw new RangeError(\"Use `yy` instead of `YY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\"));\n } else if (token === 'D') {\n throw new RangeError(\"Use `d` instead of `D` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\"));\n } else if (token === 'DD') {\n throw new RangeError(\"Use `dd` instead of `DD` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\"));\n }\n}","var formatDistanceLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n halfAMinute: 'half a minute',\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n aboutXWeeks: {\n one: 'about 1 week',\n other: 'about {{count}} weeks'\n },\n xWeeks: {\n one: '1 week',\n other: '{{count}} weeks'\n },\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n};\n\nvar formatDistance = function formatDistance(token, count, options) {\n var result;\n var tokenValue = formatDistanceLocale[token];\n\n if (typeof tokenValue === 'string') {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace('{{count}}', count.toString());\n }\n\n if (options !== null && options !== void 0 && options.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return 'in ' + result;\n } else {\n return result + ' ago';\n }\n }\n\n return result;\n};\n\nexport default formatDistance;","export default function buildFormatLongFn(args) {\n return function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // TODO: Remove String()\n var width = options.width ? String(options.width) : args.defaultWidth;\n var format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}","import buildFormatLongFn from \"../../../_lib/buildFormatLongFn/index.js\";\nvar dateFormats = {\n full: 'EEEE, MMMM do, y',\n long: 'MMMM do, y',\n medium: 'MMM d, y',\n short: 'MM/dd/yyyy'\n};\nvar timeFormats = {\n full: 'h:mm:ss a zzzz',\n long: 'h:mm:ss a z',\n medium: 'h:mm:ss a',\n short: 'h:mm a'\n};\nvar dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: '{{date}}, {{time}}',\n short: '{{date}}, {{time}}'\n};\nvar formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: 'full'\n }),\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: 'full'\n }),\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: 'full'\n })\n};\nexport default formatLong;","export default function buildMatchPatternFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n var matchedString = matchResult[0];\n var parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}","var formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: 'P'\n};\n\nvar formatRelative = function formatRelative(token, _date, _baseDate, _options) {\n return formatRelativeLocale[token];\n};\n\nexport default formatRelative;","export default function buildLocalizeFn(args) {\n return function (dirtyIndex, options) {\n var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';\n var valuesArray;\n\n if (context === 'formatting' && args.formattingValues) {\n var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n var _defaultWidth = args.defaultWidth;\n\n var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[_width] || args.values[_defaultWidth];\n }\n\n var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n\n return valuesArray[index];\n };\n}","export default function buildMatchFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var width = options.width;\n var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n var matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n\n var matchedString = matchResult[0];\n var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n }) : findKey(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n });\n var value;\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}\n\nfunction findKey(object, predicate) {\n for (var key in object) {\n if (object.hasOwnProperty(key) && predicate(object[key])) {\n return key;\n }\n }\n\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (var key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n\n return undefined;\n}","import formatDistance from \"./_lib/formatDistance/index.js\";\nimport formatLong from \"./_lib/formatLong/index.js\";\nimport formatRelative from \"./_lib/formatRelative/index.js\";\nimport localize from \"./_lib/localize/index.js\";\nimport match from \"./_lib/match/index.js\";\n\n/**\n * @type {Locale}\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\n */\nvar locale = {\n code: 'en-US',\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0\n /* Sunday */\n ,\n firstWeekContainsDate: 1\n }\n};\nexport default locale;","import defaultLocale from \"../../locale/en-US/index.js\";\nexport default defaultLocale;","import buildLocalizeFn from \"../../../_lib/buildLocalizeFn/index.js\";\nvar eraValues = {\n narrow: ['B', 'A'],\n abbreviated: ['BC', 'AD'],\n wide: ['Before Christ', 'Anno Domini']\n};\nvar quarterValues = {\n narrow: ['1', '2', '3', '4'],\n abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\n wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']\n}; // Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\n\nvar monthValues = {\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n};\nvar dayValues = {\n narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\n short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n};\nvar dayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n }\n};\nvar formattingDayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n }\n};\n\nvar ordinalNumber = function ordinalNumber(dirtyNumber, _options) {\n var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n var rem100 = number % 100;\n\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st';\n\n case 2:\n return number + 'nd';\n\n case 3:\n return number + 'rd';\n }\n }\n\n return number + 'th';\n};\n\nvar localize = {\n ordinalNumber: ordinalNumber,\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: 'wide'\n }),\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: 'wide',\n argumentCallback: function argumentCallback(quarter) {\n return quarter - 1;\n }\n }),\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: 'wide'\n }),\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: 'wide'\n }),\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: 'wide',\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: 'wide'\n })\n};\nexport default localize;","import buildMatchFn from \"../../../_lib/buildMatchFn/index.js\";\nimport buildMatchPatternFn from \"../../../_lib/buildMatchPatternFn/index.js\";\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i\n};\nvar parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i\n};\nvar parseMonthPatterns = {\n narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],\n any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]\n};\nvar matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i\n};\nvar parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]\n};\nvar matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i\n};\nvar parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i\n }\n};\nvar match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function valueCallback(value) {\n return parseInt(value, 10);\n }\n }),\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseEraPatterns,\n defaultParseWidth: 'any'\n }),\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: 'any',\n valueCallback: function valueCallback(index) {\n return index + 1;\n }\n }),\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: 'any'\n }),\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseDayPatterns,\n defaultParseWidth: 'any'\n }),\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: 'any',\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: 'any'\n })\n};\nexport default match;","import isValid from \"../isValid/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport formatters from \"../_lib/format/formatters/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getDefaultOptions } from \"../_lib/defaultOptions/index.js\";\nimport defaultLocale from \"../_lib/defaultLocale/index.js\"; // This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\n\nexport default function format(dirtyDate, dirtyFormatStr, options) {\n var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;\n\n requiredArgs(2, arguments);\n var formatStr = String(dirtyFormatStr);\n var defaultOptions = getDefaultOptions();\n var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : defaultLocale;\n var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\n var formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate\n };\n var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp).map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = formatters[firstCharacter];\n\n if (formatter) {\n if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));\n }\n\n if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));\n }\n\n return formatter(utcDate, substring, locale.localize, formatterOptions);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n var matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport default function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}","import addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name subMilliseconds\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\n\nexport default function subMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, -amount);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * @param {Date|Number} date - the date that should be after the other one to return true\n * @param {Date|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is after the second date\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\n\nexport default function isAfter(dirtyDate, dirtyDateToCompare) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var dateToCompare = toDate(dirtyDateToCompare);\n return date.getTime() > dateToCompare.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * @param {Date|Number} date - the date that should be before the other one to return true\n * @param {Date|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is before the second date\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\n\nexport default function isBefore(dirtyDate, dirtyDateToCompare) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var dateToCompare = toDate(dirtyDateToCompare);\n return date.getTime() < dateToCompare.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isEqual\n * @category Common Helpers\n * @summary Are the given dates equal?\n *\n * @description\n * Are the given dates equal?\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Boolean} the dates are equal\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\n * const result = isEqual(\n * new Date(2014, 6, 2, 6, 30, 45, 0),\n * new Date(2014, 6, 2, 6, 30, 45, 500)\n * )\n * //=> false\n */\n\nexport default function isEqual(dirtyLeftDate, dirtyRightDate) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyLeftDate);\n var dateRight = toDate(dirtyRightDate);\n return dateLeft.getTime() === dateRight.getTime();\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; 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); }\n\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param {*} value - the value to check\n * @returns {boolean} true if the given value is a date\n * @throws {TypeError} 1 arguments required\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\n\nexport default function isDate(value) {\n requiredArgs(1, arguments);\n return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';\n}","import isDate from \"../isDate/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @param {*} date - the date to check\n * @returns {Boolean} the date is valid\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\n\nexport default function isValid(dirtyDate) {\n requiredArgs(1, arguments);\n\n if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {\n return false;\n }\n\n var date = toDate(dirtyDate);\n return !isNaN(Number(date));\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name isWithinInterval\n * @category Interval Helpers\n * @summary Is the given date within the interval?\n *\n * @description\n * Is the given date within the interval? (Including start and end.)\n *\n * @param {Date|Number} date - the date to check\n * @param {Interval} interval - the interval to check\n * @returns {Boolean} the date is within the interval\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // For the date within the interval:\n * isWithinInterval(new Date(2014, 0, 3), {\n * start: new Date(2014, 0, 1),\n * end: new Date(2014, 0, 7)\n * })\n * //=> true\n *\n * @example\n * // For the date outside of the interval:\n * isWithinInterval(new Date(2014, 0, 10), {\n * start: new Date(2014, 0, 1),\n * end: new Date(2014, 0, 7)\n * })\n * //=> false\n *\n * @example\n * // For date equal to interval start:\n * isWithinInterval(date, { start, end: date }) // => true\n *\n * @example\n * // For date equal to interval end:\n * isWithinInterval(date, { start: date, end }) // => true\n */\nexport default function isWithinInterval(dirtyDate, interval) {\n requiredArgs(2, arguments);\n var time = toDate(dirtyDate).getTime();\n var startTime = toDate(interval.start).getTime();\n var endTime = toDate(interval.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(startTime <= endTime)) {\n throw new RangeError('Invalid interval');\n }\n\n return time >= startTime && time <= endTime;\n}","import addDays from \"../addDays/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getDefaultOptions } from \"../_lib/defaultOptions/index.js\";\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} day - the day of the week of the new date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the new date with the day of the week set\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\n\nexport default function setDay(dirtyDate, dirtyDay, options) {\n var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;\n\n requiredArgs(2, arguments);\n var defaultOptions = getDefaultOptions();\n var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = date.getDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var delta = 7 - weekStartsOn;\n var diff = day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7;\n return addDays(date, diff);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setHours\n * @category Hour Helpers\n * @summary Set the hours to the given date.\n *\n * @description\n * Set the hours to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} hours - the hours of the new date\n * @returns {Date} the new date with the hours set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set 4 hours to 1 September 2014 11:30:00:\n * const result = setHours(new Date(2014, 8, 1, 11, 30), 4)\n * //=> Mon Sep 01 2014 04:30:00\n */\n\nexport default function setHours(dirtyDate, dirtyHours) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var hours = toInteger(dirtyHours);\n date.setHours(hours);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport getDaysInMonth from \"../getDaysInMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setMonth\n * @category Month Helpers\n * @summary Set the month to the given date.\n *\n * @description\n * Set the month to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} month - the month of the new date\n * @returns {Date} the new date with the month set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set February to 1 September 2014:\n * const result = setMonth(new Date(2014, 8, 1), 1)\n * //=> Sat Feb 01 2014 00:00:00\n */\n\nexport default function setMonth(dirtyDate, dirtyMonth) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var month = toInteger(dirtyMonth);\n var year = date.getFullYear();\n var day = date.getDate();\n var dateWithDesiredMonth = new Date(0);\n dateWithDesiredMonth.setFullYear(year, month, 15);\n dateWithDesiredMonth.setHours(0, 0, 0, 0);\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth); // Set the last day of the new month\n // if the original date was the last day of the longer month\n\n date.setMonth(month, Math.min(day, daysInMonth));\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getDaysInMonth\n * @category Month Helpers\n * @summary Get the number of days in a month of the given date.\n *\n * @description\n * Get the number of days in a month of the given date.\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the number of days in a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // How many days are in February 2000?\n * const result = getDaysInMonth(new Date(2000, 1))\n * //=> 29\n */\n\nexport default function getDaysInMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var monthIndex = date.getMonth();\n var lastDayOfMonth = new Date(0);\n lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);\n lastDayOfMonth.setHours(0, 0, 0, 0);\n return lastDayOfMonth.getDate();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\n\nexport default function startOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfHour\n * @category Hour Helpers\n * @summary Return the start of an hour for the given date.\n *\n * @description\n * Return the start of an hour for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of an hour\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of an hour for 2 September 2014 11:55:00:\n * const result = startOfHour(new Date(2014, 8, 2, 11, 55))\n * //=> Tue Sep 02 2014 11:00:00\n */\n\nexport default function startOfHour(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setMinutes(0, 0, 0);\n return date;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; 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); }\n\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\n\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument); // Clone the date\n\n if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments\"); // eslint-disable-next-line no-console\n\n console.warn(new Error().stack);\n }\n\n return new Date(NaN);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = format;\n\nvar _index = _interopRequireDefault(require(\"../isValid/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../subMilliseconds/index.js\"));\n\nvar _index3 = _interopRequireDefault(require(\"../toDate/index.js\"));\n\nvar _index4 = _interopRequireDefault(require(\"../_lib/format/formatters/index.js\"));\n\nvar _index5 = _interopRequireDefault(require(\"../_lib/format/longFormatters/index.js\"));\n\nvar _index6 = _interopRequireDefault(require(\"../_lib/getTimezoneOffsetInMilliseconds/index.js\"));\n\nvar _index7 = require(\"../_lib/protectedTokens/index.js\");\n\nvar _index8 = _interopRequireDefault(require(\"../_lib/toInteger/index.js\"));\n\nvar _index9 = _interopRequireDefault(require(\"../_lib/requiredArgs/index.js\"));\n\nvar _index10 = require(\"../_lib/defaultOptions/index.js\");\n\nvar _index11 = _interopRequireDefault(require(\"../_lib/defaultLocale/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\n\nfunction format(dirtyDate, dirtyFormatStr, options) {\n var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;\n\n (0, _index9.default)(2, arguments);\n var formatStr = String(dirtyFormatStr);\n var defaultOptions = (0, _index10.getDefaultOptions)();\n var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : _index11.default;\n var firstWeekContainsDate = (0, _index8.default)((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var weekStartsOn = (0, _index8.default)((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n var originalDate = (0, _index3.default)(dirtyDate);\n\n if (!(0, _index.default)(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = (0, _index6.default)(originalDate);\n var utcDate = (0, _index2.default)(originalDate, timezoneOffset);\n var formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate\n };\n var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = _index5.default[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp).map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = _index4.default[firstCharacter];\n\n if (formatter) {\n if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && (0, _index7.isProtectedWeekYearToken)(substring)) {\n (0, _index7.throwProtectedError)(substring, dirtyFormatStr, String(dirtyDate));\n }\n\n if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && (0, _index7.isProtectedDayOfYearToken)(substring)) {\n (0, _index7.throwProtectedError)(substring, dirtyFormatStr, String(dirtyDate));\n }\n\n return formatter(utcDate, substring, locale.localize, formatterOptions);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n var matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isDate;\n\nvar _index = _interopRequireDefault(require(\"../_lib/requiredArgs/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; 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); }\n\n/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param {*} value - the value to check\n * @returns {boolean} true if the given value is a date\n * @throws {TypeError} 1 arguments required\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nfunction isDate(value) {\n (0, _index.default)(1, arguments);\n return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isValid;\n\nvar _index = _interopRequireDefault(require(\"../isDate/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../toDate/index.js\"));\n\nvar _index3 = _interopRequireDefault(require(\"../_lib/requiredArgs/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @param {*} date - the date to check\n * @returns {Boolean} the date is valid\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nfunction isValid(dirtyDate) {\n (0, _index3.default)(1, arguments);\n\n if (!(0, _index.default)(dirtyDate) && typeof dirtyDate !== 'number') {\n return false;\n }\n\n var date = (0, _index2.default)(dirtyDate);\n return !isNaN(Number(date));\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = buildFormatLongFn;\n\nfunction buildFormatLongFn(args) {\n return function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // TODO: Remove String()\n var width = options.width ? String(options.width) : args.defaultWidth;\n var format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = buildLocalizeFn;\n\nfunction buildLocalizeFn(args) {\n return function (dirtyIndex, options) {\n var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';\n var valuesArray;\n\n if (context === 'formatting' && args.formattingValues) {\n var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n var _defaultWidth = args.defaultWidth;\n\n var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[_width] || args.values[_defaultWidth];\n }\n\n var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n\n return valuesArray[index];\n };\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = buildMatchFn;\n\nfunction buildMatchFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var width = options.width;\n var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n var matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n\n var matchedString = matchResult[0];\n var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n }) : findKey(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n });\n var value;\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}\n\nfunction findKey(object, predicate) {\n for (var key in object) {\n if (object.hasOwnProperty(key) && predicate(object[key])) {\n return key;\n }\n }\n\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (var key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n\n return undefined;\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = buildMatchPatternFn;\n\nfunction buildMatchPatternFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n var matchedString = matchResult[0];\n var parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar formatDistanceLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n halfAMinute: 'half a minute',\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n aboutXWeeks: {\n one: 'about 1 week',\n other: 'about {{count}} weeks'\n },\n xWeeks: {\n one: '1 week',\n other: '{{count}} weeks'\n },\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n};\n\nvar formatDistance = function formatDistance(token, count, options) {\n var result;\n var tokenValue = formatDistanceLocale[token];\n\n if (typeof tokenValue === 'string') {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace('{{count}}', count.toString());\n }\n\n if (options !== null && options !== void 0 && options.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return 'in ' + result;\n } else {\n return result + ' ago';\n }\n }\n\n return result;\n};\n\nvar _default = formatDistance;\nexports.default = _default;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _index = _interopRequireDefault(require(\"../../../_lib/buildFormatLongFn/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar dateFormats = {\n full: 'EEEE, MMMM do, y',\n long: 'MMMM do, y',\n medium: 'MMM d, y',\n short: 'MM/dd/yyyy'\n};\nvar timeFormats = {\n full: 'h:mm:ss a zzzz',\n long: 'h:mm:ss a z',\n medium: 'h:mm:ss a',\n short: 'h:mm a'\n};\nvar dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: '{{date}}, {{time}}',\n short: '{{date}}, {{time}}'\n};\nvar formatLong = {\n date: (0, _index.default)({\n formats: dateFormats,\n defaultWidth: 'full'\n }),\n time: (0, _index.default)({\n formats: timeFormats,\n defaultWidth: 'full'\n }),\n dateTime: (0, _index.default)({\n formats: dateTimeFormats,\n defaultWidth: 'full'\n })\n};\nvar _default = formatLong;\nexports.default = _default;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: 'P'\n};\n\nvar formatRelative = function formatRelative(token, _date, _baseDate, _options) {\n return formatRelativeLocale[token];\n};\n\nvar _default = formatRelative;\nexports.default = _default;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _index = _interopRequireDefault(require(\"../../../_lib/buildLocalizeFn/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar eraValues = {\n narrow: ['B', 'A'],\n abbreviated: ['BC', 'AD'],\n wide: ['Before Christ', 'Anno Domini']\n};\nvar quarterValues = {\n narrow: ['1', '2', '3', '4'],\n abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\n wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']\n}; // Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\n\nvar monthValues = {\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n};\nvar dayValues = {\n narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\n short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n};\nvar dayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n }\n};\nvar formattingDayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n }\n};\n\nvar ordinalNumber = function ordinalNumber(dirtyNumber, _options) {\n var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n var rem100 = number % 100;\n\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st';\n\n case 2:\n return number + 'nd';\n\n case 3:\n return number + 'rd';\n }\n }\n\n return number + 'th';\n};\n\nvar localize = {\n ordinalNumber: ordinalNumber,\n era: (0, _index.default)({\n values: eraValues,\n defaultWidth: 'wide'\n }),\n quarter: (0, _index.default)({\n values: quarterValues,\n defaultWidth: 'wide',\n argumentCallback: function argumentCallback(quarter) {\n return quarter - 1;\n }\n }),\n month: (0, _index.default)({\n values: monthValues,\n defaultWidth: 'wide'\n }),\n day: (0, _index.default)({\n values: dayValues,\n defaultWidth: 'wide'\n }),\n dayPeriod: (0, _index.default)({\n values: dayPeriodValues,\n defaultWidth: 'wide',\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: 'wide'\n })\n};\nvar _default = localize;\nexports.default = _default;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _index = _interopRequireDefault(require(\"../../../_lib/buildMatchFn/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../../../_lib/buildMatchPatternFn/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i\n};\nvar parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i\n};\nvar parseMonthPatterns = {\n narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],\n any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]\n};\nvar matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i\n};\nvar parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]\n};\nvar matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i\n};\nvar parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i\n }\n};\nvar match = {\n ordinalNumber: (0, _index2.default)({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function valueCallback(value) {\n return parseInt(value, 10);\n }\n }),\n era: (0, _index.default)({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseEraPatterns,\n defaultParseWidth: 'any'\n }),\n quarter: (0, _index.default)({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: 'any',\n valueCallback: function valueCallback(index) {\n return index + 1;\n }\n }),\n month: (0, _index.default)({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: 'any'\n }),\n day: (0, _index.default)({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseDayPatterns,\n defaultParseWidth: 'any'\n }),\n dayPeriod: (0, _index.default)({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: 'any',\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: 'any'\n })\n};\nvar _default = match;\nexports.default = _default;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _index = _interopRequireDefault(require(\"./_lib/formatDistance/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"./_lib/formatLong/index.js\"));\n\nvar _index3 = _interopRequireDefault(require(\"./_lib/formatRelative/index.js\"));\n\nvar _index4 = _interopRequireDefault(require(\"./_lib/localize/index.js\"));\n\nvar _index5 = _interopRequireDefault(require(\"./_lib/match/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @type {Locale}\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\n */\nvar locale = {\n code: 'en-US',\n formatDistance: _index.default,\n formatLong: _index2.default,\n formatRelative: _index3.default,\n localize: _index4.default,\n match: _index5.default,\n options: {\n weekStartsOn: 0\n /* Sunday */\n ,\n firstWeekContainsDate: 1\n }\n};\nvar _default = locale;\nexports.default = _default;\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = subMilliseconds;\n\nvar _index = _interopRequireDefault(require(\"../addMilliseconds/index.js\"));\n\nvar _index2 = _interopRequireDefault(require(\"../_lib/requiredArgs/index.js\"));\n\nvar _index3 = _interopRequireDefault(require(\"../_lib/toInteger/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @name subMilliseconds\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\nfunction subMilliseconds(dirtyDate, dirtyAmount) {\n (0, _index2.default)(2, arguments);\n var amount = (0, _index3.default)(dirtyAmount);\n return (0, _index.default)(dirtyDate, -amount);\n}\n\nmodule.exports = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = toDate;\n\nvar _index = _interopRequireDefault(require(\"../_lib/requiredArgs/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; 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); }\n\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nfunction toDate(argument) {\n (0, _index.default)(1, arguments);\n var argStr = Object.prototype.toString.call(argument); // Clone the date\n\n if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments\"); // eslint-disable-next-line no-console\n\n console.warn(new Error().stack);\n }\n\n return new Date(NaN);\n }\n}\n\nmodule.exports = exports.default;","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar BrowserInfo = /** @class */ (function () {\n function BrowserInfo(name, version, os) {\n this.name = name;\n this.version = version;\n this.os = os;\n this.type = 'browser';\n }\n return BrowserInfo;\n}());\nexport { BrowserInfo };\nvar NodeInfo = /** @class */ (function () {\n function NodeInfo(version) {\n this.version = version;\n this.type = 'node';\n this.name = 'node';\n this.os = process.platform;\n }\n return NodeInfo;\n}());\nexport { NodeInfo };\nvar SearchBotDeviceInfo = /** @class */ (function () {\n function SearchBotDeviceInfo(name, version, os, bot) {\n this.name = name;\n this.version = version;\n this.os = os;\n this.bot = bot;\n this.type = 'bot-device';\n }\n return SearchBotDeviceInfo;\n}());\nexport { SearchBotDeviceInfo };\nvar BotInfo = /** @class */ (function () {\n function BotInfo() {\n this.type = 'bot';\n this.bot = true; // NOTE: deprecated test name instead\n this.name = 'bot';\n this.version = null;\n this.os = null;\n }\n return BotInfo;\n}());\nexport { BotInfo };\nvar ReactNativeInfo = /** @class */ (function () {\n function ReactNativeInfo() {\n this.type = 'react-native';\n this.name = 'react-native';\n this.version = null;\n this.os = null;\n }\n return ReactNativeInfo;\n}());\nexport { ReactNativeInfo };\n// tslint:disable-next-line:max-line-length\nvar SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/;\nvar SEARCHBOT_OS_REGEX = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\\ Jeeves\\/Teoma|ia_archiver)/;\nvar REQUIRED_VERSION_PARTS = 3;\nvar userAgentRules = [\n ['aol', /AOLShield\\/([0-9\\._]+)/],\n ['edge', /Edge\\/([0-9\\._]+)/],\n ['edge-ios', /EdgiOS\\/([0-9\\._]+)/],\n ['yandexbrowser', /YaBrowser\\/([0-9\\._]+)/],\n ['kakaotalk', /KAKAOTALK\\s([0-9\\.]+)/],\n ['samsung', /SamsungBrowser\\/([0-9\\.]+)/],\n ['silk', /\\bSilk\\/([0-9._-]+)\\b/],\n ['miui', /MiuiBrowser\\/([0-9\\.]+)$/],\n ['beaker', /BeakerBrowser\\/([0-9\\.]+)/],\n ['edge-chromium', /EdgA?\\/([0-9\\.]+)/],\n [\n 'chromium-webview',\n /(?!Chrom.*OPR)wv\\).*Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/,\n ],\n ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/],\n ['phantomjs', /PhantomJS\\/([0-9\\.]+)(:?\\s|$)/],\n ['crios', /CriOS\\/([0-9\\.]+)(:?\\s|$)/],\n ['firefox', /Firefox\\/([0-9\\.]+)(?:\\s|$)/],\n ['fxios', /FxiOS\\/([0-9\\.]+)/],\n ['opera-mini', /Opera Mini.*Version\\/([0-9\\.]+)/],\n ['opera', /Opera\\/([0-9\\.]+)(?:\\s|$)/],\n ['opera', /OPR\\/([0-9\\.]+)(:?\\s|$)/],\n ['pie', /^Microsoft Pocket Internet Explorer\\/(\\d+\\.\\d+)$/],\n ['pie', /^Mozilla\\/\\d\\.\\d+\\s\\(compatible;\\s(?:MSP?IE|MSInternet Explorer) (\\d+\\.\\d+);.*Windows CE.*\\)$/],\n ['netfront', /^Mozilla\\/\\d\\.\\d+.*NetFront\\/(\\d.\\d)/],\n ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+).*\\).*Gecko$/],\n ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],\n ['ie', /MSIE\\s(7\\.0)/],\n ['bb10', /BB10;\\sTouch.*Version\\/([0-9\\.]+)/],\n ['android', /Android\\s([0-9\\.]+)/],\n ['ios', /Version\\/([0-9\\._]+).*Mobile.*Safari.*/],\n ['safari', /Version\\/([0-9\\._]+).*Safari/],\n ['facebook', /FB[AS]V\\/([0-9\\.]+)/],\n ['instagram', /Instagram\\s([0-9\\.]+)/],\n ['ios-webview', /AppleWebKit\\/([0-9\\.]+).*Mobile/],\n ['ios-webview', /AppleWebKit\\/([0-9\\.]+).*Gecko\\)$/],\n ['curl', /^curl\\/([0-9\\.]+)$/],\n ['searchbot', SEARCHBOX_UA_REGEX],\n];\nvar operatingSystemRules = [\n ['iOS', /iP(hone|od|ad)/],\n ['Android OS', /Android/],\n ['BlackBerry OS', /BlackBerry|BB10/],\n ['Windows Mobile', /IEMobile/],\n ['Amazon OS', /Kindle/],\n ['Windows 3.11', /Win16/],\n ['Windows 95', /(Windows 95)|(Win95)|(Windows_95)/],\n ['Windows 98', /(Windows 98)|(Win98)/],\n ['Windows 2000', /(Windows NT 5.0)|(Windows 2000)/],\n ['Windows XP', /(Windows NT 5.1)|(Windows XP)/],\n ['Windows Server 2003', /(Windows NT 5.2)/],\n ['Windows Vista', /(Windows NT 6.0)/],\n ['Windows 7', /(Windows NT 6.1)/],\n ['Windows 8', /(Windows NT 6.2)/],\n ['Windows 8.1', /(Windows NT 6.3)/],\n ['Windows 10', /(Windows NT 10.0)/],\n ['Windows ME', /Windows ME/],\n ['Windows CE', /Windows CE|WinCE|Microsoft Pocket Internet Explorer/],\n ['Open BSD', /OpenBSD/],\n ['Sun OS', /SunOS/],\n ['Chrome OS', /CrOS/],\n ['Linux', /(Linux)|(X11)/],\n ['Mac OS', /(Mac_PowerPC)|(Macintosh)/],\n ['QNX', /QNX/],\n ['BeOS', /BeOS/],\n ['OS/2', /OS\\/2/],\n];\nexport function detect(userAgent) {\n if (!!userAgent) {\n return parseUserAgent(userAgent);\n }\n if (typeof document === 'undefined' &&\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative') {\n return new ReactNativeInfo();\n }\n if (typeof navigator !== 'undefined') {\n return parseUserAgent(navigator.userAgent);\n }\n return getNodeVersion();\n}\nfunction matchUserAgent(ua) {\n // opted for using reduce here rather than Array#first with a regex.test call\n // this is primarily because using the reduce we only perform the regex\n // execution once rather than once for the test and for the exec again below\n // probably something that needs to be benchmarked though\n return (ua !== '' &&\n userAgentRules.reduce(function (matched, _a) {\n var browser = _a[0], regex = _a[1];\n if (matched) {\n return matched;\n }\n var uaMatch = regex.exec(ua);\n return !!uaMatch && [browser, uaMatch];\n }, false));\n}\nexport function browserName(ua) {\n var data = matchUserAgent(ua);\n return data ? data[0] : null;\n}\nexport function parseUserAgent(ua) {\n var matchedRule = matchUserAgent(ua);\n if (!matchedRule) {\n return null;\n }\n var name = matchedRule[0], match = matchedRule[1];\n if (name === 'searchbot') {\n return new BotInfo();\n }\n // Do not use RegExp for split operation as some browser do not support it (See: http://blog.stevenlevithan.com/archives/cross-browser-split)\n var versionParts = match[1] && match[1].split('.').join('_').split('_').slice(0, 3);\n if (versionParts) {\n if (versionParts.length < REQUIRED_VERSION_PARTS) {\n versionParts = __spreadArray(__spreadArray([], versionParts, true), createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length), true);\n }\n }\n else {\n versionParts = [];\n }\n var version = versionParts.join('.');\n var os = detectOS(ua);\n var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua);\n if (searchBotMatch && searchBotMatch[1]) {\n return new SearchBotDeviceInfo(name, version, os, searchBotMatch[1]);\n }\n return new BrowserInfo(name, version, os);\n}\nexport function detectOS(ua) {\n for (var ii = 0, count = operatingSystemRules.length; ii < count; ii++) {\n var _a = operatingSystemRules[ii], os = _a[0], regex = _a[1];\n var match = regex.exec(ua);\n if (match) {\n return os;\n }\n }\n return null;\n}\nexport function getNodeVersion() {\n var isNode = typeof process !== 'undefined' && process.version;\n return isNode ? new NodeInfo(process.version.slice(1)) : null;\n}\nfunction createVersionParts(count) {\n var output = [];\n for (var ii = 0; ii < count; ii++) {\n output.push('0');\n }\n return output;\n}\n","import Ember from 'ember';\nimport { defer } from 'rsvp';\nimport { Environment } from './external/environment';\nimport { assert } from '@ember/debug';\nimport { join, next, schedule } from '@ember/runloop';\n\nexport class EmberEnvironment extends Environment {\n assert(...args) {\n assert(...args);\n }\n\n async(callback) {\n join(() => schedule('actions', callback));\n }\n\n reportUncaughtRejection(error) {\n next(null, function () {\n if (Ember.onerror) {\n Ember.onerror(error);\n } else {\n throw error;\n }\n });\n }\n\n defer() {\n return defer();\n }\n\n globalDebuggingEnabled() {\n return Ember.ENV.DEBUG_TASKS;\n }\n}\n\nexport const EMBER_ENVIRONMENT = new EmberEnvironment();\n","export class Environment {\n assert() {}\n\n async(callback) {\n Promise.resolve().then(callback);\n }\n\n reportUncaughtRejection() {\n this.async((error) => {\n throw error;\n });\n }\n\n defer() {\n let deferable = {\n promise: null,\n resolve: null,\n reject: null,\n };\n\n let promise = new Promise((resolve, reject) => {\n deferable.resolve = resolve;\n deferable.reject = reject;\n });\n\n deferable.promise = promise;\n\n return deferable;\n }\n\n globalDebuggingEnabled() {\n return false;\n }\n}\n\nexport const DEFAULT_ENVIRONMENT = new Environment();\n","class BoundedPolicy {\n constructor(maxConcurrency) {\n this.maxConcurrency = maxConcurrency || 1;\n }\n}\n\nexport default BoundedPolicy;\n","import BoundedPolicy from './bounded-policy';\nimport { makeCancelState, STARTED } from './execution-states';\n\nconst CANCELLED = makeCancelState(\n `it belongs to a 'drop' Task that was already running`,\n);\n\nclass DropReducer {\n constructor(remainingSlots) {\n this.remainingSlots = remainingSlots;\n }\n\n step() {\n if (this.remainingSlots > 0) {\n this.remainingSlots--;\n return STARTED;\n }\n\n return CANCELLED;\n }\n}\n\nclass DropPolicy extends BoundedPolicy {\n makeReducer() {\n return new DropReducer(this.maxConcurrency);\n }\n}\n\nexport default DropPolicy;\n","import BoundedPolicy from './bounded-policy';\nimport { STARTED, QUEUED } from './execution-states';\n\nclass EnqueuedReducer {\n constructor(remainingSlots) {\n this.remainingSlots = remainingSlots;\n }\n\n step() {\n if (this.remainingSlots > 0) {\n this.remainingSlots--;\n return STARTED;\n } else {\n return QUEUED;\n }\n }\n}\n\nclass EnqueuedPolicy extends BoundedPolicy {\n makeReducer() {\n return new EnqueuedReducer(this.maxConcurrency);\n }\n}\n\nexport default EnqueuedPolicy;\n","export const TYPE_CANCELLED = 'CANCELLED';\nexport const TYPE_STARTED = 'STARTED';\nexport const TYPE_QUEUED = 'QUEUED';\n\nexport const STARTED = { type: TYPE_STARTED };\nexport const QUEUED = { type: TYPE_QUEUED };\n\nexport const makeCancelState = (reason) => ({ type: TYPE_CANCELLED, reason });\n","import BoundedPolicy from './bounded-policy';\nimport { STARTED, QUEUED, makeCancelState } from './execution-states';\n\nconst CANCELLED = makeCancelState(\n `it belongs to a 'keepLatest' Task that was already running`,\n);\n\n// Given:\n// - started tasks: [a,b,_]\n// - queued tasks: [c,d,e,f]\n// KeepLatest will cancel all but the last queued task instance, producing:\n// - started tasks: [a,b,c]\n// - queued tasks: [f]\n\n// TODO: perhaps we should expose another config for the number to keep enqueued.\n// this would also make sense for enqueued, e.g. perform a max of maxConcurrency\n// concurrent task instances, but after a number of queued instances has been\n// reached, they should be cancelled.\n\nclass KeepLatestReducer {\n constructor(remainingSlots, numToCancel) {\n this.remainingSlots = remainingSlots;\n this.numToCancel = numToCancel;\n }\n\n step() {\n if (this.remainingSlots > 0) {\n this.remainingSlots--;\n return STARTED;\n } else {\n if (this.numToCancel > 0) {\n this.numToCancel--;\n return CANCELLED;\n } else {\n return QUEUED;\n }\n }\n }\n}\n\nclass KeepLatestPolicy extends BoundedPolicy {\n makeReducer(numRunning, numQueued) {\n let maxEnqueued = 1;\n let totalRunning = numRunning + numQueued;\n return new KeepLatestReducer(\n this.maxConcurrency,\n totalRunning - this.maxConcurrency - maxEnqueued,\n );\n }\n}\n\nexport default KeepLatestPolicy;\n","import BoundedPolicy from './bounded-policy';\nimport { STARTED, makeCancelState } from './execution-states';\n\nconst CANCELLED = makeCancelState(\n `it belongs to a 'restartable' Task that was .perform()ed again`,\n);\n\nclass RestartableReducer {\n constructor(numToCancel) {\n this.numToCancel = numToCancel;\n }\n\n step() {\n if (this.numToCancel > 0) {\n this.numToCancel--;\n return CANCELLED;\n } else {\n return STARTED;\n }\n }\n}\n\nclass RestartablePolicy extends BoundedPolicy {\n makeReducer(numRunning, numQueued) {\n return new RestartableReducer(numRunning + numQueued - this.maxConcurrency);\n }\n}\n\nexport default RestartablePolicy;\n","import {\n TYPE_STARTED,\n TYPE_QUEUED,\n TYPE_CANCELLED,\n} from './policies/execution-states';\n\nconst LAST_APPLIED_TAGS = new Map();\n\nclass Refresh {\n constructor(schedulerPolicy, stateTracker, taskInstances) {\n this.stateTracker = stateTracker;\n this.schedulerPolicy = schedulerPolicy;\n this.initialTaskInstances = taskInstances;\n this.startingInstances = [];\n }\n\n process() {\n let [taskInstances, numRunning, numQueued] =\n this.filterFinishedTaskInstances();\n let reducer = this.schedulerPolicy.makeReducer(numRunning, numQueued);\n\n let finalTaskInstances = taskInstances.filter((taskInstance) => {\n return this.setTaskInstanceExecutionState(taskInstance, reducer.step());\n });\n\n this.stateTracker.computeFinalStates((state) => this.applyState(state));\n this.startingInstances.forEach((taskInstance) => taskInstance.start());\n\n return finalTaskInstances;\n }\n\n filterFinishedTaskInstances() {\n let numRunning = 0,\n numQueued = 0;\n let taskInstances = this.initialTaskInstances.filter((taskInstance) => {\n let taskState = this.stateTracker.stateFor(taskInstance.task);\n let executorState = taskInstance.executor.state;\n\n if (executorState.isFinished) {\n taskState.onCompletion(taskInstance);\n return false;\n }\n\n if (executorState.hasStarted) {\n numRunning += 1;\n } else {\n numQueued += 1;\n }\n\n return true;\n });\n return [taskInstances, numRunning, numQueued];\n }\n\n setTaskInstanceExecutionState(taskInstance, desiredState) {\n let taskState = this.stateTracker.stateFor(taskInstance.task);\n\n if (!taskInstance.executor.counted) {\n taskInstance.executor.counted = true;\n taskState.onPerformed(taskInstance);\n }\n\n switch (desiredState.type) {\n case TYPE_CANCELLED:\n // this will cause a follow up flush which will detect and recompute cancellation state\n taskInstance.cancel(desiredState.reason);\n return false;\n case TYPE_STARTED:\n if (!taskInstance.executor.state.hasStarted) {\n this.startingInstances.push(taskInstance);\n taskState.onStart(taskInstance);\n }\n taskState.onRunning(taskInstance);\n return true;\n case TYPE_QUEUED:\n taskState.onQueued(taskInstance);\n // TODO: assert taskInstance hasn't started?\n // Or perhaps this can be a way to pause a task?\n return true;\n }\n }\n\n applyState(state) {\n let { taskable } = state;\n\n if (!taskable.onState) {\n return;\n }\n\n const { guid } = taskable;\n\n if (\n LAST_APPLIED_TAGS.has(guid) &&\n state.tag < LAST_APPLIED_TAGS.get(guid)\n ) {\n return;\n }\n\n let props = Object.assign(\n {\n numRunning: state.numRunning,\n numQueued: state.numQueued,\n numPerformedInc: state.numPerformedInc,\n },\n state.attrs,\n );\n\n taskable.onState(props, taskable);\n\n LAST_APPLIED_TAGS.set(guid, state.tag);\n }\n}\n\nexport default Refresh;\n","import {\n COMPLETION_SUCCESS,\n COMPLETION_ERROR,\n COMPLETION_CANCEL,\n} from '../../task-instance/completion-states';\n\nclass RefreshState {\n constructor(taskable, tag) {\n this.taskable = taskable;\n this.group = taskable.group;\n this.numRunning = 0;\n this.numQueued = 0;\n this.numPerformedInc = 0;\n this.attrs = {};\n this.tag = tag;\n }\n\n onCompletion(taskInstance) {\n let state = taskInstance.completionState;\n this.attrs.lastRunning = null;\n this.attrs.lastComplete = taskInstance;\n if (state === COMPLETION_SUCCESS) {\n this.attrs.lastSuccessful = taskInstance;\n } else {\n if (state === COMPLETION_ERROR) {\n this.attrs.lastErrored = taskInstance;\n } else if (state === COMPLETION_CANCEL) {\n this.attrs.lastCanceled = taskInstance;\n }\n this.attrs.lastIncomplete = taskInstance;\n }\n }\n\n onPerformed(taskInstance) {\n this.numPerformedInc += 1;\n this.attrs.lastPerformed = taskInstance;\n }\n\n onStart(taskInstance) {\n this.attrs.last = taskInstance;\n }\n\n onRunning(taskInstance) {\n this.attrs.lastRunning = taskInstance;\n this.numRunning += 1;\n }\n\n onQueued() {\n this.numQueued += 1;\n }\n\n recurseTaskGroups(callback) {\n let group = this.group;\n while (group) {\n callback(group);\n group = group.group;\n }\n }\n\n applyStateFrom(other) {\n Object.assign(this.attrs, other.attrs);\n this.numRunning += other.numRunning;\n this.numQueued += other.numQueued;\n this.numPerformedInc += other.numPerformedInc;\n }\n}\n\nexport default RefreshState;\n","import RefreshState from './state';\n\nconst CURRENT_REFRESH_TAGS = new Map();\n\nclass StateTracker {\n constructor() {\n this.states = new Map();\n }\n\n stateFor(taskable) {\n let guid = taskable.guid;\n let taskState = this.states.get(guid);\n if (!taskState) {\n let currentTag = CURRENT_REFRESH_TAGS.has(guid)\n ? CURRENT_REFRESH_TAGS.get(guid)\n : 0;\n taskState = new RefreshState(taskable, ++currentTag);\n this.states.set(guid, taskState);\n CURRENT_REFRESH_TAGS.set(guid, currentTag);\n }\n return taskState;\n }\n\n // After cancelling/queueing task instances, we have to recompute the derived state\n // of all the tasks that had/have task instances in this scheduler. We do this by\n // looping through all the Tasks that we've accumulated state for, and then recursively\n // applying/adding to the state of any TaskGroups they belong to.\n computeFinalStates(callback) {\n this.computeRecursiveState();\n this.forEachState((state) => callback(state));\n }\n\n computeRecursiveState() {\n this.forEachState((taskState) => {\n let lastState = taskState;\n taskState.recurseTaskGroups((taskGroup) => {\n let state = this.stateFor(taskGroup);\n state.applyStateFrom(lastState);\n lastState = state;\n });\n });\n }\n\n forEachState(callback) {\n this.states.forEach((state) => callback(state));\n }\n}\n\nexport default StateTracker;\n","import NullState from './null-state';\n\nconst NULL_STATE = new NullState();\n\nclass NullStateTracker {\n stateFor() {\n return NULL_STATE;\n }\n\n computeFinalStates() {}\n}\n\nexport default NullStateTracker;\n","class NullState {\n onCompletion() {}\n onPerformed() {}\n onStart() {}\n onRunning() {}\n onQueued() {}\n}\n\nexport default NullState;\n","import SchedulerRefresh from './refresh';\nimport StateTracker from './state-tracker/state-tracker';\nimport NullStateTracker from './state-tracker/null-state-tracker';\n\n// Scheduler base class\n\n// When a Task is performed, it creates an unstarted TaskInstance and\n// passes it to the Scheduler to determine when it should run. The\n// scheduler consults the schedulerPolicy (e.g. DropPolicy, RestartablePolicy, etc)\n// to determine whether the task instance should start executing, be enqueued\n// for later execution, or be immediately cancelled. As TaskInstances start\n// and run to completion, the Scheduler's `refresh()` method is called to\n// give it an opportunity to start (or cancel) previously enqueued task instances,\n// as well as update the derived state on Tasks and TaskGroups.\n\n// Every Task has its own Scheduler instance, unless it is part of a group,\n// in which case all the Tasks in a group share a single Scheduler.\n\nclass Scheduler {\n constructor(schedulerPolicy, stateTrackingEnabled) {\n this.schedulerPolicy = schedulerPolicy;\n this.stateTrackingEnabled = stateTrackingEnabled;\n this.taskInstances = [];\n }\n\n cancelAll(guid, cancelRequest) {\n let cancelations = this.taskInstances\n .map((taskInstance) => {\n if (taskInstance.task.guids[guid]) {\n taskInstance.executor.cancel(cancelRequest);\n }\n })\n .filter((cancelation) => !!cancelation);\n\n return Promise.all(cancelations);\n }\n\n perform(taskInstance) {\n taskInstance.onFinalize(() => this.scheduleRefresh());\n this.taskInstances.push(taskInstance);\n this.refresh();\n }\n\n scheduleRefresh() {\n Promise.resolve().then(() => this.refresh());\n }\n\n refresh() {\n let stateTracker = this.stateTrackingEnabled\n ? new StateTracker()\n : new NullStateTracker();\n let refresh = new SchedulerRefresh(\n this.schedulerPolicy,\n stateTracker,\n this.taskInstances,\n );\n this.taskInstances = refresh.process();\n }\n}\n\nexport default Scheduler;\n","import { STARTED } from './execution-states';\n\nclass UnboundedReducer {\n step() {\n return STARTED;\n }\n}\n\nconst SINGLETON_REDUCER = new UnboundedReducer();\n\nclass UnboundedPolicy {\n makeReducer() {\n return SINGLETON_REDUCER;\n }\n}\n\nexport default UnboundedPolicy;\n","import Scheduler from './scheduler/scheduler';\nimport UnboundedSchedulerPolicy from './scheduler/policies/unbounded-policy';\nimport EnqueueSchedulerPolicy from './scheduler/policies/enqueued-policy';\nimport DropSchedulerPolicy from './scheduler/policies/drop-policy';\nimport KeepLatestSchedulerPolicy from './scheduler/policies/keep-latest-policy';\nimport RestartableSchedulerPolicy from './scheduler/policies/restartable-policy';\nimport { Task } from './task/task';\nimport { TaskGroup } from './task/task-group';\nimport { DEFAULT_ENVIRONMENT } from './environment';\n\nfunction assertModifiersNotMixedWithGroup(obj) {\n if (obj._hasSetConcurrencyConstraint && obj._taskGroupPath) {\n throw new Error(\n `Cannot use both 'group' and other concurrency-constraining task modifiers (e.g. 'drop', 'enqueue', 'restartable')`,\n );\n }\n}\n\nfunction assertUnsetBufferPolicy(obj) {\n if (obj._hasSetBufferPolicy) {\n throw new Error(\n `Cannot set multiple buffer policies on a task or task group. ${obj._schedulerPolicyClass} has already been set for task or task group '${obj.name}'`,\n );\n }\n}\n\nconst MODIFIER_REGISTRY = {\n enqueue: (factory, value) =>\n value && factory.setBufferPolicy(EnqueueSchedulerPolicy),\n evented: (factory, value) => value && factory.setEvented(value),\n debug: (factory, value) => value && factory.setDebug(value),\n drop: (factory, value) =>\n value && factory.setBufferPolicy(DropSchedulerPolicy),\n group: (factory, groupName) => factory.setGroup(groupName),\n keepLatest: (factory, value) =>\n value && factory.setBufferPolicy(KeepLatestSchedulerPolicy),\n maxConcurrency: (factory, maxConcurrency) =>\n factory.setMaxConcurrency(maxConcurrency),\n onState: (factory, onStateCallback) => factory.setOnState(onStateCallback),\n restartable: (factory, value) =>\n value && factory.setBufferPolicy(RestartableSchedulerPolicy),\n};\n\n/**\n * Callback type defining a task modifier\n *\n * @callback TaskFactory~TaskModifier\n * @param {TaskFactory} factory\n * @param {*} taskModifierOption\n */\n\n/**\n * Registers a new modifier with the modifier registry\n *\n * @param {string} name Name of the modifier\n * @param {TaskFactory~TaskModifier} callback\n */\nexport function registerModifier(name, callback) {\n if (MODIFIER_REGISTRY[name]) {\n throw new Error(\n `A modifier with the name '${name}' has already been defined.`,\n );\n }\n\n MODIFIER_REGISTRY[name] = callback;\n}\n\n/**\n * Returns a specified modifier, if it exists in the registry\n *\n * @param {string} name Name of the modifier\n * @returns {TaskFactory~TaskModifier?}\n */\nexport function getModifier(name) {\n return MODIFIER_REGISTRY[name];\n}\n\n/**\n * Returns whether a specified modifier exists in the registry\n *\n * @param {string} name Name of the modifier\n * @returns {boolean}\n */\nexport function hasModifier(name) {\n return name in MODIFIER_REGISTRY;\n}\n\n/**\n * Factory used for instantiating Tasks and Task Groups. Mostly for internal\n * use, but some public APIs exposed via the Task Modifier APIs.\n *\n * \n *\n * @class TaskFactory\n */\nexport class TaskFactory {\n env = DEFAULT_ENVIRONMENT;\n\n _debug = null;\n _enabledModifiers = [];\n _hasSetConcurrencyConstraint = false;\n _hasSetBufferPolicy = false;\n _hasEnabledEvents = false;\n _maxConcurrency = null;\n _onStateCallback = (state, taskable) => taskable.setState(state);\n _schedulerPolicyClass = UnboundedSchedulerPolicy;\n _taskGroupPath = null;\n\n constructor(name = '', taskDefinition = null, options = {}) {\n this.name = name;\n this.taskDefinition = taskDefinition;\n this.options = options;\n this._processModifierOptions(options);\n }\n\n /**\n * Returns a new Task bound to the given context\n *\n * @protected\n * @param {*} context\n * @returns {Task}\n */\n createTask(context) {\n let options = this.getTaskOptions(context);\n\n return new Task(\n Object.assign(\n {\n generatorFactory: (args) => this.taskDefinition.apply(context, args),\n },\n options,\n ),\n );\n }\n\n /**\n * Returns a new TaskGroup bound to the given context\n *\n * @protected\n * @param {*} context\n * @returns {Task}\n */\n createTaskGroup(context) {\n let options = this.getTaskOptions(context);\n\n return new TaskGroup(options);\n }\n\n /**\n * Returns a modifier callback with the given name bound to this TaskFactory,\n * if registered.\n *\n * @protected\n * @param {string} name\n * @returns {TaskFactory~TaskModifier?}\n */\n getModifier(name) {\n if (hasModifier(name)) {\n return MODIFIER_REGISTRY[name].bind(null, this);\n }\n }\n\n /**\n * Returns the options provided to TaskFactory\n *\n * @public\n * @returns {object}\n */\n getOptions() {\n return this.options;\n }\n\n /**\n * Returns a new Scheduler instance\n *\n * @protected\n * @param {*} schedulerPolicy\n * @param {boolean} stateTrackingEnabled\n * @returns {Scheduler}\n */\n getScheduler(schedulerPolicy, stateTrackingEnabled) {\n return new Scheduler(schedulerPolicy, stateTrackingEnabled);\n }\n\n /**\n * Returns the options to pass to a Task or TaskGroup constructor\n *\n * @protected\n * @param {*} context\n * @returns {object}\n */\n getTaskOptions(context) {\n let group, scheduler;\n let onStateCallback = this._onStateCallback;\n\n if (this._taskGroupPath) {\n group = context[this._taskGroupPath];\n if (!(group instanceof TaskGroup)) {\n throw new Error(\n `Expected group '${this._taskGroupPath}' to be defined but was not found.`,\n );\n }\n\n scheduler = group.scheduler;\n } else {\n let schedulerPolicy = new this._schedulerPolicyClass(\n this._maxConcurrency,\n );\n scheduler = this.getScheduler(\n schedulerPolicy,\n onStateCallback && typeof onStateCallback === 'function',\n );\n }\n\n return {\n context,\n debug: this._debug,\n env: this.env,\n name: this.name,\n group,\n scheduler,\n hasEnabledEvents: this._hasEnabledEvents,\n onStateCallback,\n enabledModifiers: this._enabledModifiers,\n modifierOptions: this.getOptions(),\n };\n }\n\n /**\n * Sets the Scheduler buffer policy class to the specified value.\n *\n * Will raise an assertion if a buffer policy has already been specified\n *\n * @param {*} policy\n * @returns {TaskFactory}\n */\n setBufferPolicy(policy) {\n assertUnsetBufferPolicy(this);\n this._hasSetBufferPolicy = true;\n this._hasSetConcurrencyConstraint = true;\n this._schedulerPolicyClass = policy;\n assertModifiersNotMixedWithGroup(this);\n\n return this;\n }\n\n /**\n * Sets debug mode\n *\n * @param {boolean} enabled\n * @returns {TaskFactory}\n */\n setDebug(enabled) {\n this._debug = enabled;\n return this;\n }\n\n /**\n * Sets whether Task will dispatch Task events or not\n *\n * @param {boolean} enabled\n * @returns {TaskFactory}\n */\n setEvented(enabled) {\n this._hasEnabledEvents = enabled;\n return this;\n }\n\n /**\n * Sets Scheduling policy's `maxConcurrency`\n *\n * @param {number} maxConcurrency\n * @returns {TaskFactory}\n */\n setMaxConcurrency(maxConcurrency) {\n this._hasSetConcurrencyConstraint = true;\n this._maxConcurrency = maxConcurrency;\n return this;\n }\n\n /**\n * Assigns Task created from this factory to the specified group name\n *\n * @param {string} group\n * @returns {TaskFactory}\n */\n setGroup(group) {\n this._taskGroupPath = group;\n return this;\n }\n\n /**\n * Sets the name of tasks created from this factory\n *\n * @param {string} name\n * @returns {TaskFactory}\n */\n setName(name) {\n this.name = name;\n return this;\n }\n\n /**\n * Sets the callback used on state updates. Can be set to null to disable\n * state tracking on tasks.\n *\n * @param {function} onStateCallback\n * @returns {TaskFactory}\n */\n setOnState(onStateCallback) {\n this._onStateCallback = onStateCallback;\n return this;\n }\n\n /**\n * Sets the definition for tasks created from this factory\n *\n * @param {*} taskDefinition\n * @returns {TaskFactory}\n */\n setTaskDefinition(taskDefinition) {\n this.taskDefinition = taskDefinition;\n return this;\n }\n\n _processModifierOptions(options) {\n if (!options) {\n return;\n }\n\n for (let key of Object.keys(options)) {\n let value = options[key];\n let modifier = this.getModifier(key);\n\n if (typeof modifier === 'function' && modifier(value)) {\n this._enabledModifiers.push(key);\n }\n }\n }\n}\n","export const TASK_CANCELATION_NAME = 'TaskCancelation';\n\n/**\n * Returns true if the object passed to it is a TaskCancelation error.\n * If you call `someTask.perform().catch(...)` or otherwise treat\n * a {@linkcode TaskInstance} like a promise, you may need to\n * handle the cancelation of a TaskInstance differently from\n * other kinds of errors it might throw, and you can use this\n * convenience function to distinguish cancelation from errors.\n *\n * ```js\n * click() {\n * this.myTask.perform().catch(e => {\n * if (!didCancel(e)) { throw e; }\n * });\n * }\n * ```\n *\n * @param {object} error the caught error, which might be a TaskCancelation\n * @returns {boolean}\n */\nexport function didCancel(e) {\n return e && e.name === TASK_CANCELATION_NAME;\n}\n\nexport const CANCEL_KIND_EXPLICIT = 'explicit';\nexport const CANCEL_KIND_YIELDABLE_CANCEL = 'yielded';\nexport const CANCEL_KIND_LIFESPAN_END = 'lifespan_end';\nexport const CANCEL_KIND_PARENT_CANCEL = 'parent_cancel';\n\nexport class CancelRequest {\n constructor(kind, reason) {\n this.kind = kind;\n this.reason = reason;\n this.promise = new Promise((resolve) => {\n this.finalize = resolve;\n });\n }\n}\n","export const COMPLETION_PENDING = 0;\nexport const COMPLETION_SUCCESS = 1;\nexport const COMPLETION_ERROR = 2;\nexport const COMPLETION_CANCEL = 3;\n","export class GeneratorStepResult {\n constructor(value, done, errored) {\n this.value = value;\n this.done = done;\n this.errored = errored;\n }\n}\n\nexport class GeneratorState {\n constructor(generatorFactory) {\n this.done = false;\n this.generatorFactory = generatorFactory;\n this.iterator = null;\n }\n\n step(resolvedValue, iteratorMethod) {\n try {\n let iterator = this.getIterator();\n let { value, done } = iterator[iteratorMethod](resolvedValue);\n\n if (done) {\n return this.finalize(value, false);\n } else {\n return new GeneratorStepResult(value, false, false);\n }\n } catch (e) {\n return this.finalize(e, true);\n }\n }\n\n getIterator() {\n if (!this.iterator && !this.done) {\n this.iterator = this.generatorFactory();\n }\n return this.iterator;\n }\n\n finalize(value, errored) {\n this.done = true;\n this.iterator = null;\n return new GeneratorStepResult(value, true, errored);\n }\n}\n","import { GeneratorState } from '../generator-state';\nimport { INITIAL_STATE } from './initial-state';\nimport {\n yieldableSymbol,\n YIELDABLE_CONTINUE,\n YIELDABLE_THROW,\n YIELDABLE_RETURN,\n YIELDABLE_CANCEL,\n cancelableSymbol,\n} from '../yieldables';\n\nimport {\n COMPLETION_SUCCESS,\n COMPLETION_ERROR,\n COMPLETION_CANCEL,\n} from './completion-states';\nimport {\n CancelRequest,\n CANCEL_KIND_YIELDABLE_CANCEL,\n CANCEL_KIND_LIFESPAN_END,\n CANCEL_KIND_PARENT_CANCEL,\n didCancel,\n TASK_CANCELATION_NAME,\n} from './cancelation';\n\nexport const PERFORM_TYPE_DEFAULT = 'PERFORM_TYPE_DEFAULT';\nexport const PERFORM_TYPE_UNLINKED = 'PERFORM_TYPE_UNLINKED';\nexport const PERFORM_TYPE_LINKED = 'PERFORM_TYPE_LINKED';\n\nconst CANCEL_RETURN_VALUE_SENTINEL = {};\nlet TASK_INSTANCE_STACK = [];\n\nexport function getRunningInstance() {\n return TASK_INSTANCE_STACK[TASK_INSTANCE_STACK.length - 1];\n}\n\nexport class TaskInstanceExecutor {\n constructor({ generatorFactory, env, debug }) {\n this.generatorState = new GeneratorState(generatorFactory);\n this.state = Object.assign({}, INITIAL_STATE);\n this.index = 1;\n this.disposers = [];\n this.finalizeCallbacks = [];\n this.env = env;\n this.debug = debug;\n this.cancelRequest = null;\n }\n\n start() {\n if (this.state.hasStarted || this.cancelRequest) {\n return;\n }\n this.setState({ hasStarted: true });\n this.proceedSync(YIELDABLE_CONTINUE, undefined);\n this.taskInstance.onStarted();\n }\n\n cancel(cancelRequest) {\n if (!this.requestCancel(cancelRequest)) {\n cancelRequest.finalize();\n return cancelRequest.promise;\n }\n\n if (this.state.hasStarted) {\n this.proceedWithCancelAsync();\n } else {\n this.finalizeWithCancel();\n }\n\n return this.cancelRequest.promise;\n }\n\n setState(state) {\n Object.assign(this.state, state);\n this.taskInstance.setState(this.state);\n }\n\n proceedChecked(index, yieldResumeType, value) {\n if (this.state.isFinished) {\n return;\n }\n if (!this.advanceIndex(index)) {\n return;\n }\n\n if (yieldResumeType === YIELDABLE_CANCEL) {\n this.requestCancel(\n new CancelRequest(CANCEL_KIND_YIELDABLE_CANCEL),\n value,\n );\n this.proceedWithCancelAsync();\n } else {\n this.proceedAsync(yieldResumeType, value);\n }\n }\n\n proceedWithCancelAsync() {\n this.proceedAsync(YIELDABLE_RETURN, CANCEL_RETURN_VALUE_SENTINEL);\n }\n\n proceedAsync(yieldResumeType, value) {\n this.advanceIndex(this.index);\n this.env.async(() => this.proceedSync(yieldResumeType, value));\n }\n\n proceedSync(yieldResumeType, value) {\n if (this.state.isFinished) {\n return;\n }\n\n this.dispose();\n\n if (this.generatorState.done) {\n this.handleResolvedReturnedValue(yieldResumeType, value);\n } else {\n this.handleResolvedContinueValue(yieldResumeType, value);\n }\n }\n\n /**\n * This method is called when a previously yielded value from\n * the generator has been resolved, and now it's time to pass\n * it back into the generator. There are 3 ways to \"resume\" a\n * generator:\n *\n * - call `.next(value)` on it, which is used to pass in a resolved\n * value (the fulfilled value of a promise), e.g. if a task generator fn\n * does `yield Promise.resolve(5)`, then we take that promise yielded\n * by the generator, detect that it's a promise, resolve it, and then\n * pass its fulfilled value `5` back into the generator function so\n * that it can continue executing.\n * - call `.throw(error)` on it, which throw an exception from where the\n * the generator previously yielded. We do this when the previously\n * yielded value resolves to an error value (e.g. a rejected promise\n * or a TaskInstance that finished with an error). Note that when you\n * resume a generator with a `.throw()`, it can still recover from that\n * thrown error and continue executing normally so long as the `yield`\n * was inside a `try/catch` statement.\n * - call `.return(value)` on it, causes the generator function to return\n * from where it previously `yield`ed. We use `.return()` when cancelling\n * a TaskInstance; by `.return`ing, rather than `.throw`ing, it allows\n * the generator function to skip `catch(e) {}` blocks, which is usually\n * reserved for actual errors/exceptions; if we `.throw`'d cancellations,\n * it would require all tasks that used try/catch to conditionally ignore\n * cancellations, which is annoying. So we `.return()` from generator functions\n * in the case of errors as a matter of convenience.\n *\n * @private\n */\n handleResolvedContinueValue(iteratorMethod, resumeValue) {\n let beforeIndex = this.index;\n let stepResult = this.generatorStep(resumeValue, iteratorMethod);\n\n // TODO: what is this doing? write breaking test.\n if (!this.advanceIndex(beforeIndex)) {\n return;\n }\n\n if (stepResult.errored) {\n this.finalize(stepResult.value, COMPLETION_ERROR);\n return;\n }\n\n this.handleYieldedValue(stepResult);\n }\n\n /**\n * This method is called when the generator function is all\n * out of values, and the last value returned from the function\n * (possible a thenable/yieldable/promise/etc) has been resolved.\n *\n * Possible cases:\n * - `return \"simple value\";` // resolved value is \"simple value\"\n * - `return undefined;` // (or omitted return) resolved value is undefined\n * - `return someTask.perform()` // resolved value is the value returned/resolved from someTask\n *\n * @private\n */\n handleResolvedReturnedValue(yieldResumeType, value) {\n switch (yieldResumeType) {\n case YIELDABLE_CONTINUE:\n case YIELDABLE_RETURN:\n this.finalize(value, COMPLETION_SUCCESS);\n break;\n case YIELDABLE_THROW:\n this.finalize(value, COMPLETION_ERROR);\n break;\n }\n }\n\n handleYieldedUnknownThenable(thenable) {\n let resumeIndex = this.index;\n thenable.then(\n (value) => {\n this.proceedChecked(resumeIndex, YIELDABLE_CONTINUE, value);\n },\n (error) => {\n this.proceedChecked(resumeIndex, YIELDABLE_THROW, error);\n },\n );\n }\n\n /**\n * The TaskInstance internally tracks an index/sequence number\n * (the `index` property) which gets incremented every time the\n * task generator function iterator takes a step. When a task\n * function is paused at a `yield`, there are two events that\n * cause the TaskInstance to take a step: 1) the yielded value\n * \"resolves\", thus resuming the TaskInstance's execution, or\n * 2) the TaskInstance is canceled. We need some mechanism to prevent\n * stale yielded value resolutions from resuming the TaskFunction\n * after the TaskInstance has already moved on (either because\n * the TaskInstance has since been canceled or because an\n * implementation of the Yieldable API tried to resume the\n * TaskInstance more than once). The `index` serves as\n * that simple mechanism: anyone resuming a TaskInstance\n * needs to pass in the `index` they were provided that acts\n * as a ticket to resume the TaskInstance that expires once\n * the TaskInstance has moved on.\n *\n * @private\n */\n advanceIndex(index) {\n if (this.index === index) {\n return ++this.index;\n }\n }\n\n handleYieldedValue(stepResult) {\n let yieldedValue = stepResult.value;\n if (!yieldedValue) {\n this.proceedWithSimpleValue(yieldedValue);\n return;\n }\n\n this.addDisposer(yieldedValue[cancelableSymbol]);\n\n if (yieldedValue[yieldableSymbol]) {\n this.invokeYieldable(yieldedValue);\n } else if (typeof yieldedValue.then === 'function') {\n this.handleYieldedUnknownThenable(yieldedValue);\n } else {\n this.proceedWithSimpleValue(yieldedValue);\n }\n }\n\n proceedWithSimpleValue(yieldedValue) {\n this.proceedAsync(YIELDABLE_CONTINUE, yieldedValue);\n }\n\n addDisposer(maybeDisposer) {\n if (typeof maybeDisposer !== 'function') {\n return;\n }\n\n this.disposers.push(maybeDisposer);\n }\n\n /**\n * Runs any disposers attached to the task's most recent `yield`.\n * For instance, when a task yields a TaskInstance, it registers that\n * child TaskInstance's disposer, so that if the parent task is canceled,\n * dispose() will run that disposer and cancel the child TaskInstance.\n *\n * @private\n */\n dispose() {\n let disposers = this.disposers;\n if (disposers.length === 0) {\n return;\n }\n this.disposers = [];\n disposers.forEach((disposer) => disposer());\n }\n\n /**\n * Calls .next()/.throw()/.return() on the task's generator function iterator,\n * essentially taking a single step of execution on the task function.\n *\n * @private\n */\n generatorStep(nextValue, iteratorMethod) {\n TASK_INSTANCE_STACK.push(this);\n let stepResult = this.generatorState.step(nextValue, iteratorMethod);\n TASK_INSTANCE_STACK.pop();\n\n // TODO: fix this!\n if (this._expectsLinkedYield) {\n let value = stepResult.value;\n if (!value || value.performType !== PERFORM_TYPE_LINKED) {\n // eslint-disable-next-line no-console\n console.warn(\n 'You performed a .linked() task without immediately yielding/returning it. This is currently unsupported (but might be supported in future version of ember-concurrency).',\n );\n }\n this._expectsLinkedYield = false;\n }\n\n return stepResult;\n }\n\n maybeResolveDefer() {\n if (!this.defer || !this.state.isFinished) {\n return;\n }\n\n if (this.state.completionState === COMPLETION_SUCCESS) {\n this.defer.resolve(this.state.value);\n } else {\n this.defer.reject(this.state.error);\n }\n }\n\n onFinalize(callback) {\n this.finalizeCallbacks.push(callback);\n\n if (this.state.isFinished) {\n this.runFinalizeCallbacks();\n }\n }\n\n runFinalizeCallbacks() {\n this.finalizeCallbacks.forEach((cb) => cb());\n this.finalizeCallbacks = [];\n this.maybeResolveDefer();\n this.maybeThrowUnhandledTaskErrorLater();\n }\n\n promise() {\n if (!this.defer) {\n this.defer = this.env.defer();\n this.asyncErrorsHandled = true;\n this.maybeResolveDefer();\n }\n return this.defer.promise;\n }\n\n maybeThrowUnhandledTaskErrorLater() {\n if (\n !this.asyncErrorsHandled &&\n this.state.completionState === COMPLETION_ERROR &&\n !didCancel(this.state.error)\n ) {\n this.env.async(() => {\n if (!this.asyncErrorsHandled) {\n this.env.reportUncaughtRejection(this.state.error);\n }\n });\n }\n }\n\n requestCancel(request) {\n if (this.cancelRequest || this.state.isFinished) {\n return false;\n }\n this.cancelRequest = request;\n return true;\n }\n\n finalize(value, completionState) {\n if (this.cancelRequest) {\n return this.finalizeWithCancel();\n }\n\n let state = { completionState };\n\n if (completionState === COMPLETION_SUCCESS) {\n state.isSuccessful = true;\n state.value = value;\n } else if (completionState === COMPLETION_ERROR) {\n state.isError = true;\n state.error = value;\n } else if (completionState === COMPLETION_CANCEL) {\n state.error = value;\n }\n\n this.finalizeShared(state);\n }\n\n finalizeWithCancel() {\n let cancelReason = this.taskInstance.formatCancelReason(\n this.cancelRequest.reason,\n );\n let error = new Error(cancelReason);\n\n if (this.debugEnabled()) {\n // eslint-disable-next-line no-console\n console.log(cancelReason);\n }\n\n error.name = TASK_CANCELATION_NAME;\n\n this.finalizeShared({\n isCanceled: true,\n completionState: COMPLETION_CANCEL,\n error,\n cancelReason,\n });\n\n this.cancelRequest.finalize();\n }\n\n debugEnabled() {\n return this.debug || this.env.globalDebuggingEnabled();\n }\n\n finalizeShared(state) {\n this.index++;\n state.isFinished = true;\n this.setState(state);\n this.runFinalizeCallbacks();\n this.dispatchFinalizeEvents(state.completionState);\n }\n\n dispatchFinalizeEvents(completionState) {\n switch (completionState) {\n case COMPLETION_SUCCESS:\n this.taskInstance.onSuccess();\n break;\n case COMPLETION_ERROR:\n this.taskInstance.onError(this.state.error);\n break;\n case COMPLETION_CANCEL:\n this.taskInstance.onCancel(this.state.cancelReason);\n break;\n }\n }\n\n invokeYieldable(yieldedValue) {\n try {\n let maybeDisposer = yieldedValue[yieldableSymbol](\n this.taskInstance,\n this.index,\n );\n this.addDisposer(maybeDisposer);\n } catch (e) {\n this.env.reportUncaughtRejection(e);\n }\n }\n\n /**\n * `onYielded` is called when this task instance has been\n * yielded in another task instance's execution. We take\n * this opportunity to conditionally link up the tasks\n * so that when the parent or child cancels, the other\n * is cancelled.\n *\n * Given the following case:\n *\n * ```js\n * parentTask: task(function * () {\n * yield otherTask.perform();\n * })\n * ```\n *\n * Then the `parent` param is the task instance that is executing, `this`\n * is the `otherTask` task instance that was yielded.\n *\n * @private\n */\n onYielded(parent, resumeIndex) {\n this.asyncErrorsHandled = true;\n\n this.onFinalize(() => {\n let completionState = this.state.completionState;\n if (completionState === COMPLETION_SUCCESS) {\n parent.proceed(resumeIndex, YIELDABLE_CONTINUE, this.state.value);\n } else if (completionState === COMPLETION_ERROR) {\n parent.proceed(resumeIndex, YIELDABLE_THROW, this.state.error);\n } else if (completionState === COMPLETION_CANCEL) {\n parent.proceed(resumeIndex, YIELDABLE_CANCEL, null);\n }\n });\n\n let performType = this.getPerformType();\n if (performType === PERFORM_TYPE_UNLINKED) {\n return;\n }\n\n return () => {\n this.detectSelfCancelLoop(performType, parent);\n this.cancel(new CancelRequest(CANCEL_KIND_PARENT_CANCEL));\n };\n }\n\n getPerformType() {\n return this.taskInstance.performType || PERFORM_TYPE_DEFAULT;\n }\n\n detectSelfCancelLoop(performType, parent) {\n if (performType !== PERFORM_TYPE_DEFAULT) {\n return;\n }\n\n let parentCancelRequest = parent.executor && parent.executor.cancelRequest;\n\n // Detect that the parent was cancelled by a lifespan ending and\n // that the child is still running and not cancelled.\n if (\n parentCancelRequest &&\n parentCancelRequest.kind === CANCEL_KIND_LIFESPAN_END &&\n !this.cancelRequest &&\n !this.state.isFinished\n ) {\n this.taskInstance.selfCancelLoopWarning(parent);\n }\n }\n}\n","import { COMPLETION_PENDING } from './completion-states';\n\nexport const INITIAL_STATE = {\n completionState: COMPLETION_PENDING,\n\n /**\n * If this TaskInstance runs to completion by returning a property\n * other than a rejecting promise, this property will be set\n * with that value.\n *\n * @memberof TaskInstance\n * @instance\n * @readOnly\n */\n value: null,\n\n /**\n * If this TaskInstance is canceled or throws an error (or yields\n * a promise that rejects), this property will be set with that error.\n * Otherwise, it is null.\n *\n * @memberof TaskInstance\n * @instance\n * @readOnly\n */\n error: null,\n\n /**\n * True if the task instance is fulfilled.\n *\n * @memberof TaskInstance\n * @instance\n * @readOnly\n */\n isSuccessful: false,\n\n /**\n * True if the task instance resolves to a rejection.\n *\n * @memberof TaskInstance\n * @instance\n * @readOnly\n */\n isError: false,\n\n /**\n * True if the task instance is canceled\n *\n * @memberof TaskInstance\n * @instance\n * @readOnly\n */\n isCanceled: false,\n\n /**\n * True if the task instance has started, else false.\n *\n * @memberof TaskInstance\n * @instance\n * @readOnly\n */\n hasStarted: false,\n\n /**\n * True if the task has run to completion.\n *\n * @memberof TaskInstance\n * @instance\n * @readOnly\n */\n isFinished: false,\n};\n","export const DEFAULT_STATE = {\n last: null,\n lastRunning: null,\n lastPerformed: null,\n lastSuccessful: null,\n lastComplete: null,\n lastErrored: null,\n lastCanceled: null,\n lastIncomplete: null,\n performCount: 0,\n};\n\nObject.freeze(DEFAULT_STATE);\n","import { Taskable } from './taskable';\n\nexport class TaskGroup extends Taskable {}\n","import { Taskable } from './taskable';\nimport {\n PERFORM_TYPE_DEFAULT,\n PERFORM_TYPE_LINKED,\n PERFORM_TYPE_UNLINKED,\n getRunningInstance,\n TaskInstanceExecutor,\n} from '../task-instance/executor';\n\nclass TaskLinkProxy {\n constructor(task, performType, linkedObject) {\n this.task = task;\n this.performType = performType;\n this.linkedObject = linkedObject;\n }\n\n perform(...args) {\n return this.task._performShared(args, this.performType, this.linkedObject);\n }\n}\n\nexport class Task extends Taskable {\n constructor(options) {\n super(options);\n this.generatorFactory = options.generatorFactory;\n this.perform = this._perform.bind(this);\n }\n\n linked() {\n let linkedObject = getRunningInstance();\n if (!linkedObject) {\n throw new Error(`You can only call .linked() from within a task.`);\n }\n\n return new TaskLinkProxy(this, PERFORM_TYPE_LINKED, linkedObject);\n }\n\n unlinked() {\n return new TaskLinkProxy(this, PERFORM_TYPE_UNLINKED, null);\n }\n\n toString() {\n return ``;\n }\n\n _clone() {\n return new Task({\n context: this.context,\n debug: this.debug,\n env: this.env,\n generatorFactory: this.generatorFactory,\n group: this.group,\n hasEnabledEvents: this.hasEnabledEvents,\n name: this.name,\n onStateCallback: this.onStateCallback,\n scheduler: this.scheduler,\n });\n }\n\n _curry(...args) {\n let task = this._clone();\n task._curryArgs = [...(this._curryArgs || []), ...args];\n return task;\n }\n\n _perform(...args) {\n return this._performShared(args, PERFORM_TYPE_DEFAULT, null);\n }\n\n _performShared(args, performType, linkedObject) {\n let fullArgs = this._curryArgs ? [...this._curryArgs, ...args] : args;\n let taskInstance = this._taskInstanceFactory(\n fullArgs,\n performType,\n linkedObject,\n );\n\n if (performType === PERFORM_TYPE_LINKED) {\n linkedObject._expectsLinkedYield = true;\n }\n\n if (!this._isAlive) {\n // a task linked to a dead lifetime should immediately cancel.\n taskInstance.cancel();\n }\n\n this.scheduler.perform(taskInstance);\n return taskInstance;\n }\n\n // eslint-disable-next-line no-unused-vars\n _taskInstanceOptions(args, performType, _linkedObject) {\n let generatorFactory = () => this.generatorFactory(args);\n let taskInstanceOptions = {\n task: this,\n args,\n executor: new TaskInstanceExecutor({\n generatorFactory,\n env: this.env,\n debug: this.debug,\n }),\n performType,\n hasEnabledEvents: this.hasEnabledEvents,\n };\n\n return taskInstanceOptions;\n }\n}\n","import { DEFAULT_STATE } from './default-state';\nimport {\n CancelRequest,\n CANCEL_KIND_EXPLICIT,\n} from '../task-instance/cancelation';\n\nlet guidId = 0;\nfunction makeGuid() {\n return `ec_${guidId++}`;\n}\n\nexport class Taskable {\n constructor(options) {\n this.context = options.context;\n this.debug = options.debug || false;\n this.enabledModifiers = options.enabledModifiers;\n this.env = options.env;\n this.group = options.group;\n this.hasEnabledEvents = options.hasEnabledEvents;\n this.modifierOptions = options.modifierOptions;\n this.name = options.name;\n this.onStateCallback = options.onStateCallback;\n this.scheduler = options.scheduler;\n\n this.guid = makeGuid();\n this.guids = {};\n this.guids[this.guid] = true;\n if (this.group) {\n Object.assign(this.guids, this.group.guids);\n }\n }\n\n cancelAll(options) {\n let { reason, cancelRequestKind, resetState } = options || {};\n reason = reason || '.cancelAll() was explicitly called on the Task';\n\n let cancelRequest = new CancelRequest(\n cancelRequestKind || CANCEL_KIND_EXPLICIT,\n reason,\n );\n return this.scheduler.cancelAll(this.guid, cancelRequest).then(() => {\n if (resetState) {\n this._resetState();\n }\n });\n }\n\n get _isAlive() {\n return true;\n }\n\n _resetState() {\n this.setState(DEFAULT_STATE);\n }\n\n // override\n setState() {}\n}\n\nObject.assign(Taskable.prototype, DEFAULT_STATE);\nObject.assign(Taskable.prototype, {\n numRunning: 0,\n numQueued: 0,\n isRunning: false,\n isQueued: false,\n isIdle: true,\n state: 'idle',\n});\n","export const cancelableSymbol = '__ec_cancel__';\nexport const yieldableSymbol = '__ec_yieldable__';\nexport const YIELDABLE_CONTINUE = 'next';\nexport const YIELDABLE_THROW = 'throw';\nexport const YIELDABLE_RETURN = 'return';\nexport const YIELDABLE_CANCEL = 'cancel';\n\n/**\n * @class YieldableState\n * @hideconstructor\n */\nclass YieldableState {\n constructor(taskInstance, resumeIndex) {\n this._taskInstance = taskInstance;\n this._resumeIndex = resumeIndex;\n }\n\n /**\n * Return yielded TaskInstance. Useful for introspection on instance state.\n * @method getTaskInstance\n * @memberof YieldableState\n * @public\n * @instance\n */\n getTaskInstance() {\n return this._taskInstance;\n }\n\n /**\n * Cancel the yielded TaskInstance.\n * @method cancel\n * @memberof YieldableState\n * @public\n * @instance\n */\n cancel() {\n let taskInstance = this._taskInstance;\n taskInstance.proceed.call(\n taskInstance,\n this._resumeIndex,\n YIELDABLE_CANCEL,\n );\n }\n\n /**\n * Cause the TaskInstance to return from its yield with an optional value,\n * and continue executing.\n * @method next\n * @memberof YieldableState\n * @param value\n * @public\n * @instance\n */\n next(value) {\n let taskInstance = this._taskInstance;\n taskInstance.proceed.call(\n taskInstance,\n this._resumeIndex,\n YIELDABLE_CONTINUE,\n value,\n );\n }\n\n /**\n * Short-circuit TaskInstance execution and have it return with an optional\n * value.\n * @method return\n * @memberof YieldableState\n * @param value\n * @public\n * @instance\n */\n return(value) {\n let taskInstance = this._taskInstance;\n taskInstance.proceed.call(\n taskInstance,\n this._resumeIndex,\n YIELDABLE_RETURN,\n value,\n );\n }\n\n /**\n * Raise a given error within the given task instance and halt execution\n * @method throw\n * @memberof YieldableState\n * @param error\n * @public\n * @instance\n */\n throw(error) {\n let taskInstance = this._taskInstance;\n taskInstance.proceed.call(\n taskInstance,\n this._resumeIndex,\n YIELDABLE_THROW,\n error,\n );\n }\n}\n\n/**\n * Yieldables are a primitive for building safe, cancelation-aware ways to\n * instrument and introspect the runtime of a task. Many Yieldables are built-in\n * to ember-concurrency today, such as `timeout`, `animationFrame`, and\n * `rawTimeout`.\n *\n * For example, if I wanted to implement a yieldable for `requestIdleCallback`,\n * I could do the following:\n *\n * ```javascript\n * import Component from '@glimmer/component';\n * import { task, Yieldable } from 'ember-concurrency';\n *\n * class IdleCallbackYieldable extends Yieldable {\n * onYield(state) {\n * let callbackId = requestIdleCallback(() => state.next());\n *\n * return () => cancelIdleCallback(callbackId);\n * }\n * }\n *\n * const idleCallback = () => new IdleCallbackYieldable();\n *\n * class MyComponent extends Component {\n * @task *backgroundTask() {\n * while (1) {\n * yield idleCallback();\n *\n * const data = this.complicatedNumberCrunching();\n * yield this.sendData(data);\n * }\n * }\n * }\n * ```\n *\n * In general, `Yieldable` instances **should** be reusable across calls, and thus\n * care should be taken to ensure that teardown is provided and state not\n * intended to be shared across calls stay inside `onYield`.\n *\n * `Yieldable` also provides automatic Promise-casting.\n *\n * \n *\n * @class Yieldable\n */\nexport class Yieldable {\n constructor() {\n this[yieldableSymbol] = this[yieldableSymbol].bind(this);\n }\n\n /**\n * Defines what happens when the task encounters `yield myYieldable` and returns\n * a disposer function that handles any cleanup.\n *\n * The state parameter is provided by the runtime, and provides operations for\n * interacting with the yielding task instance and advancing, returning,\n * throwing, or canceling its execution.\n *\n * @method onYield\n * @memberof Yieldable\n * @param {YieldableState} state\n * @instance\n * @public\n */\n onYield() {}\n\n _deferable() {\n let def = { resolve: undefined, reject: undefined };\n\n def.promise = new Promise((resolve, reject) => {\n def.resolve = resolve;\n def.reject = reject;\n });\n\n return def;\n }\n\n _toPromise() {\n let def = this._deferable();\n\n let thinInstance = {\n proceed(_index, resumeType, value) {\n if (\n resumeType == YIELDABLE_CONTINUE ||\n resumeType == YIELDABLE_RETURN\n ) {\n def.resolve(value);\n } else {\n def.reject(value);\n }\n },\n };\n\n let maybeDisposer = this[yieldableSymbol](thinInstance, 0);\n def.promise[cancelableSymbol] = maybeDisposer;\n\n return def.promise;\n }\n\n /**\n * Returns a promise that resolves with the value yielded back to or returned\n * to the yielded task, or rejects with either the exception thrown from the\n * Yieldable, or an error with a `.name` property with value `\"TaskCancelation\"`.\n *\n * @method then\n * @memberof Yieldable\n * @instance\n * @return {Promise}\n */\n then(...args) {\n return this._toPromise().then(...args);\n }\n\n /**\n * @method catch\n * @memberof Yieldable\n * @instance\n * @return {Promise}\n */\n catch(...args) {\n return this._toPromise().catch(...args);\n }\n\n /**\n * @method finally\n * @memberof Yieldable\n * @instance\n * @return {Promise}\n */\n finally(...args) {\n return this._toPromise().finally(...args);\n }\n\n [yieldableSymbol](taskInstance, resumeIndex) {\n let state = new YieldableState(taskInstance, resumeIndex);\n\n return this.onYield(state);\n }\n}\n\nclass AnimationFrameYieldable extends Yieldable {\n onYield(state) {\n let timerId = requestAnimationFrame(() => state.next());\n\n return () => cancelAnimationFrame(timerId);\n }\n}\n\nclass ForeverYieldable extends Yieldable {\n onYield() {}\n}\n\nclass RawTimeoutYieldable extends Yieldable {\n constructor(ms) {\n super();\n this.ms = ms;\n }\n\n onYield(state) {\n let timerId = setTimeout(() => state.next(), this.ms);\n\n return () => clearTimeout(timerId);\n }\n}\n\n/**\n * Yielding `animationFrame()` will pause a task until after the next animation\n * frame using the native `requestAnimationFrame()` browser API.\n *\n * The task below, when performed, will print the time since the last loop run\n * for every animation frame.\n *\n * ```js\n * export default class MyComponent extends Component {\n * @task *myTask() {\n * let lastNow = performance.now();\n * while (true) {\n * yield animationFrame();\n *\n * let now = performance.now();\n * let dt = now - lastNow;\n * lastNow = now;\n *\n * console.log(dt);\n * }\n * }\n * }\n * ```\n */\nexport function animationFrame() {\n return new AnimationFrameYieldable();\n}\n\n/**\n *\n * Yielding `forever` will pause a task indefinitely until\n * it is cancelled (i.e. via host object destruction, the restartable modifier,\n * or manual cancellation).\n *\n * This is often useful in cases involving animation: if you're\n * using Liquid Fire, or some other animation scheme, sometimes you'll\n * notice buttons visibly reverting to their inactive states during\n * a route transition. By yielding `forever` in a Component task that drives a\n * button's active state, you can keep a task indefinitely running\n * until the animation runs to completion.\n *\n * NOTE: Liquid Fire also includes a useful `waitUntilIdle()` method\n * on the `liquid-fire-transitions` service that you can use in a lot\n * of these cases, but it won't cover cases of asynchrony that are\n * unrelated to animation, in which case `forever` might be better suited\n * to your needs.\n *\n * ```js\n * import { task, forever } from 'ember-concurrency';\n * export default class MyComponent extends Component {\n * @service myService;\n * @task *myTask() {\n * yield this.myService.doSomethingThatCausesATransition();\n * yield forever;\n * }\n * }\n * ```\n */\nexport const forever = new ForeverYieldable();\n\n/**\n *\n * Yielding `rawTimeout(ms)` will pause a task for the duration\n * of time passed in, in milliseconds.\n *\n * The timeout will use the native `setTimeout()` browser API,\n * instead of the Ember runloop, which means that test helpers\n * will *not* wait for it to complete.\n *\n * The task below, when performed, will print a message to the\n * console every second.\n *\n * ```js\n * export default class MyComponent extends Component {\n * @task *myTask() {\n * while (true) {\n * console.log(\"Hello!\");\n * yield rawTimeout(1000);\n * }\n * }\n * }\n * ```\n *\n * @param {number} ms - the amount of time to sleep before resuming\n * the task, in milliseconds\n */\nexport function rawTimeout(ms) {\n return new RawTimeoutYieldable(ms);\n}\n","import Scheduler from '../external/scheduler/scheduler';\nimport { once } from '@ember/runloop';\n\nclass EmberScheduler extends Scheduler {\n scheduleRefresh() {\n once(this, this.refresh);\n }\n}\n\nexport default EmberScheduler;\n","import { assert } from '@ember/debug';\nimport { get } from '@ember/object';\nimport { addListener } from '@ember/object/events';\nimport { addObserver } from '@ember/object/observers';\nimport { scheduleOnce } from '@ember/runloop';\nimport {\n registerModifier,\n TaskFactory as BaseTaskFactory,\n} from './external/task-factory';\n\nimport { Task, EncapsulatedTask } from './task';\nimport { TaskProperty } from './task-properties';\nimport { TaskGroup } from './task-group';\nimport EmberScheduler from './scheduler/ember-scheduler';\nimport { EMBER_ENVIRONMENT } from './ember-environment';\n\nlet handlerCounter = 0;\n\nfunction registerOnPrototype(\n addListenerOrObserver,\n proto,\n names,\n taskName,\n taskMethod,\n once,\n) {\n if (names && names.length > 0) {\n for (let i = 0; i < names.length; ++i) {\n let name = names[i];\n\n let handlerName = `__ember_concurrency_handler_${handlerCounter++}`;\n proto[handlerName] = makeTaskCallback(taskName, taskMethod, once);\n addListenerOrObserver(proto, name, null, handlerName);\n }\n }\n}\n\nfunction makeTaskCallback(taskName, method, once) {\n return function () {\n let task = get(this, taskName);\n\n if (once) {\n scheduleOnce('actions', task, method, ...arguments);\n } else {\n task[method].apply(task, arguments);\n }\n };\n}\n\nconst ensureArray = (possibleArr) =>\n Array.isArray(possibleArr) ? possibleArr : [possibleArr];\n\nregisterModifier('cancelOn', (factory, eventNames) =>\n factory.addCancelEvents(...ensureArray(eventNames)),\n);\nregisterModifier('observes', (factory, propertyPaths) =>\n factory.addObserverKeys(...ensureArray(propertyPaths)),\n);\nregisterModifier('on', (factory, eventNames) =>\n factory.addPerformEvents(...ensureArray(eventNames)),\n);\n\nexport class TaskFactory extends BaseTaskFactory {\n env = EMBER_ENVIRONMENT;\n\n createTask(context) {\n assert(\n `Cannot create task if a task definition is not provided as generator function or encapsulated task.`,\n this.taskDefinition,\n );\n\n let options = this.getTaskOptions(context);\n\n if (typeof this.taskDefinition === 'object') {\n return new EncapsulatedTask(\n Object.assign({ taskObj: this.taskDefinition }, options),\n );\n } else {\n return new Task(\n Object.assign(\n {\n generatorFactory: (args) =>\n this.taskDefinition.apply(context, args),\n },\n options,\n ),\n );\n }\n }\n\n createTaskGroup(context) {\n assert(\n `A task definition is not expected for a task group.`,\n !this.taskDefinition,\n );\n let options = this.getTaskOptions(context);\n\n return new TaskGroup(options);\n }\n\n addCancelEvents(...cancelEventNames) {\n this._cancelEventNames = this._cancelEventNames || [];\n this._cancelEventNames.push(...cancelEventNames);\n return this;\n }\n\n addObserverKeys(...keys) {\n this._observes = this._observes || [];\n this._observes.push(...keys);\n return this;\n }\n\n addPerformEvents(...eventNames) {\n this._eventNames = this._eventNames || [];\n this._eventNames.push(...eventNames);\n return this;\n }\n\n getModifier(name) {\n let modifier = super.getModifier(name);\n if (!modifier && typeof TaskProperty.prototype[name] === 'function') {\n // Shim for compatibility with user-defined TaskProperty prototype\n // extensions. To be removed when replaced with proper public API.\n modifier = TaskProperty.prototype[name].bind(this);\n }\n\n assert(\n `Task option '${name}' is not recognized as a supported option.`,\n modifier,\n );\n\n return modifier;\n }\n\n getScheduler(schedulerPolicy, stateTrackingEnabled) {\n return new EmberScheduler(schedulerPolicy, stateTrackingEnabled);\n }\n\n _setupEmberKVO(proto) {\n // TODO: Does this make sense in a post-Ember object world?\n\n registerOnPrototype(\n addListener,\n proto,\n this._eventNames,\n this.name,\n 'perform',\n false,\n );\n registerOnPrototype(\n addListener,\n proto,\n this._cancelEventNames,\n this.name,\n 'cancelAll',\n false,\n );\n registerOnPrototype(\n addObserver,\n proto,\n this._observes,\n this.name,\n 'perform',\n true,\n );\n }\n\n // Provided for compatibility with ember-concurrency TaskProperty extension\n // methods\n get taskFn() {\n return this.taskDefinition;\n }\n\n set taskFn(fn) {\n this.setTaskDefinition(fn);\n }\n}\n","import { TaskGroup as TaskGroupBase } from './external/task/task-group';\nimport { TASKABLE_MIXIN } from './taskable-mixin';\nimport { TRACKED_INITIAL_TASK_STATE } from './tracked-state';\n\n/**\n * \"Task Groups\" provide a means for applying\n * task modifiers to groups of tasks. Once a {@linkcode Task} is declared\n * as part of a group task, modifiers like `drop` or `restartable`\n * will no longer affect the individual `Task`. Instead those\n * modifiers can be applied to the entire group.\n *\n * Turns the decorated property into a task group.\n *\n * Optionally takes a hash of options that will be applied as modifiers to the\n * task group. For instance `maxConcurrency` or `keepLatest`.\n *\n * ```js\n * import Component from '@glimmer/component';\n * import { task, taskGroup } from 'ember-concurrency';\n *\n * class MyComponent extends Component {\n * @taskGroup({ maxConcurrency: 5 }) chores;\n *\n * @task({ group: 'chores' })\n * *mowLawn() {}\n *\n * @task({ group: 'chores' })\n * *doDishes() {}\n * }\n * ```\n *\n * \n *\n * @class TaskGroup\n */\nexport class TaskGroup extends TaskGroupBase {\n /**\n * Cancels all running or queued `TaskInstance`s for this task group.\n * If you're trying to cancel a specific TaskInstance (rather\n * than all of the instances running under this task group) call\n * `.cancel()` on the specific TaskInstance.\n *\n * @method cancelAll\n * @memberof TaskGroup\n * @param options.reason A descriptive reason the task group was\n * cancelled. Defaults to `\".cancelAll() was explicitly called\n * on the Task\"`.\n * @param options.resetState If true, will clear the task group state\n * (`last*` and `performCount` properties will be set to initial\n * values). Defaults to false.\n * @instance\n * @async\n *\n */\n /**\n * `true` if any current task instances are running.\n *\n * @memberof TaskGroup\n * @member {boolean} isRunning\n * @instance\n * @readOnly\n */\n /**\n * `true` if any future task instances are queued.\n *\n * @memberof TaskGroup\n * @member {boolean} isQueued\n * @instance\n * @readOnly\n */\n /**\n * `true` if the task is not in the running or queued state.\n *\n * @memberof TaskGroup\n * @member {boolean} isIdle\n * @instance\n * @readOnly\n */\n /**\n * The current state of the task: `\"running\"`, `\"queued\"` or `\"idle\"`.\n *\n * @memberof TaskGroup\n * @member {string} state\n * @instance\n * @readOnly\n */\n /**\n * The most recently started task instance.\n *\n * @memberof TaskGroup\n * @member {TaskInstance} last\n * @instance\n * @readOnly\n */\n /**\n * The most recent task instance that is currently running.\n *\n * @memberof TaskGroup\n * @member {TaskInstance} lastRunning\n * @instance\n * @readOnly\n */\n /**\n * The most recently performed task instance.\n *\n * @memberof TaskGroup\n * @member {TaskInstance} lastPerformed\n * @instance\n * @readOnly\n */\n /**\n * The most recent task instance that succeeded.\n *\n * @memberof TaskGroup\n * @member {TaskInstance} lastSuccessful\n * @instance\n * @readOnly\n */\n /**\n * The most recently completed task instance.\n *\n * @memberof TaskGroup\n * @member {TaskInstance} lastComplete\n * @instance\n * @readOnly\n */\n /**\n * The most recent task instance that errored.\n *\n * @memberof TaskGroup\n * @member {TaskInstance} lastErrored\n * @instance\n * @readOnly\n */\n /**\n * The most recently canceled task instance.\n *\n * @memberof TaskGroup\n * @member {TaskInstance} lastCanceled\n * @instance\n * @readOnly\n */\n /**\n * The most recent task instance that is incomplete.\n *\n * @memberof TaskGroup\n * @member {TaskInstance} lastIncomplete\n * @instance\n * @readOnly\n */\n /**\n * The number of times this task has been performed.\n *\n * @memberof TaskGroup\n * @member {number} performCount\n * @instance\n * @readOnly\n */\n}\n\nif (TRACKED_INITIAL_TASK_STATE) {\n Object.defineProperties(TaskGroup.prototype, TRACKED_INITIAL_TASK_STATE);\n}\n\nObject.assign(TaskGroup.prototype, TASKABLE_MIXIN);\n","import { INITIAL_STATE } from './initial-state';\nimport { yieldableSymbol } from '../yieldables';\nimport { CancelRequest, CANCEL_KIND_EXPLICIT } from './cancelation';\nconst EXPLICIT_CANCEL_REASON = '.cancel() was explicitly called';\n\nexport class BaseTaskInstance {\n constructor({ task, args, executor, performType, hasEnabledEvents }) {\n this.task = task;\n this.args = args;\n this.performType = performType;\n this.executor = executor;\n this.executor.taskInstance = this;\n this.hasEnabledEvents = hasEnabledEvents;\n }\n\n setState() {}\n onStarted() {}\n onSuccess() {}\n onError() {}\n onCancel() {}\n formatCancelReason() {}\n selfCancelLoopWarning() {}\n\n onFinalize(callback) {\n this.executor.onFinalize(callback);\n }\n\n proceed(index, yieldResumeType, value) {\n this.executor.proceedChecked(index, yieldResumeType, value);\n }\n\n [yieldableSymbol](parentTaskInstance, resumeIndex) {\n return this.executor.onYielded(parentTaskInstance, resumeIndex);\n }\n\n cancel(cancelReason = EXPLICIT_CANCEL_REASON) {\n this.executor.cancel(new CancelRequest(CANCEL_KIND_EXPLICIT, cancelReason));\n }\n\n then(...args) {\n return this.executor.promise().then(...args);\n }\n\n catch(...args) {\n return this.executor.promise().catch(...args);\n }\n\n finally(...args) {\n return this.executor.promise().finally(...args);\n }\n\n toString() {\n return `${this.task} TaskInstance`;\n }\n\n start() {\n this.executor.start();\n return this;\n }\n}\n\nObject.assign(BaseTaskInstance.prototype, INITIAL_STATE);\nObject.assign(BaseTaskInstance.prototype, {\n state: 'waiting',\n isDropped: false,\n isRunning: true,\n});\n","import { BaseTaskInstance } from './external/task-instance/base';\nimport { TRACKED_INITIAL_INSTANCE_STATE } from './tracked-state';\n\n/**\n A `TaskInstance` represent a single execution of a\n {@linkcode Task}. Every call to {@linkcode Task#perform} returns\n a `TaskInstance`.\n\n `TaskInstance`s are cancelable, either explicitly\n via {@linkcode TaskInstance#cancel} or {@linkcode Task#cancelAll},\n or automatically due to the host object being destroyed, or\n because concurrency policy enforced by a\n {@linkcode TaskProperty Task Modifier} canceled the task instance.\n\n \n\n @class TaskInstance\n*/\n\nexport class TaskInstance extends BaseTaskInstance {\n setState(props) {\n let state = this._recomputeState(props);\n Object.assign(this, {\n ...props,\n isRunning: !props.isFinished,\n isDropped: state === 'dropped',\n state,\n });\n }\n\n _recomputeState(props) {\n if (props.isDropped) {\n return 'dropped';\n } else if (props.isCanceled) {\n if (props.hasStarted) {\n return 'canceled';\n } else {\n return 'dropped';\n }\n } else if (props.isFinished) {\n return 'finished';\n } else if (props.hasStarted) {\n return 'running';\n } else {\n return 'waiting';\n }\n }\n\n onStarted() {\n this.triggerEvent('started', this);\n }\n\n onSuccess() {\n this.triggerEvent('succeeded', this);\n }\n\n onError(error) {\n this.triggerEvent('errored', this, error);\n }\n\n onCancel(cancelReason) {\n this.triggerEvent('canceled', this, cancelReason);\n }\n\n formatCancelReason(reason) {\n return `TaskInstance '${this.getName()}' was canceled because ${reason}. For more information, see: http://ember-concurrency.com/docs/task-cancelation-help`;\n }\n\n getName() {\n if (!this.name) {\n this.name = (this.task && this.task.name) || '';\n }\n return this.name;\n }\n\n selfCancelLoopWarning(parent) {\n let parentName = `\\`${parent.getName()}\\``;\n let childName = `\\`${this.getName()}\\``;\n // eslint-disable-next-line no-console\n console.warn(\n `ember-concurrency detected a potentially hazardous \"self-cancel loop\" between parent task ${parentName} and child task ${childName}. If you want child task ${childName} to be canceled when parent task ${parentName} is canceled, please change \\`.perform()\\` to \\`.linked().perform()\\`. If you want child task ${childName} to keep running after parent task ${parentName} is canceled, change it to \\`.unlinked().perform()\\``,\n );\n }\n\n triggerEvent(...allArgs) {\n if (!this.hasEnabledEvents) {\n return;\n }\n\n let taskInstance = this;\n let task = taskInstance.task;\n let host = task.context;\n let eventNamespace = task && task.name;\n\n if (host && host.trigger && eventNamespace) {\n let [eventType, ...args] = allArgs;\n host.trigger(`${eventNamespace}:${eventType}`, ...args);\n }\n }\n\n /**\n * Describes the state that the task instance is in. Can be used for debugging,\n * or potentially driving some UI state. Possible values are:\n *\n * - `\"dropped\"`: task instance was canceled before it started\n * - `\"canceled\"`: task instance was canceled before it could finish\n * - `\"finished\"`: task instance ran to completion (even if an exception was thrown)\n * - `\"running\"`: task instance is currently running (returns true even if\n * is paused on a yielded promise)\n * - `\"waiting\"`: task instance hasn't begun running yet (usually\n * because the task is using the {@linkcode TaskProperty#enqueue enqueue}\n * task modifier)\n *\n * The animated timeline examples on the [Task Concurrency](/docs/task-concurrency)\n * docs page make use of this property.\n *\n * @name state\n * @memberof TaskInstance\n * @instance\n * @readOnly\n */\n\n /**\n * True if the TaskInstance was canceled before it could\n * ever start running. For example, calling\n * {@linkcode Task#perform .perform()} twice on a\n * task with the {@linkcode TaskProperty#drop drop} modifier applied\n * will result in the second task instance being dropped.\n *\n * @name isDropped\n * @memberof TaskInstance\n * @instance\n * @readOnly\n */\n\n /**\n * True if the task is still running.\n *\n * @name isRunning\n * @memberof TaskInstance\n * @instance\n * @readOnly\n */\n\n /**\n * Event emitted when a new {@linkcode TaskInstance} starts executing.\n *\n * `on` from `@ember/object/evented` may be used to create a binding on the host object to the event.\n *\n * ```js\n * export default Component.extend({\n * doSomething: task(function * () {\n * // ... does something\n * }),\n *\n * onDoSomethingStarted: on('doSomething:started', function (taskInstance) {\n * // ...\n * })\n * });\n * ```\n *\n * @event TaskInstance#TASK_NAME:started\n * @param {TaskInstance} taskInstance - Task instance that was started\n */\n\n /**\n * Event emitted when a {@linkcode TaskInstance} succeeds.\n *\n * `on` from `@ember/object/evented` may be used to create a binding on the host object to the event.\n *\n * ```js\n * export default Component.extend({\n * doSomething: task(function * () {\n * // ... does something\n * }),\n *\n * onDoSomethingSucceeded: on('doSomething:succeeded', function (taskInstance) {\n * // ...\n * })\n * });\n * ```\n *\n * @event TaskInstance#TASK_NAME:succeeded\n * @param {TaskInstance} taskInstance - Task instance that was succeeded\n */\n\n /**\n * Event emitted when a {@linkcode TaskInstance} throws an an error that is\n * not handled within the task itself.\n *\n * `on` from `@ember/object/evented` may be used to create a binding on the host object to the event.\n *\n * ```js\n * export default Component.extend({\n * doSomething: task(function * () {\n * // ... does something\n * }),\n *\n * onDoSomethingErrored: on('doSomething:errored', function (taskInstance, error) {\n * // ...\n * })\n * });\n * ```\n *\n * @event TaskInstance#TASK_NAME:errored\n * @param {TaskInstance} taskInstance - Task instance that was started\n * @param {Error} error - Error that was thrown by the task instance\n */\n\n /**\n * Event emitted when a {@linkcode TaskInstance} is canceled.\n *\n * `on` from `@ember/object/evented` may be used to create a binding on the host object to the event.\n *\n * ```js\n * export default Component.extend({\n * doSomething: task(function * () {\n * // ... does something\n * }),\n *\n * onDoSomethingCanceled: on('doSomething:canceled', function (taskInstance, cancelationReason) {\n * // ...\n * })\n * });\n * ```\n *\n * @event TaskInstance#TASK_NAME:canceled\n * @param {TaskInstance} taskInstance - Task instance that was started\n * @param {string} cancelationReason - Cancelation reason that was was provided to {@linkcode TaskInstance#cancel}\n */\n\n /**\n * Cancels the task instance. Has no effect if the task instance has\n * already been canceled or has already finished running.\n *\n * @method cancel\n * @memberof TaskInstance\n * @instance\n * @async\n */\n\n /**\n * Returns a promise that resolves with the value returned\n * from the task's (generator) function, or rejects with\n * either the exception thrown from the task function, or\n * an error with a `.name` property with value `\"TaskCancelation\"`.\n *\n * @method then\n * @memberof TaskInstance\n * @instance\n * @return {Promise}\n */\n\n /**\n * @method catch\n * @memberof TaskInstance\n * @instance\n * @return {Promise}\n */\n\n /**\n * @method finally\n * @memberof TaskInstance\n * @instance\n * @return {Promise}\n */\n}\n\nif (TRACKED_INITIAL_INSTANCE_STATE) {\n Object.defineProperties(\n TaskInstance.prototype,\n TRACKED_INITIAL_INSTANCE_STATE,\n );\n}\n","import Ember from 'ember';\n\nimport { computed } from '@ember/object';\n\nimport EnqueueSchedulerPolicy from './external/scheduler/policies/enqueued-policy';\nimport DropSchedulerPolicy from './external/scheduler/policies/drop-policy';\nimport KeepLatestSchedulerPolicy from './external/scheduler/policies/keep-latest-policy';\nimport RestartableSchedulerPolicy from './external/scheduler/policies/restartable-policy';\n\nexport let taskFactorySymbol = '__ec_task_factory';\n\nexport const propertyModifiers = {\n /**\n * Configures the task to cancel old currently task instances\n * to make room for a new one to perform. Sets default\n * maxConcurrency to 1.\n *\n * [See the Live Example](/docs/examples/route-tasks/1)\n *\n * @method restartable\n * @memberof TaskProperty\n * @instance\n */\n restartable() {\n this[taskFactorySymbol].setBufferPolicy(RestartableSchedulerPolicy);\n return this;\n },\n\n /**\n * Configures the task to run task instances one-at-a-time in\n * the order they were `.perform()`ed. Sets default\n * maxConcurrency to 1.\n *\n * @method enqueue\n * @memberof TaskProperty\n * @instance\n */\n enqueue() {\n this[taskFactorySymbol].setBufferPolicy(EnqueueSchedulerPolicy);\n return this;\n },\n\n /**\n * Configures the task to immediately cancel (i.e. drop) any\n * task instances performed when the task is already running\n * at maxConcurrency. Sets default maxConcurrency to 1.\n *\n * @method drop\n * @memberof TaskProperty\n * @instance\n */\n drop() {\n this[taskFactorySymbol].setBufferPolicy(DropSchedulerPolicy);\n return this;\n },\n\n /**\n * Configures the task to drop all but the most recently\n * performed {@linkcode TaskInstance }.\n *\n * @method keepLatest\n * @memberof TaskProperty\n * @instance\n */\n keepLatest() {\n this[taskFactorySymbol].setBufferPolicy(KeepLatestSchedulerPolicy);\n return this;\n },\n\n /**\n * Sets the maximum number of task instances that are allowed\n * to run at the same time. By default, with no task modifiers\n * applied, this number is Infinity (there is no limit\n * to the number of tasks that can run at the same time).\n * {@linkcode TaskProperty#restartable .restartable},\n * {@linkcode TaskProperty#enqueue .enqueue}, and\n * {@linkcode TaskProperty#drop .drop} set the default\n * maxConcurrency to 1, but you can override this value\n * to set the maximum number of concurrently running tasks\n * to a number greater than 1.\n *\n * [See the AJAX Throttling example](/docs/examples/ajax-throttling)\n *\n * The example below uses a task with `maxConcurrency(3)` to limit\n * the number of concurrent AJAX requests (for anyone using this task)\n * to 3.\n *\n * ```js\n * doSomeAjax: task(function * (url) {\n * return fetch(url);\n * }).maxConcurrency(3),\n *\n * elsewhere() {\n * this.doSomeAjax.perform(\"http://www.example.com/json\");\n * },\n * ```\n *\n * @method maxConcurrency\n * @memberof TaskProperty\n * @param {Number} n The maximum number of concurrently running tasks\n * @instance\n */\n maxConcurrency(n) {\n this[taskFactorySymbol].setMaxConcurrency(n);\n return this;\n },\n\n /**\n * Adds this task to a TaskGroup so that concurrency constraints\n * can be shared between multiple tasks.\n *\n * [See the Task Group docs for more information](/docs/task-groups)\n *\n * @method group\n * @memberof TaskProperty\n * @param {String} groupPath A path to the TaskGroup property\n * @instance\n */\n group(taskGroupPath) {\n this[taskFactorySymbol].setGroup(taskGroupPath);\n return this;\n },\n\n /**\n * Activates lifecycle events, allowing Evented host objects to react to task state\n * changes.\n *\n * ```js\n *\n * export default Component.extend({\n * uploadTask: task(function* (file) {\n * // ... file upload stuff\n * }).evented(),\n *\n * uploadedStarted: on('uploadTask:started', function(taskInstance) {\n * this.analytics.track(\"User Photo: upload started\");\n * }),\n * });\n * ```\n *\n * @method evented\n * @memberof TaskProperty\n * @instance\n */\n evented() {\n this[taskFactorySymbol].setEvented(true);\n return this;\n },\n\n /**\n * Logs lifecycle events to aid in debugging unexpected Task behavior.\n * Presently only logs cancelation events and the reason for the cancelation,\n * e.g. \"TaskInstance 'doStuff' was canceled because the object it lives on was destroyed or unrendered\"\n *\n * @method debug\n * @memberof TaskProperty\n * @instance\n */\n debug() {\n this[taskFactorySymbol].setDebug(true);\n return this;\n },\n\n /**\n * Configures the task to call the passed in callback for derived state updates,\n * overriding the default derived state tracking. You may call with `null` to\n * completely opt-out of derived state tracking.\n *\n * @method onState\n * @memberof TaskProperty\n * @param {function?} callback Callback to be called. Receives an object argument with the new state.\n * @instance\n */\n onState(callback) {\n this[taskFactorySymbol].setOnState(callback);\n return this;\n },\n};\n\n/**\n A {@link TaskProperty} is the Computed Property-like object returned\n from the {@linkcode task} function. You can call Task Modifier methods\n on this object to configure the behavior of the {@link Task}.\n\n See [Managing Task Concurrency](/docs/task-concurrency) for an\n overview of all the different task modifiers you can use and how\n they impact automatic cancelation / enqueueing of task instances.\n\n {@link TaskProperty} is only used for supporting \"classic\" Ember objects.\n When using Native JavaScript or TypeScript classes, you will use [task decorators](/docs/task-decorators)\n on methods instead.\n\n @class TaskProperty\n*/\nexport class TaskProperty {}\nexport class TaskGroupProperty {}\n\nObject.assign(TaskGroupProperty.prototype, propertyModifiers);\nObject.assign(TaskProperty.prototype, propertyModifiers, {\n setup(proto, key) {\n if (this.callSuperSetup) {\n this.callSuperSetup(...arguments);\n }\n\n this[taskFactorySymbol].setName(key);\n this[taskFactorySymbol]._setupEmberKVO(proto);\n },\n\n /**\n * Calling `task(...).on(eventName)` configures the task to be\n * automatically performed when the specified events fire. In\n * this way, it behaves like\n * [Ember.on](http://emberjs.com/api/classes/Ember.html#method_on).\n *\n * You can use `task(...).on('init')` to perform the task\n * when the host object is initialized.\n *\n * ```js\n * export default Component.extend({\n * pollForUpdates: task(function * () {\n * // ... this runs when the Component is first created\n * // because we specified .on('init')\n * }).on('init'),\n *\n * handleFoo: task(function * (a, b, c) {\n * // this gets performed automatically if the 'foo'\n * // event fires on this Component,\n * // e.g., if someone called component.trigger('foo')\n * }).on('foo'),\n * });\n * ```\n *\n * @method on\n * @memberof TaskProperty\n * @param {String} eventNames*\n * @instance\n */\n on() {\n this[taskFactorySymbol].addPerformEvents(...arguments);\n return this;\n },\n\n /**\n * This behaves like the {@linkcode TaskProperty#on task(...).on() modifier},\n * but instead will cause the task to be canceled if any of the\n * specified events fire on the parent object.\n *\n * [See the Live Example](/docs/examples/route-tasks/1)\n *\n * @method cancelOn\n * @memberof TaskProperty\n * @param {String} eventNames*\n * @instance\n */\n cancelOn() {\n this[taskFactorySymbol].addCancelEvents(...arguments);\n return this;\n },\n\n /**\n * This behaves like the {@linkcode TaskProperty#on task(...).on() modifier},\n * but instead will cause the task to be performed if any of the\n * specified properties on the parent object change.\n *\n * @method observes\n * @memberof TaskProperty\n * @param {String} keys*\n * @instance\n */\n observes() {\n this[taskFactorySymbol].addObserverKeys(...arguments);\n return this;\n },\n});\n\nconst setDecorator = Ember._setClassicDecorator || Ember._setComputedDecorator;\nexport function taskComputed(fn) {\n let cp = function (proto, key) {\n if (cp.setup !== undefined) {\n cp.setup(proto, key);\n }\n\n return computed(fn)(...arguments);\n };\n\n setDecorator(cp);\n\n return cp;\n}\n","import { setOwner, getOwner } from '@ember/application';\nimport EmberObject, { get, set } from '@ember/object';\nimport { isDestroying, registerDestructor } from '@ember/destroyable';\nimport { Task as BaseTask } from './external/task/task';\nimport { TaskInstance } from './task-instance';\nimport { TaskInstanceExecutor } from './external/task-instance/executor';\nimport { TASKABLE_MIXIN } from './taskable-mixin';\nimport { TRACKED_INITIAL_TASK_STATE } from './tracked-state';\nimport { CANCEL_KIND_LIFESPAN_END } from './external/task-instance/cancelation';\n\n/**\n The `Task` object lives on a host Ember object (e.g.\n a Component, Route, or Controller). You call the\n {@linkcode Task#perform .perform()} method on this object\n to create run individual {@linkcode TaskInstance}s,\n and at any point, you can call the {@linkcode Task#cancelAll .cancelAll()}\n method on this object to cancel all running or enqueued\n {@linkcode TaskInstance}s.\n\n \n\n @class Task\n*/\nexport class Task extends BaseTask {\n /**\n * `true` if any current task instances are running.\n *\n * @memberof Task\n * @member {boolean} isRunning\n * @instance\n * @readOnly\n */\n /**\n * `true` if any future task instances are queued.\n *\n * @memberof Task\n * @member {boolean} isQueued\n * @instance\n * @readOnly\n */\n /**\n * `true` if the task is not in the running or queued state.\n *\n * @memberof Task\n * @member {boolean} isIdle\n * @instance\n * @readOnly\n */\n /**\n * The current state of the task: `\"running\"`, `\"queued\"` or `\"idle\"`.\n *\n * @memberof Task\n * @member {string} state\n * @instance\n * @readOnly\n */\n /**\n * The most recently started task instance.\n *\n * @memberof Task\n * @member {TaskInstance} last\n * @instance\n * @readOnly\n */\n /**\n * The most recent task instance that is currently running.\n *\n * @memberof Task\n * @member {TaskInstance} lastRunning\n * @instance\n * @readOnly\n */\n /**\n * The most recently performed task instance.\n *\n * @memberof Task\n * @member {TaskInstance} lastPerformed\n * @instance\n * @readOnly\n */\n /**\n * The most recent task instance that succeeded.\n *\n * @memberof Task\n * @member {TaskInstance} lastSuccessful\n * @instance\n * @readOnly\n */\n /**\n * The most recently completed task instance.\n *\n * @memberof Task\n * @member {TaskInstance} lastComplete\n * @instance\n * @readOnly\n */\n /**\n * The most recent task instance that errored.\n *\n * @memberof Task\n * @member {TaskInstance} lastErrored\n * @instance\n * @readOnly\n */\n /**\n * The most recently canceled task instance.\n *\n * @memberof Task\n * @member {TaskInstance} lastCanceled\n * @instance\n * @readOnly\n */\n /**\n * The most recent task instance that is incomplete.\n *\n * @memberof Task\n * @member {TaskInstance} lastIncomplete\n * @instance\n * @readOnly\n */\n /**\n * The number of times this task has been performed.\n *\n * @memberof Task\n * @member {number} performCount\n * @instance\n * @readOnly\n */\n\n constructor(options) {\n super(options);\n\n if (!isDestroying(this.context)) {\n registerDestructor(this.context, () => {\n this.cancelAll({\n reason: 'the object it lives on was destroyed or unrendered',\n cancelRequestKind: CANCEL_KIND_LIFESPAN_END,\n });\n });\n }\n }\n\n /**\n * Flags the task as linked to the parent task's lifetime. Must be called\n * within another task's perform function. The task will be cancelled if the\n * parent task is canceled as well.\n *\n * ember-concurrency will indicate when this may be needed.\n *\n * @method linked\n * @memberof Task\n * @instance\n *\n */\n\n /**\n * Flags the task as not linked to the parent task's lifetime. Must be called\n * within another task's perform function. The task will NOT be cancelled if the\n * parent task is canceled.\n *\n * This is useful for avoiding the so-called \"self-cancel loop\" for tasks.\n * ember-concurrency will indicate when this may be needed.\n *\n * @method unlinked\n * @memberof Task\n * @instance\n *\n */\n\n /**\n * Creates a new {@linkcode TaskInstance} and attempts to run it right away.\n * If running this task instance would increase the task's concurrency\n * to a number greater than the task's maxConcurrency, this task\n * instance might be immediately canceled (dropped), or enqueued\n * to run at later time, after the currently running task(s) have finished.\n *\n * @method perform\n * @memberof Task\n * @param {*} arg* - args to pass to the task function\n * @instance\n *\n * @fires TaskInstance#TASK_NAME:started\n * @fires TaskInstance#TASK_NAME:succeeded\n * @fires TaskInstance#TASK_NAME:errored\n * @fires TaskInstance#TASK_NAME:canceled\n *\n */\n\n /**\n * Cancels all running or queued `TaskInstance`s for this Task.\n * If you're trying to cancel a specific TaskInstance (rather\n * than all of the instances running under this task) call\n * `.cancel()` on the specific TaskInstance.\n *\n * @method cancelAll\n * @memberof Task\n * @param options.reason A descriptive reason the task was\n * cancelled. Defaults to `\".cancelAll() was explicitly called\n * on the Task\"`.\n * @param options.resetState If true, will clear the task state\n * (`last*` and `performCount` properties will be set to initial\n * values). Defaults to false.\n * @instance\n * @async\n *\n */\n\n get _isAlive() {\n return !isDestroying(this.context);\n }\n\n _taskInstanceFactory(args, performType, linkedObject) {\n let options = this._taskInstanceOptions(args, performType, linkedObject);\n let taskInstance = new TaskInstance(options);\n return taskInstance;\n }\n\n _clone() {\n return new Task({\n context: this.context,\n debug: this.debug,\n env: this.env,\n generatorFactory: this.generatorFactory,\n group: this.group,\n hasEnabledEvents: this.hasEnabledEvents,\n name: this.name,\n onStateCallback: this.onStateCallback,\n scheduler: this.scheduler,\n });\n }\n}\n\nif (TRACKED_INITIAL_TASK_STATE) {\n Object.defineProperties(Task.prototype, TRACKED_INITIAL_TASK_STATE);\n}\n\nObject.assign(Task.prototype, TASKABLE_MIXIN);\n\nconst currentTaskInstanceSymbol = '__ec__encap_current_ti';\nexport class EncapsulatedTask extends Task {\n constructor(options) {\n super(options);\n this.taskObj = options.taskObj;\n this._encapsulatedTaskStates = new WeakMap();\n this._encapsulatedTaskInstanceProxies = new WeakMap();\n }\n\n _getEncapsulatedTaskClass() {\n let encapsulatedTaskImplClass = this._encapsulatedTaskImplClass;\n\n if (!encapsulatedTaskImplClass) {\n // eslint-disable-next-line ember/no-classic-classes\n encapsulatedTaskImplClass = EmberObject.extend(this.taskObj, {\n unknownProperty(key) {\n let currentInstance = this[currentTaskInstanceSymbol];\n return currentInstance ? currentInstance[key] : undefined;\n },\n });\n }\n\n return encapsulatedTaskImplClass;\n }\n\n _taskInstanceFactory(args, performType) {\n let owner = getOwner(this.context);\n let taskInstanceProxy;\n let encapsulatedTaskImpl = this._getEncapsulatedTaskClass().create({\n context: this.context,\n });\n setOwner(encapsulatedTaskImpl, owner);\n\n let generatorFactory = () =>\n encapsulatedTaskImpl.perform.apply(taskInstanceProxy, args);\n let taskInstance = new TaskInstance({\n task: this,\n args,\n executor: new TaskInstanceExecutor({\n generatorFactory,\n env: this.env,\n debug: this.debug,\n }),\n performType,\n hasEnabledEvents: this.hasEnabledEvents,\n });\n encapsulatedTaskImpl[currentTaskInstanceSymbol] = taskInstance;\n\n this._encapsulatedTaskStates.set(taskInstance, encapsulatedTaskImpl);\n\n taskInstanceProxy = this._wrappedEncapsulatedTaskInstance(taskInstance);\n\n return taskInstanceProxy;\n }\n\n _wrappedEncapsulatedTaskInstance(taskInstance) {\n if (!taskInstance) {\n return null;\n }\n\n let _encapsulatedTaskInstanceProxies =\n this._encapsulatedTaskInstanceProxies;\n let proxy = _encapsulatedTaskInstanceProxies.get(taskInstance);\n\n if (!proxy) {\n let encapsulatedTaskImpl = this._encapsulatedTaskStates.get(taskInstance);\n\n proxy = new Proxy(taskInstance, {\n get(obj, prop) {\n return prop in obj\n ? obj[prop]\n : get(encapsulatedTaskImpl, prop.toString());\n },\n set(obj, prop, value) {\n if (prop in obj) {\n obj[prop] = value;\n } else {\n set(encapsulatedTaskImpl, prop.toString(), value);\n }\n return true;\n },\n has(obj, prop) {\n return prop in obj || prop in encapsulatedTaskImpl;\n },\n ownKeys(obj) {\n return Reflect.ownKeys(obj).concat(\n Reflect.ownKeys(encapsulatedTaskImpl),\n );\n },\n defineProperty(obj, prop, descriptor) {\n // Ember < 3.16 uses a WeakMap for value storage, keyed to the proxy.\n // We need to ensure that when we use setProperties to update it, and\n // it creates Meta, that it uses the proxy to key, otherwise we'll\n // have two different values stores in Meta, one which won't render.\n let proxy = _encapsulatedTaskInstanceProxies.get(taskInstance);\n if (proxy) {\n if (descriptor.get) {\n descriptor.get = descriptor.get.bind(proxy);\n } else if (proxy && descriptor.set) {\n descriptor.set = descriptor.set.bind(proxy);\n }\n }\n\n return Reflect.defineProperty(encapsulatedTaskImpl, prop, descriptor);\n },\n getOwnPropertyDescriptor(obj, prop) {\n return prop in obj\n ? Reflect.getOwnPropertyDescriptor(obj, prop)\n : Reflect.getOwnPropertyDescriptor(encapsulatedTaskImpl, prop);\n },\n });\n\n _encapsulatedTaskInstanceProxies.set(taskInstance, proxy);\n }\n\n return proxy;\n }\n}\n","export const TASKABLE_MIXIN = {\n _performCount: 0,\n\n setState(state) {\n this._performCount = this._performCount + (state.numPerformedInc || 0);\n\n let isRunning = state.numRunning > 0;\n let isQueued = state.numQueued > 0;\n let derivedState = Object.assign({}, state, {\n performCount: this._performCount,\n isRunning,\n isQueued,\n isIdle: !isRunning && !isQueued,\n state: isRunning ? 'running' : 'idle',\n });\n Object.assign(this, derivedState);\n },\n\n onState(state, task) {\n if (task.onStateCallback) {\n task.onStateCallback(state, task);\n }\n },\n};\n","import { tracked } from '@glimmer/tracking';\nimport { DEFAULT_STATE as INITIAL_TASK_STATE } from './external/task/default-state';\nimport { INITIAL_STATE as INITIAL_INSTANCE_STATE } from './external/task-instance/initial-state';\n\nfunction trackMixin(proto, obj, key) {\n const propDesc = Object.getOwnPropertyDescriptor(proto, key);\n propDesc.initializer = propDesc.initializer || (() => proto[key]);\n delete propDesc.value;\n const desc = tracked(obj, key, propDesc);\n obj[key] = desc;\n return obj;\n}\n\nfunction applyTracked(proto, initial) {\n return Object.keys(proto).reduce((acc, key) => {\n return trackMixin(proto, acc, key);\n }, initial);\n}\n\nexport let TRACKED_INITIAL_TASK_STATE;\nexport let TRACKED_INITIAL_INSTANCE_STATE;\n\nTRACKED_INITIAL_TASK_STATE = applyTracked(INITIAL_TASK_STATE, {});\nTRACKED_INITIAL_TASK_STATE = applyTracked(\n {\n numRunning: 0,\n numQueued: 0,\n isRunning: false,\n isQueued: false,\n isIdle: true,\n state: 'idle',\n },\n TRACKED_INITIAL_TASK_STATE,\n);\n\nTRACKED_INITIAL_INSTANCE_STATE = applyTracked(INITIAL_INSTANCE_STATE, {});\nTRACKED_INITIAL_INSTANCE_STATE = applyTracked(\n {\n state: 'waiting',\n isDropped: false,\n isRunning: false,\n },\n TRACKED_INITIAL_INSTANCE_STATE,\n);\n\nObject.freeze(TRACKED_INITIAL_TASK_STATE);\nObject.freeze(TRACKED_INITIAL_INSTANCE_STATE);\n","import { TaskFactory } from './task-factory';\n\n/**\n * This builder function is called by the transpiled code from\n * `task(async () => {})`. See async-arrow-task-transform.js\n *\n * @private\n */\nexport function buildTask(contextFn, options, taskName, bufferPolicyName) {\n let optionsWithBufferPolicy = options;\n\n if (bufferPolicyName) {\n optionsWithBufferPolicy = Object.assign({}, optionsWithBufferPolicy);\n optionsWithBufferPolicy[bufferPolicyName] = true;\n }\n\n const result = contextFn();\n\n const taskFactory = new TaskFactory(\n taskName || '',\n result.generator,\n optionsWithBufferPolicy,\n );\n return taskFactory.createTask(result.context);\n}\n","import { later, cancel } from '@ember/runloop';\nimport { EMBER_ENVIRONMENT } from './ember-environment';\nimport { Yieldable } from './external/yieldables';\n\nexport function isEventedObject(c) {\n return (\n c &&\n ((typeof c.one === 'function' && typeof c.off === 'function') ||\n (typeof c.on === 'function' && typeof c.off === 'function') ||\n (typeof c.addEventListener === 'function' &&\n typeof c.removeEventListener === 'function'))\n );\n}\n\nexport class EmberYieldable extends Yieldable {\n _deferable() {\n return EMBER_ENVIRONMENT.defer();\n }\n}\n\nclass TimeoutYieldable extends EmberYieldable {\n constructor(ms) {\n super();\n this.ms = ms;\n }\n\n onYield(state) {\n let timerId = later(() => state.next(), this.ms);\n\n return () => cancel(timerId);\n }\n}\n\n/**\n *\n * Yielding `timeout(ms)` will pause a task for the duration\n * of time passed in, in milliseconds.\n *\n * This timeout will be scheduled on the Ember runloop, which\n * means that test helpers will wait for it to complete before\n * continuing with the test. See `rawTimeout()` if you need\n * different behavior.\n *\n * The task below, when performed, will print a message to the\n * console every second.\n *\n * ```js\n * export default class MyComponent extends Component {\n * @task *myTask() {\n * while (true) {\n * console.log(\"Hello!\");\n * yield timeout(1000);\n * }\n * }\n * }\n * ```\n *\n * @param {number} ms - the amount of time to sleep before resuming\n * the task, in milliseconds\n */\nexport function timeout(ms) {\n return new TimeoutYieldable(ms);\n}\n\nexport function deprecatePrivateModule(moduleName) {\n // eslint-disable-next-line no-console\n console.warn(\n `an Ember addon is importing a private ember-concurrency module '${moduleName}' that has moved`,\n );\n}\n","import { TaskFactory } from './task-factory';\n\nfunction taskFromPropertyDescriptor(\n target,\n key,\n descriptor,\n params = [],\n factoryClass = TaskFactory,\n) {\n let { initializer, get, value } = descriptor;\n let taskFn;\n\n if (initializer) {\n taskFn = initializer.call(undefined);\n } else if (get) {\n taskFn = get.call(undefined);\n } else if (value) {\n taskFn = value;\n }\n\n taskFn.displayName = `${key} (task)`;\n\n let tasks = new WeakMap();\n let options = params[0] || {};\n let factory = new factoryClass(key, taskFn, options);\n factory._setupEmberKVO(target);\n\n return {\n get() {\n let task = tasks.get(this);\n\n if (!task) {\n task = factory.createTask(this);\n tasks.set(this, task);\n }\n\n return task;\n },\n };\n}\n\nfunction taskGroupPropertyDescriptor(\n _target,\n key,\n _descriptor,\n params = [],\n factoryClass = TaskFactory,\n) {\n let taskGroups = new WeakMap();\n let options = params[0] || {};\n let factory = new factoryClass(key, null, options);\n\n return {\n get() {\n let task = taskGroups.get(this);\n\n if (!task) {\n task = factory.createTaskGroup(this);\n taskGroups.set(this, task);\n }\n\n return task;\n },\n };\n}\n\n// Cribbed from @ember-decorators/utils\nfunction isFieldDescriptor(possibleDesc) {\n let [target, key, desc] = possibleDesc;\n\n return (\n possibleDesc.length === 3 &&\n typeof target === 'object' &&\n target !== null &&\n typeof key === 'string' &&\n ((typeof desc === 'object' &&\n desc !== null &&\n 'enumerable' in desc &&\n 'configurable' in desc) ||\n desc === undefined) // TS compatibility ???\n );\n}\n\nexport function decoratorWithParams(descriptorFn) {\n return function (...params) {\n if (isFieldDescriptor(params)) {\n return descriptorFn(...params);\n } else {\n return (...desc) => descriptorFn(...desc, params);\n }\n };\n}\n\nfunction createDecorator(fn, baseOptions = {}, factoryClass = TaskFactory) {\n return decoratorWithParams((target, key, descriptor, [userOptions] = []) => {\n let mergedOptions = Object.assign({}, { ...baseOptions, ...userOptions });\n\n return fn(target, key, descriptor, [mergedOptions], factoryClass);\n });\n}\n\nexport function createTaskDecorator(\n baseOptions = {},\n factoryClass = TaskFactory,\n) {\n return createDecorator(taskFromPropertyDescriptor, baseOptions, factoryClass);\n}\n\nexport function createTaskGroupDecorator(\n baseOptions = {},\n factoryClass = TaskFactory,\n) {\n return createDecorator(\n taskGroupPropertyDescriptor,\n baseOptions,\n factoryClass,\n );\n}\n\nexport const lastValue = decoratorWithParams(\n (_target, _key, descriptor, [taskName] = []) => {\n const { initializer } = descriptor;\n delete descriptor.initializer;\n\n return {\n get() {\n let lastInstance = this[taskName].lastSuccessful;\n\n if (lastInstance) {\n return lastInstance.value;\n }\n\n if (initializer) {\n return initializer.call(this);\n }\n\n return undefined;\n },\n };\n },\n);\n","import {\n createTaskDecorator,\n createTaskGroupDecorator,\n lastValue as nativeLastValue,\n} from './external/task-decorators';\nimport { TaskFactory as EmberTaskFactory } from './task-factory';\n\nexport const lastValue = nativeLastValue;\n\n/**\n * A Task is a cancelable, restartable, asynchronous operation that\n * is driven by a generator function. Tasks are automatically canceled\n * when the object they live on is destroyed (e.g. a Component\n * is unrendered).\n *\n * Turns the decorated generator function into a task.\n *\n * Optionally takes a hash of options that will be applied as modifiers to the\n * task. For instance `maxConcurrency`, `on`, `group` or `keepLatest`.\n *\n * By default, tasks have no concurrency constraints\n * (multiple instances of a task can be running at the same time)\n * but much of a power of tasks lies in proper usage of Task Modifiers\n * that you can apply to a task.\n *\n * You can also define an\n * Encapsulated Task\n * by decorating an object that defines a `perform` generator\n * method.\n *\n * ```js\n * import Component from '@ember/component';\n * import { task } from 'ember-concurrency';\n *\n * class MyComponent extends Component {\n * @task\n * *plainTask() {}\n *\n * @task({ maxConcurrency: 5, keepLatest: true, cancelOn: 'click' })\n * *taskWithModifiers() {}\n * }\n * ```\n *\n * @function\n * @param {object?} [options={}] Task modifier options\n * @param {string|string[]} [options.cancelOn] Events to cancel task on. Applies only to `@ember/component`\n * @param {boolean} [options.enqueue] Sets `enqueue` modifier on task if `true`\n * @param {boolean} [options.evented] Enables [task lifecycle events](/docs/advanced/lifecycle-events) for this Task, if `true`\n * @param {boolean} [options.debug] Enables task debugging if `true`\n * @param {boolean} [options.drop] Sets `drop` modifier on task if `true`\n * @param {string} [options.group] Associates task with the group specified\n * @param {boolean} [options.keepLatest] Sets `keepLatest` modifier on task if `true`\n * @param {number} [options.maxConcurrency] Sets the maximum number of running task instances for the task\n * @param {string|string[]} [options.observes] Properties to watch and cause task to be performed when they change\n * @param {string|string[]} [options.on] Events to perform task on. Applies only to `@ember/component`\n * @param {function?} [options.onState] Callback to use for state tracking. May be set to `null` to disable state tracking.\n * @param {boolean} [options.restartable] Sets `restartable` modifier on task if `true`\n * @return {Task}\n */\nexport const task = createTaskDecorator({}, EmberTaskFactory);\n\n/**\n * Turns the decorated generator function into a task and applies the\n * `drop` modifier.\n *\n * Optionally takes a hash of options that will be applied as modifiers to the\n * task. For instance `maxConcurrency`, `on`, or `group`.\n *\n * You can also define an\n * Encapsulated Task\n * by decorating an object that defines a `perform` generator\n * method.\n *\n * ```js\n * import Component from '@ember/component';\n * import { task, dropTask } from 'ember-concurrency';\n *\n * class MyComponent extends Component {\n * @task\n * *plainTask() {}\n *\n * @dropTask({ cancelOn: 'click' })\n * *myDropTask() {}\n * }\n * ```\n *\n * @function\n * @param {object?} [options={}] Task modifier options. See {@link task} for list.\n * @return {Task}\n */\nexport const dropTask = createTaskDecorator({ drop: true }, EmberTaskFactory);\n\n/**\n * Turns the decorated generator function into a task and applies the\n * `enqueue` modifier.\n *\n * Optionally takes a hash of options that will be applied as modifiers to the\n * task. For instance `maxConcurrency`, `on`, or `group`.\n *\n * You can also define an\n * Encapsulated Task\n * by decorating an object that defines a `perform` generator\n * method.\n *\n * ```js\n * import Component from '@ember/component';\n * import { task, enqueueTask } from 'ember-concurrency';\n *\n * class MyComponent extends Component {\n * @task\n * *plainTask() {}\n *\n * @enqueueTask({ cancelOn: 'click' })\n * *myEnqueueTask() {}\n * }\n * ```\n *\n * @function\n * @param {object?} [options={}] Task modifier options. See {@link task} for list.\n * @return {Task}\n */\nexport const enqueueTask = createTaskDecorator(\n {\n enqueue: true,\n },\n EmberTaskFactory,\n);\n\n/**\n * Turns the decorated generator function into a task and applies the\n * `keepLatest` modifier.\n *\n * Optionally takes a hash of options that will be applied as modifiers to the\n * task. For instance `maxConcurrency`, `on`, or `group`.\n *\n * You can also define an\n * Encapsulated Task\n * by decorating an object that defines a `perform` generator\n * method.\n *\n * ```js\n * import Component from '@ember/component';\n * import { task, keepLatestTask } from 'ember-concurrency';\n *\n * class MyComponent extends Component {\n * @task\n * *plainTask() {}\n *\n * @keepLatestTask({ cancelOn: 'click' })\n * *myKeepLatestTask() {}\n * }\n * ```\n *\n * @function\n * @param {object?} [options={}] Task modifier options. See {@link task} for list.\n * @return {Task}\n */\nexport const keepLatestTask = createTaskDecorator(\n {\n keepLatest: true,\n },\n EmberTaskFactory,\n);\n\n/**\n * Turns the decorated generator function into a task and applies the\n * `restartable` modifier.\n *\n * Optionally takes a hash of options that will be applied as modifiers to the\n * task. For instance `maxConcurrency`, `on`, or `group`.\n *\n * You can also define an\n * Encapsulated Task\n * by decorating an object that defines a `perform` generator\n * method.\n *\n * ```js\n * import Component from '@ember/component';\n * import { task, restartableTask } from 'ember-concurrency';\n *\n * class MyComponent extends Component {\n * @task\n * *plainTask() {}\n *\n * @restartableTask({ cancelOn: 'click' })\n * *myRestartableTask() {}\n * }\n * ```\n *\n * @function\n * @param {object?} [options={}] Task modifier options. See {@link task} for list.\n * @return {Task}\n */\nexport const restartableTask = createTaskDecorator(\n {\n restartable: true,\n },\n EmberTaskFactory,\n);\n\n/**\n * \"Task Groups\" provide a means for applying\n * task modifiers to groups of tasks. Once a {@linkcode Task} is declared\n * as part of a group task, modifiers like `drop` or `restartable`\n * will no longer affect the individual `Task`. Instead those\n * modifiers can be applied to the entire group.\n *\n * Turns the decorated property into a task group.\n *\n * Optionally takes a hash of options that will be applied as modifiers to the\n * task group. For instance `maxConcurrency` or `keepLatest`.\n *\n * ```js\n * import Component from '@glimmer/component';\n * import { task, taskGroup } from 'ember-concurrency';\n *\n * class MyComponent extends Component {\n * @taskGroup({ maxConcurrency: 5 }) chores;\n *\n * @task({ group: 'chores' })\n * *mowLawn() {}\n *\n * @task({ group: 'chores' })\n * *doDishes() {}\n * }\n * ```\n *\n * @function\n * @param {object?} [options={}] Task group modifier options. See {@link task} for list.\n * @return {TaskGroup}\n */\nexport const taskGroup = createTaskGroupDecorator({}, EmberTaskFactory);\n\n/**\n * Turns the decorated property into a task group and applies the\n * `drop` modifier.\n *\n * Optionally takes a hash of further options that will be applied as modifiers\n * to the task group.\n *\n * @function\n * @param {object?} [options={}] Task group modifier options. See {@link task} for list.\n * @return {TaskGroup}\n */\nexport const dropTaskGroup = createTaskGroupDecorator(\n {\n drop: true,\n },\n EmberTaskFactory,\n);\n\n/**\n * Turns the decorated property into a task group and applies the\n * `enqueue` modifier.\n *\n * Optionally takes a hash of further options that will be applied as modifiers\n * to the task group.\n *\n * @function\n * @param {object?} [options={}] Task group modifier options. See {@link task} for list.\n * @return {TaskGroup}\n */\nexport const enqueueTaskGroup = createTaskGroupDecorator(\n {\n enqueue: true,\n },\n EmberTaskFactory,\n);\n\n/**\n * Turns the decorated property into a task group and applies the\n * `keepLatest` modifier.\n *\n * Optionally takes a hash of further options that will be applied as modifiers\n * to the task group.\n *\n * @function\n * @param {object?} [options={}] Task group modifier options. See {@link task} for list.\n * @return {TaskGroup}\n */\nexport const keepLatestTaskGroup = createTaskGroupDecorator(\n { keepLatest: true },\n EmberTaskFactory,\n);\n\n/**\n * Turns the decorated property into a task group and applies the\n * `restartable` modifier.\n *\n * Optionally takes a hash of further options that will be applied as modifiers\n * to the task group.\n *\n * @function\n * @param {object?} [options={}] Task group modifier options. See {@link task} for list.\n * @return {TaskGroup}\n */\nexport const restartableTaskGroup = createTaskGroupDecorator(\n { restartable: true },\n EmberTaskFactory,\n);\n","import { assert } from '@ember/debug';\nimport RSVP, { Promise } from 'rsvp';\nimport { TaskInstance } from './task-instance';\nimport { cancelableSymbol, Yieldable } from './external/yieldables';\n\n/**\n * A cancelation-aware variant of [Promise.all](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all).\n * The normal version of a `Promise.all` just returns a regular, uncancelable\n * Promise. The `ember-concurrency` variant of `all()` has the following\n * additional behavior:\n *\n * - if the task that `yield`ed `all()` is canceled, any of the\n * {@linkcode TaskInstance}s passed in to `all` will be canceled\n * - if any of the {@linkcode TaskInstance}s (or regular promises) passed in reject (or\n * are canceled), all of the other unfinished `TaskInstance`s will\n * be automatically canceled.\n *\n * [Check out the \"Awaiting Multiple Child Tasks example\"](/docs/examples/joining-tasks)\n */\nexport const all = taskAwareVariantOf(RSVP.Promise, 'all', identity);\n\n/**\n * A cancelation-aware variant of [RSVP.allSettled](https://api.emberjs.com/ember/release/functions/rsvp/allSettled).\n * The normal version of a `RSVP.allSettled` just returns a regular, uncancelable\n * Promise. The `ember-concurrency` variant of `allSettled()` has the following\n * additional behavior:\n *\n * - if the task that `yield`ed `allSettled()` is canceled, any of the\n * {@linkcode TaskInstance}s passed in to `allSettled` will be canceled\n */\nexport const allSettled = taskAwareVariantOf(RSVP, 'allSettled', identity);\n\n/**\n * A cancelation-aware variant of [Promise.race](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race).\n * The normal version of a `Promise.race` just returns a regular, uncancelable\n * Promise. The `ember-concurrency` variant of `race()` has the following\n * additional behavior:\n *\n * - if the task that `yield`ed `race()` is canceled, any of the\n * {@linkcode TaskInstance}s passed in to `race` will be canceled\n * - once any of the tasks/promises passed in complete (either success, failure,\n * or cancelation), any of the {@linkcode TaskInstance}s passed in will be canceled\n *\n * [Check out the \"Awaiting Multiple Child Tasks example\"](/docs/examples/joining-tasks)\n */\nexport const race = taskAwareVariantOf(Promise, 'race', identity);\n\n/**\n * A cancelation-aware variant of [RSVP.hash](https://api.emberjs.com/ember/release/functions/rsvp/hash).\n * The normal version of a `RSVP.hash` just returns a regular, uncancelable\n * Promise. The `ember-concurrency` variant of `hash()` has the following\n * additional behavior:\n *\n * - if the task that `yield`ed `hash()` is canceled, any of the\n * {@linkcode TaskInstance}s passed in to `hash` will be canceled\n * - if any of the items rejects/cancels, all other cancelable items\n * (e.g. {@linkcode TaskInstance}s) will be canceled\n */\nexport const hash = taskAwareVariantOf(RSVP, 'hash', getValues);\n\n/**\n * A cancelation-aware variant of [RSVP.hashSettled](https://api.emberjs.com/ember/release/functions/rsvp/hashSettled).\n * The normal version of a `RSVP.hashSettled` just returns a regular, uncancelable\n * Promise. The `ember-concurrency` variant of `hashSettled()` has the following\n * additional behavior:\n *\n * - if the task that `yield`ed `hashSettled()` is canceled, any of the\n * {@linkcode TaskInstance}s passed in to `hashSettled` will be canceled\n */\nexport const hashSettled = taskAwareVariantOf(RSVP, 'hashSettled', getValues);\n\nfunction identity(obj) {\n return obj;\n}\n\nfunction getValues(obj) {\n return Object.keys(obj).map((k) => obj[k]);\n}\n\nfunction castForPromiseHelper(castable) {\n if (castable) {\n if (castable instanceof TaskInstance) {\n // Mark TaskInstances, including those that performed synchronously and\n // have finished already, as having their errors handled, as if they had\n // been then'd, which this is emulating.\n castable.executor.asyncErrorsHandled = true;\n } else if (castable instanceof Yieldable) {\n // Cast to promise\n return castable._toPromise();\n }\n }\n\n return castable;\n}\n\nfunction castAwaitables(arrOrHash, callback) {\n if (Array.isArray(arrOrHash)) {\n return arrOrHash.map(callback);\n } else if (typeof arrOrHash === 'object' && arrOrHash !== null) {\n let obj = {};\n Object.keys(arrOrHash).forEach((key) => {\n obj[key] = callback(arrOrHash[key]);\n });\n return obj;\n } else {\n // :shruggie:\n return arrOrHash;\n }\n}\n\nfunction taskAwareVariantOf(obj, method, getItems) {\n return function (awaitable) {\n let awaitables = castAwaitables(awaitable, castForPromiseHelper);\n\n let items = getItems(awaitables);\n assert(`'${method}' expects an array.`, Array.isArray(items));\n\n let defer = RSVP.defer();\n\n obj[method](awaitables).then(defer.resolve, defer.reject);\n\n let hasCancelled = false;\n let cancelAll = () => {\n if (hasCancelled) {\n return;\n }\n hasCancelled = true;\n items.forEach((it) => {\n if (it) {\n if (it instanceof TaskInstance) {\n it.cancel();\n } else if (typeof it[cancelableSymbol] === 'function') {\n it[cancelableSymbol]();\n }\n }\n });\n };\n\n let promise = defer.promise.finally(cancelAll);\n promise[cancelableSymbol] = cancelAll;\n return promise;\n };\n}\n","const candidateSelectors = [\n 'input',\n 'select',\n 'textarea',\n 'a[href]',\n 'button',\n '[tabindex]:not(slot)',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'details>summary:first-of-type',\n 'details',\n];\nconst candidateSelector = /* #__PURE__ */ candidateSelectors.join(',');\n\nconst NoElement = typeof Element === 'undefined';\n\nconst matches = NoElement\n ? function () {}\n : Element.prototype.matches ||\n Element.prototype.msMatchesSelector ||\n Element.prototype.webkitMatchesSelector;\n\nconst getRootNode =\n !NoElement && Element.prototype.getRootNode\n ? (element) => element.getRootNode()\n : (element) => element.ownerDocument;\n\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\nconst getCandidates = function (el, includeContainer, filter) {\n let candidates = Array.prototype.slice.apply(\n el.querySelectorAll(candidateSelector)\n );\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidatesScope\n * @property {Element} scope contains inner candidates\n * @property {Element[]} candidates\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidatesScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.}\n */\nconst getCandidatesIteratively = function (\n elements,\n includeContainer,\n options\n) {\n const candidates = [];\n const elementsToCheck = Array.from(elements);\n while (elementsToCheck.length) {\n const element = elementsToCheck.shift();\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n const assigned = element.assignedElements();\n const content = assigned.length ? assigned : element.children;\n const nestedCandidates = getCandidatesIteratively(content, true, options);\n if (options.flatten) {\n candidates.push(...nestedCandidates);\n } else {\n candidates.push({\n scope: element,\n candidates: nestedCandidates,\n });\n }\n } else {\n // check candidate element\n const validCandidate = matches.call(element, candidateSelector);\n if (\n validCandidate &&\n options.filter(element) &&\n (includeContainer || !elements.includes(element))\n ) {\n candidates.push(element);\n }\n\n // iterate over shadow content if possible\n const shadowRoot =\n element.shadowRoot ||\n // check for an undisclosed shadow\n (typeof options.getShadowRoot === 'function' &&\n options.getShadowRoot(element));\n\n const validShadowRoot =\n !options.shadowRootFilter || options.shadowRootFilter(element);\n\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n const nestedCandidates = getCandidatesIteratively(\n shadowRoot === true ? element.children : shadowRoot.children,\n true,\n options\n );\n\n if (options.flatten) {\n candidates.push(...nestedCandidates);\n } else {\n candidates.push({\n scope: element,\n candidates: nestedCandidates,\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift(...element.children);\n }\n }\n }\n return candidates;\n};\n\nconst getTabindex = function (node, isScope) {\n if (node.tabIndex < 0) {\n // in Chrome,
,