@panomc/widget-host 0.0.0-stage → 1.0.0-dev.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/runtime/chunks/chunk-9EZydhXt.js +1 -0
  2. package/dist/runtime/chunks/chunk-BQPllGmY.js +1 -0
  3. package/dist/runtime/chunks/chunk-CTgT5UYL.js +1 -0
  4. package/dist/runtime/chunks/chunk-ChRkfjHR.js +1 -0
  5. package/dist/runtime/chunks/chunk-Cmbb89rp.js +1 -0
  6. package/dist/runtime/chunks/chunk-CqpY4RsZ.js +1 -0
  7. package/dist/runtime/chunks/chunk-D7Jd5Dpn.js +1 -0
  8. package/dist/runtime/chunks/chunk-DNUkGPCL.js +1 -0
  9. package/dist/runtime/chunks/chunk-DebScgYV.js +1 -0
  10. package/dist/runtime/chunks/chunk-DgPYxg7o.js +1 -0
  11. package/dist/runtime/chunks/chunk-DhgH0pN2.js +1 -0
  12. package/dist/runtime/chunks/chunk-FEL6LDrJ.js +1 -0
  13. package/dist/runtime/chunks/chunk-RPo0Hd8r.js +1 -0
  14. package/dist/runtime/chunks/chunk-Xd_2KAhC.js +1 -0
  15. package/dist/runtime/chunks/chunk-akOtSLvV.js +1 -0
  16. package/dist/runtime/chunks/chunk-cUxFvg6m.js +1 -0
  17. package/dist/runtime/css/pano-fallback-icons.css +9 -0
  18. package/dist/runtime/css/pano-tokens.css +225 -0
  19. package/dist/runtime/host/components-panel.js +1 -0
  20. package/dist/runtime/host/components-theme.js +1 -0
  21. package/dist/runtime/host/controllers.js +1 -0
  22. package/dist/runtime/host/index.js +1 -0
  23. package/dist/runtime/host/internal.js +1 -0
  24. package/dist/runtime/host/svelte.js +1 -0
  25. package/dist/runtime/host/toasts.js +1 -0
  26. package/dist/runtime/host/utils-api.js +1 -0
  27. package/dist/runtime/host/utils-auth.js +1 -0
  28. package/dist/runtime/host/utils-component.js +1 -0
  29. package/dist/runtime/host/utils-language.js +1 -0
  30. package/dist/runtime/host/utils-route.js +1 -0
  31. package/dist/runtime/host/utils-text.js +1 -0
  32. package/dist/runtime/host/utils-tooltip.js +1 -0
  33. package/dist/runtime/host/variables.js +1 -0
  34. package/dist/runtime/host/views.js +1 -0
  35. package/dist/runtime/loader.js +1 -0
  36. package/dist/runtime/runtime.json +104 -0
  37. package/dist/runtime/svelte/animate.js +1 -0
  38. package/dist/runtime/svelte/attachments.js +1 -0
  39. package/dist/runtime/svelte/easing.js +1 -0
  40. package/dist/runtime/svelte/events.js +1 -0
  41. package/dist/runtime/svelte/index.js +1 -0
  42. package/dist/runtime/svelte/internal-client.js +1 -0
  43. package/dist/runtime/svelte/internal-disclose-version.js +1 -0
  44. package/dist/runtime/svelte/internal-flags-async.js +1 -0
  45. package/dist/runtime/svelte/internal-flags-legacy.js +1 -0
  46. package/dist/runtime/svelte/internal-flags-tracing.js +1 -0
  47. package/dist/runtime/svelte/internal.js +1 -0
  48. package/dist/runtime/svelte/legacy.js +1 -0
  49. package/dist/runtime/svelte/motion.js +1 -0
  50. package/dist/runtime/svelte/reactivity-window.js +1 -0
  51. package/dist/runtime/svelte/reactivity.js +1 -0
  52. package/dist/runtime/svelte/store.js +1 -0
  53. package/dist/runtime/svelte/transition.js +1 -0
  54. package/dist/runtime/svelte-i18n.js +1 -0
  55. package/dist/runtime/webfonts/fa-brands-400.ttf +0 -0
  56. package/dist/runtime/webfonts/fa-brands-400.woff2 +0 -0
  57. package/dist/runtime/webfonts/fa-regular-400.ttf +0 -0
  58. package/dist/runtime/webfonts/fa-regular-400.woff2 +0 -0
  59. package/dist/runtime/webfonts/fa-solid-900.ttf +0 -0
  60. package/dist/runtime/webfonts/fa-solid-900.woff2 +0 -0
  61. package/dist/runtime/webfonts/fa-v4compatibility.ttf +0 -0
  62. package/dist/runtime/webfonts/fa-v4compatibility.woff2 +0 -0
  63. package/dist/widget-runtime.zip +0 -0
  64. package/package.json +63 -4
  65. package/scripts/build-zip.js +35 -0
  66. package/scripts/install-local.js +57 -0
  67. package/scripts/loader.js +169 -0
  68. package/scripts/runtime-map.js +33 -0
  69. package/scripts/zip.js +128 -0
  70. package/src/__tests__/components.test.js +77 -0
  71. package/src/__tests__/controllers.test.js +188 -0
  72. package/src/__tests__/define.test.js +276 -0
  73. package/src/__tests__/env.js +111 -0
  74. package/src/__tests__/fixtures/Goal.svelte +5 -0
  75. package/src/__tests__/modules.test.js +251 -0
  76. package/src/__tests__/parity.test.js +123 -0
  77. package/src/api.js +144 -0
  78. package/src/auth.js +2 -0
  79. package/src/component.js +4 -0
  80. package/src/components/Date.svelte +38 -0
  81. package/src/components/NoContent.svelte +13 -0
  82. package/src/components/PageActions.svelte +22 -0
  83. package/src/components/PageTitle.svelte +32 -0
  84. package/src/components/Pagination.svelte +49 -0
  85. package/src/components/PlayerHead.svelte +39 -0
  86. package/src/components/Toast.svelte +16 -0
  87. package/src/components/empty.js +3 -0
  88. package/src/components/index.js +14 -0
  89. package/src/components/panel.js +19 -0
  90. package/src/config.js +100 -0
  91. package/src/context.js +47 -0
  92. package/src/controllers.js +313 -0
  93. package/src/define.js +352 -0
  94. package/src/index.js +38 -0
  95. package/src/internal.js +2 -0
  96. package/src/language.js +181 -0
  97. package/src/plugin.js +20 -0
  98. package/src/route.js +4 -0
  99. package/src/runtime.js +49 -0
  100. package/src/session.js +72 -0
  101. package/src/svelte-runtime.js +3 -0
  102. package/src/svelte.js +72 -0
  103. package/src/text.js +2 -0
  104. package/src/toasts.js +75 -0
  105. package/src/tooltip.js +4 -0
  106. package/src/variables.js +29 -0
  107. package/src/views.js +17 -0
  108. package/README.md +0 -3
@@ -0,0 +1 @@
1
+ import{j as e,w as t}from"./chunks/chunk-9EZydhXt.js";var r=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function o(e,t,r){return e.concat(t).map(function(e){return i(e,r)})}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function h(e,t,r){var n={};return r.isMergeableObject(e)&&s(e).forEach(function(t){n[t]=i(e[t],r)}),s(t).forEach(function(o){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(a(e,o)&&r.isMergeableObject(t[o])?n[o]=function(e,t){if(!t.customMerge)return l;var r=t.customMerge(e);return"function"==typeof r?r:l}(o,r)(e[o],t[o],r):n[o]=i(t[o],r))}),n}function l(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||o,n.isMergeableObject=n.isMergeableObject||r,n.cloneUnlessOtherwiseSpecified=i;var s=Array.isArray(t);return s===Array.isArray(e)?s?n.arrayMerge(e,t,n):h(e,t,n):i(t,n)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,r){return l(e,r,t)},{})};var u=l,c=function(e,t){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},c(e,t)};function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var p=function(){return p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},p.apply(this,arguments)};function m(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function g(e,t){var r=t&&t.cache?t.cache:A,n=t&&t.serializer?t.serializer:B;return(t&&t.strategy?t.strategy:d)(e,{cache:r,serializer:n})}function E(e,t,r,n){var i,o=null==(i=n)||"number"==typeof i||"boolean"==typeof i?n:r(n),s=t.get(o);return void 0===s&&(s=e.call(this,n),t.set(o,s)),s}function b(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=t.get(i);return void 0===o&&(o=e.apply(this,n),t.set(i,o)),o}function y(e,t,r,n,i){return r.bind(t,e,n,i)}function d(e,t){return y(e,this,1===e.length?E:b,t.cache.create(),t.serializer)}"function"==typeof SuppressedError&&SuppressedError;var v,H,T,B=function(){return JSON.stringify(arguments)},_=function(){function e(){this.cache=Object.create(null)}return e.prototype.get=function(e){return this.cache[e]},e.prototype.set=function(e,t){this.cache[e]=t},e}(),A={create:function(){return new _}},P={variadic:function(e,t){return y(e,this,b,t.cache.create(),t.serializer)}};function L(e){return e.type===H.literal}function S(e){return e.type===H.argument}function O(e){return e.type===H.number}function N(e){return e.type===H.date}function w(e){return e.type===H.time}function I(e){return e.type===H.select}function M(e){return e.type===H.plural}function C(e){return e.type===H.pound}function R(e){return e.type===H.tag}function U(e){return!(!e||"object"!=typeof e||e.type!==T.number)}function G(e){return!(!e||"object"!=typeof e||e.type!==T.dateTime)}!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(v||(v={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(H||(H={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(T||(T={}));var D=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,F=/(?:[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;function k(e){var t={};return e.replace(F,function(e){var r=e.length;switch(e[0]){case"G":t.era=4===r?"long":5===r?"narrow":"short";break;case"y":t.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===r?"long":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var j=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function V(e){return e.replace(/^(.*?)-/,"")}var x=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,X=/^(@+)?(\+|#+)?[rs]?$/g,K=/(\*)(0+)|(#+)(0+)|(0+)/g,Y=/^(0+)$/;function Z(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(X,function(e,r,n){return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""}),t}function W(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function z(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!Y.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function $(e){var t=W(e);return t||{}}function J(e){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r];switch(i.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=i.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=V(i.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=p(p(p({},t),{notation:"scientific"}),i.options.reduce(function(e,t){return p(p({},e),$(t))},{}));continue;case"engineering":t=p(p(p({},t),{notation:"engineering"}),i.options.reduce(function(e,t){return p(p({},e),$(t))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(i.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(K,function(e,r,n,i,o,s){if(r)t.minimumIntegerDigits=n.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Y.test(i.stem))t.minimumIntegerDigits=i.stem.length;else if(x.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(x,function(e,r,n,i,o,s){return"*"===n?t.minimumFractionDigits=r.length:i&&"#"===i[0]?t.maximumFractionDigits=i.length:o&&s?(t.minimumFractionDigits=o.length,t.maximumFractionDigits=o.length+s.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});var o=i.options[0];"w"===o?t=p(p({},t),{trailingZeroDisplay:"stripIfInteger"}):o&&(t=p(p({},t),Z(o)))}else if(X.test(i.stem))t=p(p({},t),Z(i.stem));else{var s=W(i.stem);s&&(t=p(p({},t),s));var a=z(i.stem);a&&(t=p(p({},t),a))}}return t}var Q,q={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function ee(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r,n=e.language;return"root"!==n&&(r=e.maximize().region),(q[r||""]||q[n||""]||q["".concat(n,"-001")]||q["001"])[0]}var te=new RegExp("^".concat(D.source,"*")),re=new RegExp("".concat(D.source,"*$"));function ne(e,t){return{start:e,end:t}}var ie=!!String.prototype.startsWith&&"_a".startsWith("a",1),oe=!!String.fromCodePoint,se=!!Object.fromEntries,ae=!!String.prototype.codePointAt,he=!!String.prototype.trimStart,le=!!String.prototype.trimEnd,ue=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},ce=!0;try{ce="a"===(null===(Q=de("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===Q?void 0:Q[0])}catch(e){ce=!1}var fe,pe=ie?function(e,t,r){return e.startsWith(t,r)}:function(e,t,r){return e.slice(r,r+t.length)===t},me=oe?String.fromCodePoint:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r,n="",i=e.length,o=0;i>o;){if((r=e[o++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},ge=se?Object.fromEntries:function(e){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r],o=i[0],s=i[1];t[o]=s}return t},Ee=ae?function(e,t){return e.codePointAt(t)}:function(e,t){var r=e.length;if(!(t<0||t>=r)){var n,i=e.charCodeAt(t);return i<55296||i>56319||t+1===r||(n=e.charCodeAt(t+1))<56320||n>57343?i:n-56320+(i-55296<<10)+65536}},be=he?function(e){return e.trimStart()}:function(e){return e.replace(te,"")},ye=le?function(e){return e.trimEnd()}:function(e){return e.replace(re,"")};function de(e,t){return new RegExp(e,t)}if(ce){var ve=de("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");fe=function(e,t){var r;return ve.lastIndex=t,null!==(r=ve.exec(e)[1])&&void 0!==r?r:""}}else fe=function(e,t){for(var r=[];;){var n=Ee(e,t);if(void 0===n||Ae(n)||Pe(n))break;r.push(n),t+=n>=65536?2:1}return me.apply(void 0,r)};var He,Te=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,r){for(var n=[];!this.isEOF();){var i=this.char();if(123===i){if((o=this.parseArgument(e,r)).err)return o;n.push(o.val)}else{if(125===i&&e>0)break;if(35!==i||"plural"!==t&&"selectordinal"!==t){if(60===i&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(v.UNMATCHED_CLOSING_TAG,ne(this.clonePosition(),this.clonePosition()))}if(60===i&&!this.ignoreTag&&Be(this.peek()||0)){if((o=this.parseTag(e,t)).err)return o;n.push(o.val)}else{var o;if((o=this.parseLiteral(e,t)).err)return o;n.push(o.val)}}else{var s=this.clonePosition();this.bump(),n.push({type:H.pound,location:ne(s,this.clonePosition())})}}}return{val:n,err:null}},e.prototype.parseTag=function(e,t){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:H.literal,value:"<".concat(n,"/>"),location:ne(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(e+1,t,!0);if(i.err)return i;var o=i.val,s=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Be(this.char()))return this.error(v.INVALID_TAG,ne(s,this.clonePosition()));var a=this.clonePosition();return n!==this.parseTagName()?this.error(v.UNMATCHED_CLOSING_TAG,ne(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:H.tag,value:n,children:o,location:ne(r,this.clonePosition())},err:null}:this.error(v.INVALID_TAG,ne(s,this.clonePosition())))}return this.error(v.UNCLOSED_TAG,ne(r,this.clonePosition()))}return this.error(v.INVALID_TAG,ne(r,this.clonePosition()))},e.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&_e(this.char());)this.bump();return this.message.slice(e,this.offset())},e.prototype.parseLiteral=function(e,t){for(var r=this.clonePosition(),n="";;){var i=this.tryParseQuote(t);if(i)n+=i;else{var o=this.tryParseUnquoted(e,t);if(o)n+=o;else{var s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}}}var a=ne(r,this.clonePosition());return{val:{type:H.literal,value:n,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Be(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(r);this.bump()}return me.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),me(r))},e.prototype.parseArgument=function(e,t){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(v.EXPECT_ARGUMENT_CLOSING_BRACE,ne(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(v.EMPTY_ARGUMENT,ne(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(v.MALFORMED_ARGUMENT,ne(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(v.EXPECT_ARGUMENT_CLOSING_BRACE,ne(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:H.argument,value:n,location:ne(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(v.EXPECT_ARGUMENT_CLOSING_BRACE,ne(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(v.MALFORMED_ARGUMENT,ne(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),r=fe(this.message,t),n=t+r.length;return this.bumpTo(n),{value:r,location:ne(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,r,n){var i,o=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(s){case"":return this.error(v.EXPECT_ARGUMENT_TYPE,ne(o,a));case"number":case"date":case"time":this.bumpSpace();var h=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition();if((y=this.parseSimpleArgStyleIfPossible()).err)return y;if(0===(m=ye(y.val)).length)return this.error(v.EXPECT_ARGUMENT_STYLE,ne(this.clonePosition(),this.clonePosition()));h={style:m,styleLocation:ne(l,this.clonePosition())}}if((d=this.tryParseArgumentClose(n)).err)return d;var u=ne(n,this.clonePosition());if(h&&pe(null==h?void 0:h.style,"::",0)){var c=be(h.style.slice(2));if("number"===s)return(y=this.parseNumberSkeletonFromString(c,h.styleLocation)).err?y:{val:{type:H.number,value:r,location:u,style:y.val},err:null};if(0===c.length)return this.error(v.EXPECT_DATE_TIME_SKELETON,u);var f=c;this.locale&&(f=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e.charAt(n);if("j"===i){for(var o=0;n+1<e.length&&e.charAt(n+1)===i;)o++,n++;var s=1+(1&o),a=o<2?1:3+(o>>1),h=ee(t);for("H"!=h&&"k"!=h||(a=0);a-- >0;)r+="a";for(;s-- >0;)r=h+r}else r+="J"===i?"H":i}return r}(c,this.locale));var m={type:T.dateTime,pattern:f,location:h.styleLocation,parsedOptions:this.shouldParseSkeletons?k(f):{}};return{val:{type:"date"===s?H.date:H.time,value:r,location:u,style:m},err:null}}return{val:{type:"number"===s?H.number:"date"===s?H.date:H.time,value:r,location:u,style:null!==(i=null==h?void 0:h.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":var g=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(v.EXPECT_SELECT_ARGUMENT_OPTIONS,ne(g,p({},g)));this.bumpSpace();var E=this.parseIdentifierIfPossible(),b=0;if("select"!==s&&"offset"===E.value){if(!this.bumpIf(":"))return this.error(v.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,ne(this.clonePosition(),this.clonePosition()));var y;if(this.bumpSpace(),(y=this.tryParseDecimalInteger(v.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,v.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return y;this.bumpSpace(),E=this.parseIdentifierIfPossible(),b=y.val}var d,B=this.tryParsePluralOrSelectOptions(e,s,t,E);if(B.err)return B;if((d=this.tryParseArgumentClose(n)).err)return d;var _=ne(n,this.clonePosition());return"select"===s?{val:{type:H.select,value:r,options:ge(B.val),location:_},err:null}:{val:{type:H.plural,value:r,options:ge(B.val),offset:b,pluralType:"plural"===s?"cardinal":"ordinal",location:_},err:null};default:return this.error(v.INVALID_ARGUMENT_TYPE,ne(o,a))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(v.EXPECT_ARGUMENT_CLOSING_BRACE,ne(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(v.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,ne(r,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var r=[];try{r=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],r=0,n=e.split(j).filter(function(e){return e.length>0});r<n.length;r++){var i=n[r].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var o=i[0],s=i.slice(1),a=0,h=s;a<h.length;a++)if(0===h[a].length)throw new Error("Invalid number skeleton");t.push({stem:o,options:s})}return t}(e)}catch(e){return this.error(v.INVALID_NUMBER_SKELETON,t)}return{val:{type:T.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?J(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,r,n){for(var i,o=!1,s=[],a=new Set,h=n.value,l=n.location;;){if(0===h.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var c=this.tryParseDecimalInteger(v.EXPECT_PLURAL_ARGUMENT_SELECTOR,v.INVALID_PLURAL_ARGUMENT_SELECTOR);if(c.err)return c;l=ne(u,this.clonePosition()),h=this.message.slice(u.offset,this.offset())}if(a.has(h))return this.error("select"===t?v.DUPLICATE_SELECT_ARGUMENT_SELECTOR:v.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,l);"other"===h&&(o=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?v.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:v.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,ne(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(e+1,t,r);if(p.err)return p;var m=this.tryParseArgumentClose(f);if(m.err)return m;s.push([h,{value:p.val,location:ne(f,this.clonePosition())}]),a.add(h),this.bumpSpace(),h=(i=this.parseIdentifierIfPossible()).value,l=i.location}return 0===s.length?this.error("select"===t?v.EXPECT_SELECT_ARGUMENT_SELECTOR:v.EXPECT_PLURAL_ARGUMENT_SELECTOR,ne(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(v.MISSING_OTHER_CLAUSE,ne(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var r=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var i=!1,o=0;!this.isEOF();){var s=this.char();if(!(s>=48&&s<=57))break;i=!0,o=10*o+(s-48),this.bump()}var a=ne(n,this.clonePosition());return i?ue(o*=r)?{val:o,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Ee(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(pe(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Ae(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),r=this.message.charCodeAt(t+(e>=65536?2:1));return null!=r?r:null},e}();function Be(e){return e>=97&&e<=122||e>=65&&e<=90}function _e(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Ae(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Pe(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function Le(e){e.forEach(function(e){if(delete e.location,I(e)||M(e))for(var t in e.options)delete e.options[t].location,Le(e.options[t].value);else O(e)&&U(e.style)||(N(e)||w(e))&&G(e.style)?delete e.style.location:R(e)&&Le(e.children)})}function Se(e,t){void 0===t&&(t={}),t=p({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new Te(e,t).parse();if(r.err){var n=SyntaxError(v[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return(null==t?void 0:t.captureLocation)||Le(r.val),r.val}!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(He||(He={}));var Oe,Ne=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.code=r,i.originalMessage=n,i}return f(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),we=function(e){function t(t,r,n,i){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),He.INVALID_VALUE,i)||this}return f(t,e),t}(Ne),Ie=function(e){function t(t,r,n){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(r),He.INVALID_VALUE,n)||this}return f(t,e),t}(Ne),Me=function(e){function t(t,r){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(r,'"'),He.MISSING_VALUE,r)||this}return f(t,e),t}(Ne);function Ce(e){return"function"==typeof e}function Re(e,t,r,n,i,o,s){if(1===e.length&&L(e[0]))return[{type:Oe.literal,value:e[0].value}];for(var a=[],h=0,l=e;h<l.length;h++){var u=l[h];if(L(u))a.push({type:Oe.literal,value:u.value});else if(C(u))"number"==typeof o&&a.push({type:Oe.literal,value:r.getNumberFormat(t).format(o)});else{var c=u.value;if(!i||!(c in i))throw new Me(c,s);var f=i[c];if(S(u))f&&"string"!=typeof f&&"number"!=typeof f||(f="string"==typeof f||"number"==typeof f?String(f):""),a.push({type:"string"==typeof f?Oe.literal:Oe.object,value:f});else if(N(u)){var p="string"==typeof u.style?n.date[u.style]:G(u.style)?u.style.parsedOptions:void 0;a.push({type:Oe.literal,value:r.getDateTimeFormat(t,p).format(f)})}else if(w(u)){p="string"==typeof u.style?n.time[u.style]:G(u.style)?u.style.parsedOptions:n.time.medium;a.push({type:Oe.literal,value:r.getDateTimeFormat(t,p).format(f)})}else if(O(u)){(p="string"==typeof u.style?n.number[u.style]:U(u.style)?u.style.parsedOptions:void 0)&&p.scale&&(f*=p.scale||1),a.push({type:Oe.literal,value:r.getNumberFormat(t,p).format(f)})}else{if(R(u)){var m=u.children,g=u.value,E=i[g];if(!Ce(E))throw new Ie(g,"function",s);var b=E(Re(m,t,r,n,i,o).map(function(e){return e.value}));Array.isArray(b)||(b=[b]),a.push.apply(a,b.map(function(e){return{type:"string"==typeof e?Oe.literal:Oe.object,value:e}}))}if(I(u)){if(!(y=u.options[f]||u.options.other))throw new we(u.value,f,Object.keys(u.options),s);a.push.apply(a,Re(y.value,t,r,n,i))}else if(M(u)){var y;if(!(y=u.options["=".concat(f)])){if(!Intl.PluralRules)throw new Ne('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',He.MISSING_INTL_API,s);var d=r.getPluralRules(t,{type:u.pluralType}).select(f-(u.offset||0));y=u.options[d]||u.options.other}if(!y)throw new we(u.value,f,Object.keys(u.options),s);a.push.apply(a,Re(y.value,t,r,n,i,f-(u.offset||0)))}else;}}}return function(e){return e.length<2?e:e.reduce(function(e,t){var r=e[e.length-1];return r&&r.type===Oe.literal&&t.type===Oe.literal?r.value+=t.value:e.push(t),e},[])}(a)}function Ue(e,t){return t?Object.keys(e).reduce(function(r,n){var i,o;return r[n]=(i=e[n],(o=t[n])?p(p(p({},i||{}),o||{}),Object.keys(i).reduce(function(e,t){return e[t]=p(p({},i[t]),o[t]||{}),e},{})):i),r},p({},e)):e}function Ge(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(Oe||(Oe={}));var De=function(){function e(t,r,n,i){void 0===r&&(r=e.defaultLocale);var o,s=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=s.formatToParts(e);if(1===t.length)return t[0].value;var r=t.reduce(function(e,t){return e.length&&t.type===Oe.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e},[]);return r.length<=1?r[0]||"":r},this.formatToParts=function(e){return Re(s.ast,s.locales,s.formatters,s.formats,e,void 0,s.message)},this.resolvedOptions=function(){var e;return{locale:(null===(e=s.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(s.locales)[0]}},this.getAst=function(){return s.ast},this.locales=r,this.resolvedLocale=e.resolveLocale(r),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var a=i||{};a.formatters;var h=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(a,["formatters"]);this.ast=e.__parse(t,p(p({},h),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Ue(e.formats,n),this.formatters=i&&i.formatters||(void 0===(o=this.formatterCache)&&(o={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:g(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.NumberFormat).bind.apply(e,m([void 0],t,!1)))},{cache:Ge(o.number),strategy:P.variadic}),getDateTimeFormat:g(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.DateTimeFormat).bind.apply(e,m([void 0],t,!1)))},{cache:Ge(o.dateTime),strategy:P.variadic}),getPluralRules:g(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.PluralRules).bind.apply(e,m([void 0],t,!1)))},{cache:Ge(o.pluralRules),strategy:P.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){if(void 0!==Intl.Locale){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])}},e.__parse=Se,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const Fe={},ke=(e,t,r)=>r?(t in Fe||(Fe[t]={}),e in Fe[t]||(Fe[t][e]=r),r):r,je=(e,t)=>{if(null==t)return;if(t in Fe&&e in Fe[t])return Fe[t][e];const r=dt(t);for(let n=0;n<r.length;n++){const i=Ke(r[n],e);if(i)return ke(e,t,i)}};let Ve;const xe=t({});function Xe(e){return e in Ve}function Ke(e,t){if(!Xe(e))return null;const r=function(e){return Ve[e]||null}(e);return function(e,t){if(null==t)return;if(t in e)return e[t];const r=t.split(".");let n=e;for(let e=0;e<r.length;e++)if("object"==typeof n){if(e>0){const t=r.slice(e,r.length).join(".");if(t in n){n=n[t];break}}n=n[r[e]]}else n=void 0;return n}(r,t)}function Ye(e,...t){delete Fe[e],xe.update(r=>(r[e]=u.all([r[e]||{},...t]),r))}const Ze=e([xe],([e])=>Object.keys(e));xe.subscribe(e=>Ve=e);const We={};function ze(e){return We[e]}function $e(e){return null!=e&&dt(e).some(e=>{var t;return null==(t=ze(e))?void 0:t.size})}function Je(e,t){const r=Promise.all(t.map(t=>(function(e,t){We[e].delete(t),0===We[e].size&&delete We[e]}(e,t),t().then(e=>e.default||e))));return r.then(t=>Ye(e,...t))}const Qe={};function qe(e){if(!$e(e))return e in Qe?Qe[e]:Promise.resolve();const t=function(e){return dt(e).map(e=>{const t=ze(e);return[e,t?[...t]:[]]}).filter(([,e])=>e.length>0)}(e);return Qe[e]=Promise.all(t.map(([e,t])=>Je(e,t))).then(()=>{if($e(e))return qe(e);delete Qe[e]}),Qe[e]}function et(e,t){ze(e)||function(e){We[e]=new Set}(e);const r=ze(e);ze(e).has(t)||(Xe(e)||xe.update(t=>(t[e]={},t)),r.add(t))}var tt=Object.getOwnPropertySymbols,rt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable;function it({locale:e,id:t}){console.warn(`[svelte-i18n] The message "${t}" was not found in "${dt(e).join('", "')}".${$e(vt())?"\n\nNote: there are at least one loader still registered to this locale that wasn't executed.":""}`)}const ot={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function st(){return ot}function at(e){const t=e,{formats:r}=t,n=((e,t)=>{var r={};for(var n in e)rt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&tt)for(var n of tt(e))t.indexOf(n)<0&&nt.call(e,n)&&(r[n]=e[n]);return r})(t,["formats"]);let i=e.fallbackLocale;if(e.initialLocale)try{De.resolveLocale(e.initialLocale)&&(i=e.initialLocale)}catch(t){console.warn(`[svelte-i18n] The initial locale "${e.initialLocale}" is not a valid locale.`)}return n.warnOnMissingMessages&&(delete n.warnOnMissingMessages,null==n.handleMissingMessage?n.handleMissingMessage=it:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(ot,n,{initialLocale:i}),r&&("number"in r&&Object.assign(ot.formats.number,r.number),"date"in r&&Object.assign(ot.formats.date,r.date),"time"in r&&Object.assign(ot.formats.time,r.time)),Ht.set(i)}const ht=t(!1);var lt=Object.defineProperty,ut=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,ft=Object.getOwnPropertySymbols,pt=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable,gt=(e,t,r)=>t in e?lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;let Et;const bt=t(null);function yt(e){return e.split("-").map((e,t,r)=>r.slice(0,t+1).join("-")).reverse()}function dt(e,t=st().fallbackLocale){const r=yt(e);return t?[...new Set([...r,...yt(t)])]:r}function vt(){return null!=Et?Et:void 0}bt.subscribe(e=>{Et=null!=e?e:void 0,"undefined"!=typeof window&&null!=e&&document.documentElement.setAttribute("lang",e)});const Ht=(Tt=((e,t)=>{for(var r in t||(t={}))pt.call(t,r)&&gt(e,r,t[r]);if(ft)for(var r of ft(t))mt.call(t,r)&&gt(e,r,t[r]);return e})({},bt),ut(Tt,ct({set:e=>{if(e&&function(e){if(null==e)return;const t=dt(e);for(let e=0;e<t.length;e++){const r=t[e];if(Xe(r))return r}}(e)&&$e(e)){const{loadingDelay:t}=st();let r;return"undefined"!=typeof window&&null!=vt()&&t?r=window.setTimeout(()=>ht.set(!0),t):ht.set(!0),qe(e).then(()=>{bt.set(e)}).finally(()=>{clearTimeout(r),ht.set(!1)})}return bt.set(e)}})));var Tt;const Bt=(e,t)=>{const r=e.split("&").find(e=>0===e.indexOf(`${t}=`));return r?r.split("=").pop():null},_t=(e,t)=>{const r=t.exec(e);return r&&r[1]||null},At=e=>"undefined"==typeof window?null:_t(window.location.hostname,e),Pt=e=>"undefined"==typeof window?null:_t(window.location.pathname,e),Lt=()=>"undefined"==typeof window?null:window.navigator.language||window.navigator.languages[0],St=e=>"undefined"==typeof window?null:Bt(window.location.search.substr(1),e),Ot=e=>"undefined"==typeof window?null:Bt(window.location.hash.substr(1),e),Nt=e=>{const t=Object.create(null);return r=>{const n=JSON.stringify(r);return n in t?t[n]:t[n]=e(r)}};var wt=Object.defineProperty,It=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,Rt=(e,t,r)=>t in e?wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ut=(e,t)=>{for(var r in t||(t={}))Mt.call(t,r)&&Rt(e,r,t[r]);if(It)for(var r of It(t))Ct.call(t,r)&&Rt(e,r,t[r]);return e},Gt=(e,t)=>{var r={};for(var n in e)Mt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&It)for(var n of It(e))t.indexOf(n)<0&&Ct.call(e,n)&&(r[n]=e[n]);return r};const Dt=(e,t)=>{const{formats:r}=st();if(e in r&&t in r[e])return r[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Ft=Nt(e=>{var t=e,{locale:r,format:n}=t,i=Gt(t,["locale","format"]);if(null==r)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(i=Dt("number",n)),new Intl.NumberFormat(r,i)}),kt=Nt(e=>{var t=e,{locale:r,format:n}=t,i=Gt(t,["locale","format"]);if(null==r)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?i=Dt("date",n):0===Object.keys(i).length&&(i=Dt("date","short")),new Intl.DateTimeFormat(r,i)}),jt=Nt(e=>{var t=e,{locale:r,format:n}=t,i=Gt(t,["locale","format"]);if(null==r)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?i=Dt("time",n):0===Object.keys(i).length&&(i=Dt("time","short")),new Intl.DateTimeFormat(r,i)}),Vt=(e={})=>{var t=e,{locale:r=vt()}=t,n=Gt(t,["locale"]);return Ft(Ut({locale:r},n))},xt=(e={})=>{var t=e,{locale:r=vt()}=t,n=Gt(t,["locale"]);return kt(Ut({locale:r},n))},Xt=(e={})=>{var t=e,{locale:r=vt()}=t,n=Gt(t,["locale"]);return jt(Ut({locale:r},n))},Kt=Nt((e,t=vt())=>new De(e,t,st().formats,{ignoreTag:st().ignoreTag})),Yt=(e,t={})=>{var r,n,i,o;let s=t;"object"==typeof e&&(s=e,e=s.id);const{values:a,locale:h=vt(),default:l}=s;if(null==h)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let u=je(e,h);if(u){if("string"!=typeof u)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof u}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),u}else u=null!=(o=null!=(i=null==(n=(r=st()).handleMissingMessage)?void 0:n.call(r,{locale:h,id:e,defaultValue:l}))?i:l)?o:e;if(!a)return u;let c=u;try{c=Kt(u,h).format(a)}catch(t){t instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return c},Zt=(e,t)=>Xt(t).format(e),Wt=(e,t)=>xt(t).format(e),zt=(e,t)=>Vt(t).format(e),$t=(e,t=vt())=>je(e,t),Jt=e([Ht,xe],()=>Yt),Qt=e([Ht],()=>Zt),qt=e([Ht],()=>Wt),er=e([Ht],()=>zt),tr=e([Ht,xe],()=>$t);function rr(e){let t;const r=e.subscribe(e=>t=e),n=(...e)=>t(...e);return n.freeze=r,n}function nr(e){return e}function ir(e){return qe(e||vt()||st().initialLocale)}export{Jt as _,Ye as addMessages,qt as date,nr as defineMessages,xe as dictionary,Jt as format,xt as getDateFormatter,Ot as getLocaleFromHash,At as getLocaleFromHostname,Lt as getLocaleFromNavigator,Pt as getLocaleFromPathname,St as getLocaleFromQueryString,Kt as getMessageFormatter,Vt as getNumberFormatter,Xt as getTimeFormatter,at as init,ht as isLoading,tr as json,Ht as locale,Ze as locales,er as number,et as register,Jt as t,Qt as time,rr as unwrapFunctionStore,ir as waitLocale};
Binary file
package/package.json CHANGED
@@ -1,6 +1,65 @@
1
1
  {
2
2
  "name": "@panomc/widget-host",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0-dev.62",
4
+ "description": "Host modules and runtime that let Pano plugin views run as web-component widgets outside a theme.",
5
+ "author": "PanoMC",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "repository": {
9
+ "url": "https://github.com/PanoMC/sdk"
10
+ },
11
+ "exports": {
12
+ ".": "./src/index.js",
13
+ "./define": "./src/define.js",
14
+ "./svelte": "./src/svelte.js",
15
+ "./language": "./src/language.js",
16
+ "./toasts": "./src/toasts.js",
17
+ "./api": "./src/api.js",
18
+ "./controllers": "./src/controllers.js",
19
+ "./components": "./src/components/index.js",
20
+ "./views": "./src/views.js",
21
+ "./auth": "./src/auth.js",
22
+ "./tooltip": "./src/tooltip.js",
23
+ "./text": "./src/text.js",
24
+ "./route": "./src/route.js",
25
+ "./variables": "./src/variables.js",
26
+ "./internal": "./src/internal.js",
27
+ "./components/panel": "./src/components/panel.js",
28
+ "./utils/component": "./src/component.js",
29
+ "./runtime-map": "./scripts/runtime-map.js",
30
+ "./install-local": "./scripts/install-local.js",
31
+ "./package.json": "./package.json"
32
+ },
33
+ "files": [
34
+ "src",
35
+ "scripts",
36
+ "dist"
37
+ ],
38
+ "scripts": {
39
+ "build": "rollup -c rollup.config.js && node scripts/build-zip.js",
40
+ "build:runtime": "rollup -c rollup.config.js",
41
+ "build:zip": "node scripts/build-zip.js",
42
+ "install-local": "node scripts/install-local.js",
43
+ "test": "bun test"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "dependencies": {
49
+ "@panomc/client": "1.0.0-dev.62",
50
+ "@panomc/plugin-kit": "1.0.0-dev.62",
51
+ "svelte-i18n": "^4.0.1"
52
+ },
53
+ "peerDependencies": {
54
+ "@panomc/sdk": "^2.0.0-dev.62",
55
+ "svelte": "*"
56
+ },
57
+ "devDependencies": {
58
+ "@panomc/sdk": "2.0.0-dev.62",
59
+ "@rollup/plugin-node-resolve": "^16.0.0",
60
+ "@rollup/plugin-terser": "^0.4.4",
61
+ "happy-dom": "^20.0.0",
62
+ "rollup": "^4.32.1",
63
+ "rollup-plugin-svelte": "^7.2.2"
64
+ }
65
+ }
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ // Packs `dist/runtime/` into `dist/widget-runtime.zip` (doc 06 section 3.3). The zip root is the runtime folder itself
3
+ // (`loader.js`, `svelte/`, `host/`, `css/`, ...), which is what Pano serves from `widget-runtime/` or `UIFiles/widget-runtime.zip`.
4
+ // Usage: node scripts/build-zip.js (run `rollup -c` first; `bun run build` does both)
5
+ import { mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
6
+ import { join, relative } from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+ import { writeZip } from './zip.js';
9
+
10
+ const root = fileURLToPath(new URL('..', import.meta.url));
11
+ export const RUNTIME_DIR = join(root, 'dist/runtime');
12
+ export const ZIP_FILE = join(root, 'dist/widget-runtime.zip');
13
+
14
+ const walk = (dir) =>
15
+ readdirSync(dir, { withFileTypes: true }).flatMap((e) => (e.isDirectory() ? walk(join(dir, e.name)) : [join(dir, e.name)]));
16
+
17
+ export function buildZip(runtimeDir = RUNTIME_DIR, zipFile = ZIP_FILE) {
18
+ let files;
19
+ try {
20
+ files = walk(runtimeDir);
21
+ } catch {
22
+ throw new Error(`${runtimeDir} does not exist: run \`bun run build\` in packages/widget-host first`);
23
+ }
24
+ if (!files.some((f) => f.endsWith('loader.js'))) throw new Error(`${runtimeDir} has no loader.js: the runtime build did not finish`);
25
+
26
+ const entries = files.map((f) => ({ name: relative(runtimeDir, f).split('\\').join('/'), data: readFileSync(f) }));
27
+ mkdirSync(join(zipFile, '..'), { recursive: true });
28
+ writeFileSync(zipFile, writeZip(entries));
29
+ return { zipFile, files: entries.length };
30
+ }
31
+
32
+ if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
33
+ const { zipFile, files } = buildZip();
34
+ console.log(`wrote ${zipFile} (${files} files)`);
35
+ }
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+ // Unpacks `dist/widget-runtime.zip` to `<pano dir>/widget-runtime/`, the folder Pano reads the widget runtime from before it falls
3
+ // back to the classpath `UIFiles/widget-runtime.zip` (doc 06 section 3.3). Nothing is downloaded, nothing is released.
4
+ // Usage: node scripts/install-local.js <pano dir> [--zip <file>]
5
+ import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
6
+ import { dirname, join, resolve, sep } from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+ import { readZip } from './zip.js';
9
+
10
+ const root = fileURLToPath(new URL('..', import.meta.url));
11
+
12
+ /**
13
+ * @param {string} panoDir the folder that holds `themes/` (and gets `widget-runtime/`)
14
+ * @param {string} [zipFile]
15
+ * @returns {{ target: string, files: number }}
16
+ */
17
+ export function installLocal(panoDir, zipFile = join(root, 'dist/widget-runtime.zip')) {
18
+ if (!panoDir) throw new Error('usage: install-local.js <pano dir> [--zip <file>]');
19
+ const pano = resolve(panoDir);
20
+ if (!existsSync(pano) || !statSync(pano).isDirectory()) throw new Error(`${pano} is not a directory`);
21
+ if (!existsSync(zipFile)) throw new Error(`${zipFile} does not exist: run \`bun run build\` in packages/widget-host first`);
22
+
23
+ const entries = readZip(readFileSync(zipFile));
24
+ if (!entries.some((e) => e.name === 'loader.js')) throw new Error(`${zipFile} is not a widget runtime (no loader.js)`);
25
+
26
+ const target = join(pano, 'widget-runtime');
27
+ const staging = join(pano, `.widget-runtime-${process.pid}`);
28
+ rmSync(staging, { recursive: true, force: true });
29
+
30
+ try {
31
+ for (const { name, data } of entries) {
32
+ const file = resolve(staging, name);
33
+ if (name.startsWith('/') || !file.startsWith(staging + sep)) throw new Error(`${name}: path leaves the target folder`);
34
+ mkdirSync(dirname(file), { recursive: true });
35
+ writeFileSync(file, data);
36
+ }
37
+ rmSync(target, { recursive: true, force: true });
38
+ renameSync(staging, target);
39
+ } catch (error) {
40
+ rmSync(staging, { recursive: true, force: true });
41
+ throw error;
42
+ }
43
+ return { target, files: entries.length };
44
+ }
45
+
46
+ if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
47
+ const args = process.argv.slice(2);
48
+ const zipAt = args.indexOf('--zip');
49
+ const zip = zipAt >= 0 ? resolve(args.splice(zipAt, 2)[1]) : undefined;
50
+ try {
51
+ const { target, files } = installLocal(args[0], zip);
52
+ console.log(`installed ${files} files to ${target}`);
53
+ } catch (error) {
54
+ console.error(error.message);
55
+ process.exit(1);
56
+ }
57
+ }
@@ -0,0 +1,169 @@
1
+ // The page loader of the widget runtime (doc 06 section 3.4). The build turns this file into `runtime/loader.js`; Pano serves it at
2
+ // `/api/v1/widgets/loader.js` (and at `/api/v1/widgets/runtime/loader.js`).
3
+ //
4
+ // <script type="module" src="https://pano.example.com/api/v1/widgets/loader.js"></script>
5
+ // <pano-market-goal></pano-market-goal>
6
+ //
7
+ // It has no static import: the runtime (Svelte, the host modules) is only loaded when the first `pano-*` widget tag of the
8
+ // index appears on the page, from the one URL every widget module also uses, so there is one Svelte per page.
9
+ //
10
+ // Assumption (the Kotlin side is unit PF-28): `index.json` lists `module` and the `styles` URLs either absolute, rooted (`/...`)
11
+ // or relative to the plugin's file base `<apiBase>/api/v1/plugins/<pluginId>/_/ui/` (widget modules sit in `widgets/`).
12
+
13
+ const PREFIX = 'pano-';
14
+ const w = window;
15
+ const here = import.meta.url;
16
+
17
+ // apiBase = the loader URL up to `/api/v1/`; without that shape (a loader opened from a plain folder) the runtime sits beside it.
18
+ const shape = /^(.*?)\/api\/v1\/(?:widgets\/)?(?:runtime\/)?[^/]*$/.exec(here);
19
+ const own = new URL(here);
20
+ const sameOrigin = own.origin === location.origin;
21
+ const detected = shape ? shape[1] : null;
22
+ // On the page's own origin a path prefix (`/pano`) is a reverse proxy: a relative base, which the host reads as "no CSRF".
23
+ const state = {
24
+ apiBase: detected === null ? '' : sameOrigin ? detected.slice(own.origin.length) : detected,
25
+ locale: undefined,
26
+ urls: undefined,
27
+ navigate: undefined,
28
+ fetch: undefined,
29
+ csrf: undefined,
30
+ };
31
+ const absolute = (base) => new URL(base || '/', location.href).href.replace(/\/$/, '');
32
+ const apiRoot = () => `${absolute(state.apiBase)}/api/v1/`;
33
+ const runtimeUrl = (file) => (detected === null ? here.replace(/[^/?#]*([?#].*)?$/, '') : `${apiRoot()}widgets/runtime/`) + file;
34
+
35
+ const script = [...document.querySelectorAll('script[src]')].find((s) => s.src === here);
36
+ const palette = script?.dataset.palette || 'light';
37
+ state.locale = script?.dataset.locale || undefined;
38
+
39
+ /** @type {any} */
40
+ let index = null;
41
+ /** @type {Promise<any> | null} */
42
+ let hostReady = null;
43
+ let started = false;
44
+ let generation = 0;
45
+ const seen = new Set();
46
+ const headSheets = new Set();
47
+
48
+ function headSheet(href) {
49
+ if (!href || headSheets.has(href)) return;
50
+ headSheets.add(href);
51
+ const link = document.createElement('link');
52
+ link.rel = 'stylesheet';
53
+ link.href = href;
54
+ document.head.append(link);
55
+ }
56
+
57
+ function fileUrl(pluginId, value, sub) {
58
+ if (!value) return undefined;
59
+ if (/^[a-z][a-z0-9+.-]*:|^\/\//i.test(value)) return value;
60
+ if (value.startsWith('/')) return new URL(value, absolute(state.apiBase) + '/').href;
61
+ return `${apiRoot()}plugins/${pluginId}/_/ui/${sub}${value}`;
62
+ }
63
+
64
+ function loadHost() {
65
+ hostReady ??= import(runtimeUrl('host/index.js')).then((host) => {
66
+ push(host);
67
+ return host;
68
+ });
69
+ return hostReady;
70
+ }
71
+
72
+ function push(host) {
73
+ const { apiBase, locale, urls, navigate, fetch, csrf } = state;
74
+ host.configure({
75
+ apiBase,
76
+ siteUrl: index?.site?.url,
77
+ ...(locale || index?.site?.locale ? { locale: locale || index.site.locale } : {}),
78
+ ...(urls ? { urls } : {}),
79
+ ...(navigate ? { navigate } : {}),
80
+ ...(fetch ? { fetch } : {}),
81
+ ...(csrf ? { csrf } : {}),
82
+ });
83
+ }
84
+
85
+ async function define(tag) {
86
+ const entry = index.widgets[tag];
87
+ const [host, mod] = await Promise.all([loadHost(), import(fileUrl(entry.pluginId, entry.module, 'widgets/'))]);
88
+ const styles = entry.styles ?? {};
89
+ host.defineWidget(tag, mod, {
90
+ ns: entry.ns,
91
+ pluginId: entry.pluginId,
92
+ session: entry.session,
93
+ controllers: entry.controllers ? fileUrl(entry.pluginId, 'controllers.mjs', 'controllers/') : undefined,
94
+ styles: {
95
+ hash: styles.hash,
96
+ fallback: fileUrl(entry.pluginId, styles.fallback, ''),
97
+ icons: fileUrl(entry.pluginId, styles.icons, ''),
98
+ },
99
+ });
100
+ }
101
+
102
+ function tidy(el) {
103
+ if (!el.hasAttribute('data-bs-theme')) el.setAttribute('data-bs-theme', palette);
104
+ }
105
+
106
+ function scan(root) {
107
+ const gen = generation;
108
+ const nodes = root.nodeType === 1 && root.localName.startsWith(PREFIX) ? [root] : [];
109
+ if (root.querySelectorAll) nodes.push(...root.querySelectorAll('*'));
110
+ for (const el of nodes) {
111
+ const tag = el.localName;
112
+ if (!tag.startsWith(PREFIX) || !index.widgets[tag]) continue;
113
+ tidy(el);
114
+ if (seen.has(tag)) continue;
115
+ seen.add(tag);
116
+ headSheet(runtimeUrl('css/pano-tokens.css'));
117
+ const icons = index.widgets[tag].styles?.icons;
118
+ if (icons) headSheet(fileUrl(index.widgets[tag].pluginId, icons, ''));
119
+ define(tag).catch((e) => {
120
+ if (gen === generation) seen.delete(tag);
121
+ console.warn(`[pano-widgets] ${tag} failed to load`, e);
122
+ });
123
+ }
124
+ }
125
+
126
+ async function start() {
127
+ const gen = ++generation;
128
+ try {
129
+ const res = await (state.fetch ?? fetch)(`${apiRoot()}widgets/index.json`, { credentials: 'omit' });
130
+ if (!res.ok) throw new Error(`HTTP ${res.status}`);
131
+ const data = await res.json();
132
+ if (gen !== generation) return;
133
+ index = data;
134
+ } catch (e) {
135
+ console.warn('[pano-widgets] could not read the widget index', e);
136
+ return;
137
+ }
138
+ if (hostReady) hostReady.then(push);
139
+ if (!started) {
140
+ started = true;
141
+ new MutationObserver((records) => {
142
+ for (const r of records) for (const n of r.addedNodes) if (n.nodeType === 1) scan(n);
143
+ }).observe(document.documentElement, { childList: true, subtree: true });
144
+ }
145
+ seen.clear();
146
+ scan(document);
147
+ }
148
+
149
+ w.PanoWidgets = {
150
+ /** @param {{ apiBase?: string, locale?: string, urls?: Record<string,string>, navigate?: Function, fetch?: Function, csrf?: string }} [options] */
151
+ configure(options = {}) {
152
+ const apiChanged = options.apiBase !== undefined && options.apiBase !== state.apiBase;
153
+ for (const key of Object.keys(state)) if (options[key] !== undefined) state[key] = options[key];
154
+ if (hostReady) hostReady.then(push);
155
+ if (apiChanged && index) {
156
+ index = null;
157
+ hostReady = null;
158
+ start();
159
+ }
160
+ return { ...state };
161
+ },
162
+ /** Resolves with the host module once the first widget has loaded the runtime (rejects when there is no widget). */
163
+ host: () => loadHost(),
164
+ };
165
+
166
+ // Module scripts that follow the loader (a `configure` call) run before DOMContentLoaded, so the first scan waits for it.
167
+ const go = () => setTimeout(start, 0);
168
+ if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', go, { once: true });
169
+ else go();
@@ -0,0 +1,33 @@
1
+ // Which file of `dist/runtime/` stands for which bare specifier (doc 06 section 3.3). The runtime build (`rollup.config.js`),
2
+ // the widget target of the plugin kit (relative `output.paths`) and the tests read this one table.
3
+ //
4
+ // svelte, svelte/store, svelte/internal/client ... -> the file names of RUNTIME_SPECIFIERS `svelte/internal-client.js`
5
+ // svelte-i18n -> `svelte-i18n.js`
6
+ // @panomc/sdk, @panomc/sdk/toasts ... -> `host/<shim name of RUNTIME_SPECIFIERS>` `host/toasts.js`, `host/utils-api.js`
7
+ //
8
+ // plus `loader.js`, `css/pano-tokens.css`, `css/pano-fallback-icons.css`, `webfonts/*` and `runtime.json` (not specifiers).
9
+ import { fileURLToPath } from 'node:url';
10
+ import { RUNTIME_FILES, widgetImportPath } from '@panomc/sdk/runtime-specifiers';
11
+ import { SPECIFIER_MODULES } from '../src/index.js';
12
+
13
+ export const PACKAGE_DIR = fileURLToPath(new URL('..', import.meta.url));
14
+ export const SRC_DIR = fileURLToPath(new URL('../src/', import.meta.url));
15
+
16
+ // RUNTIME_FILES and widgetImportPath are owned by @panomc/sdk (shared with the plugin kit); re-exported here.
17
+ export { RUNTIME_FILES, widgetImportPath };
18
+
19
+ /** Specifier -> the source file of this package that implements it (`@panomc/sdk*` only). */
20
+ export const HOST_SOURCES = Object.freeze(
21
+ Object.fromEntries(Object.entries(SPECIFIER_MODULES).map(([specifier, file]) => [specifier, SRC_DIR + file])),
22
+ );
23
+
24
+ /** Rollup `input` of the runtime build: chunk name (file without `.js`) -> module to resolve. */
25
+ export function runtimeInput(loaderFile) {
26
+ /** @type {Record<string, string>} */
27
+ const input = {};
28
+ for (const [specifier, file] of Object.entries(RUNTIME_FILES)) {
29
+ input[file.replace(/\.js$/, '')] = HOST_SOURCES[specifier] ?? specifier;
30
+ }
31
+ input.loader = loaderFile;
32
+ return input;
33
+ }