@mborecki/crossword 0.2.1 → 0.4.0

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.
@@ -2155,10 +2155,32 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2155
2155
  return propValue === "false" ? false : propValue === "" || !!propValue;
2156
2156
  }
2157
2157
  }
2158
+ if (propType & 1 /* String */) {
2159
+ return String(propValue);
2160
+ }
2158
2161
  return propValue;
2159
2162
  }
2160
2163
  return propValue;
2161
2164
  };
2165
+ var getElement = (ref) => {
2166
+ var _a;
2167
+ return (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ ;
2168
+ };
2169
+
2170
+ // src/runtime/event-emitter.ts
2171
+ var createEvent = (ref, name, flags) => {
2172
+ const elm = getElement(ref);
2173
+ return {
2174
+ emit: (detail) => {
2175
+ return emitEvent(elm, name, {
2176
+ bubbles: true,
2177
+ composed: true,
2178
+ cancelable: true,
2179
+ detail
2180
+ });
2181
+ }
2182
+ };
2183
+ };
2162
2184
  var emitEvent = (elm, name, opts) => {
2163
2185
  const ev = plt.ce(name, opts);
2164
2186
  elm.dispatchEvent(ev);
@@ -3213,6 +3235,7 @@ function transformTag(tag) {
3213
3235
  }
3214
3236
 
3215
3237
  exports.bootstrapLazy = bootstrapLazy;
3238
+ exports.createEvent = createEvent;
3216
3239
  exports.forceUpdate = forceUpdate;
3217
3240
  exports.h = h;
3218
3241
  exports.promiseResolve = promiseResolve;
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BlTGwvVC.js');
3
+ var index = require('./index-rgQMtYdn.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  const defineCustomElements = async (win, options) => {
7
7
  if (typeof window === 'undefined') return undefined;
8
8
  await appGlobals.globalScripts();
9
- return index.bootstrapLazy([["mb-crossword.cjs",[[529,"mb-crossword",{"init":[4],"data":[16],"showCluePreview":[4,"show-clue-preview"],"hWords":[32],"vWords":[32],"currentClueId":[32],"currentClue":[32],"isFocused":[32],"selectedCell":[32],"specialBorders":[32],"specialCells":[32],"labels":[32],"boardWidth":[32],"boardHeight":[32],"cells":[32],"initGame":[64],"checkAnswer":[64]},null,{"data":[{"watchData":0}]}]]]], options);
9
+ return index.bootstrapLazy([["mb-crossword.cjs",[[529,"mb-crossword",{"init":[4],"data":[16],"showCluePreview":[4,"show-clue-preview"],"clueListStyle":[1,"clue-list-style"],"hWords":[32],"vWords":[32],"currentClueId":[32],"currentClue":[32],"isFocused":[32],"selectedCell":[32],"specialBorders":[32],"specialCells":[32],"labels":[32],"boardWidth":[32],"boardHeight":[32],"cells":[32],"floatingPreviewHackParams":[32],"initGame":[64],"checkAnswer":[64],"selectClue":[64]},null,{"data":[{"watchData":0}]}]]]], options);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -1,10 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BlTGwvVC.js');
3
+ var index = require('./index-rgQMtYdn.js');
4
4
  var index$1 = require('./index-CEGyCfpa.js');
5
5
 
6
- function Clue({ isCurrent, word, onPointerDown, preview, showPreview }) {
7
- return index.h("p", { onPointerDown: onPointerDown, part: "clue", class: {
6
+ function Clue({ isCurrent, word, onPointerDown, preview, showPreview, tagName }) {
7
+ const Tag = tagName ?? 'div';
8
+ return index.h(Tag, { role: 'button', onPointerDown: onPointerDown, part: "clue", class: {
8
9
  "--current": isCurrent
9
10
  } }, word.clue, showPreview && index.h("span", { class: "preview" }, preview));
10
11
  }
@@ -22,15 +23,51 @@ function Cell({ data, isInCurrentClue, isSelected, isSpecial, onPointerDown }) {
22
23
  } }, index.h("div", { class: "_inner", style: { position: 'absolute', width: '100%' } }, data.value));
23
24
  }
24
25
 
25
- const mbCrosswordCss = () => `*[part=main]{position:relative;display:grid;grid-template-areas:"board" "clues";grid-template-columns:1fr}@media (min-width: 768px){*[part=main]{grid-template-areas:"clues board" "clues .";grid-template-columns:1fr 1fr}}*[part=main].--focused{background:lightgrey}*[part=main] input.dummy{pointer-events:none;opacity:0.2;z-index:100;grid-area:board;border:none;outline:none}[part=clues]{grid-area:clues;display:grid;grid-template-columns:1fr 1fr;gap:16px}[part=clues].oneList{grid-template-columns:1fr}[part=clue].--current{background:var(--clue-current-background, lightcyan);position:sticky;bottom:0;left:0;right:0}[part=clue] .preview{font-weight:bold;letter-spacing:0.2em;text-align:center;display:block;text-transform:uppercase}[part=board]{grid-area:board;display:block;position:relative;container-type:size;background:var(--board-background, darkgoldenrod);--cell-border-width:2px;--cell-width-temp:calc((100cqw - var(--cell-border-width)) / var(--board-width, 10));--cell-width:var(--cell-width-temp);--cell-width:round(var(--cell-width-temp), 1px)}[part=cell]{display:block;color:var(--cell-color, #11138d);width:calc(var(--cell-width) - var(--cell-border-width));aspect-ratio:1;background:var(--cell-background, #d9d9d9);position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));border:var(--cell-border-width) solid var(--cell-border-color, red)}[part=cell].--alt{background:var(--cell-background-alt, #999)}[part=cell].--in-current-clue{box-shadow:inset 0 0 2px 2px var(--cell-selected-background, lightblue)}[part=cell].--selected{background:var(--cell-selected-background, lightblue)}[part=cell].--special{background:var(--cell-special-background, lightgreen)}[part=cell] ._inner{position:absolute;top:0;left:0;right:0;bottom:0;display:grid;place-content:center;text-transform:uppercase;font-size:80cqh}[part=preview]{display:none}[part=special-border]{display:block;background:black;position:absolute;z-index:100;--s-border:max(2px, var(--cell-border-width))}[part=special-border].left,[part=special-border].right{width:var(--s-border);height:calc(var(--cell-width) - var(--cell-border-width));top:calc(var(--y, 0) * var(--cell-width) + var(--cell-border-width))}[part=special-border].left{left:calc(var(--x, 0) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].right{left:calc((var(--x, 0) + 1) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].top,[part=special-border].bottom{width:calc(var(--cell-width) - var(--cell-border-width));height:var(--s-border);left:calc(var(--x, 0) * var(--cell-width) + var(--cell-border-width))}[part=special-border].top{top:calc(var(--y, 0) * var(--cell-width))}[part=special-border].bottom{top:calc((var(--y, 0) + 1) * var(--cell-width))}[part=label]{display:grid;position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));width:calc(var(--cell-width) - var(--cell-border-width));aspect-ratio:1;border:var(--cell-border-width) solid transparent;--label-place-content:center end}[part=label] ._inner{position:absolute;top:var(--label-padding, 10cqh);left:var(--label-padding, 10cqh);right:var(--label-padding, 10cqh);bottom:var(--label-padding, 10cqh);display:grid;place-content:var(--label-place-content, center);text-transform:uppercase;font-size:var(--label-font-size, 60cqh)}`;
26
+ const ClueList = ({ type }, children) => {
27
+ if (type === 'p') {
28
+ return index.h("p", { part: "clue-list" }, children.map((child, index$1) => {
29
+ return index.h("p", { key: index$1 }, child);
30
+ }));
31
+ }
32
+ if (type === 'ol') {
33
+ return index.h("ol", { part: "clue-list" }, children);
34
+ }
35
+ };
36
+
37
+ function getDefaultExportFromCjs (x) {
38
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
39
+ }
40
+
41
+ var es5$1 = {exports: {}};
42
+
43
+ var es5 = es5$1.exports;
44
+
45
+ var hasRequiredEs5;
46
+
47
+ function requireEs5 () {
48
+ if (hasRequiredEs5) return es5$1.exports;
49
+ hasRequiredEs5 = 1;
50
+ (function (module, exports) {
51
+ !function(e,t){module.exports=t();}(es5,(function(){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:false,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=true,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:true,get:i});},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:true});},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:true,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){t.__esModule=true,t.default=void 0;var i=r(18),n=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case "NT":return "NT";case "XP":return "XP";case "NT 5.0":return "2000";case "NT 5.1":return "XP";case "NT 5.2":return "2003";case "NT 6.0":return "Vista";case "NT 6.1":return "7";case "NT 6.2":return "8";case "NT 6.3":return "8.1";case "NT 10.0":return "10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));t.push(0);var r=t[0],i=t[1];if(10===r)switch(i){case 5:return "Leopard";case 6:return "Snow Leopard";case 7:return "Lion";case 8:return "Mountain Lion";case 9:return "Mavericks";case 10:return "Yosemite";case 11:return "El Capitan";case 12:return "Sierra";case 13:return "High Sierra";case 14:return "Mojave";case 15:return "Catalina";default:return}switch(r){case 11:return "Big Sur";case 12:return "Monterey";case 13:return "Ventura";case 14:return "Sonoma";case 15:return "Sequoia";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,i){ void 0===i&&(i=false);var n=e.getVersionPrecision(t),a=e.getVersionPrecision(r),o=Math.max(n,a),s=0,u=e.map([t,r],(function(t){var r=o-e.getVersionPrecision(t),i=t+new Array(r+1).join(".0");return e.map(i.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(i&&(s=o-Math.min(n,a)),o-=1;o>=s;){if(u[0][o]>u[1][o])return 1;if(u[0][o]===u[1][o]){if(o===s)return 0;o-=1;}else if(u[0][o]<u[1][o])return -1}},e.map=function(e,t){var r,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)i.push(t(e[r]));return i},e.find=function(e,t){var r,i;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,i=e.length;r<i;r+=1){var n=e[r];if(t(n,r))return n}},e.assign=function(e){for(var t,r,i=e,n=arguments.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(a));var s=function(){var e=a[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){i[t]=e[t];}));};for(t=0,r=a.length;t<r;t+=1)s();return e},e.getBrowserAlias=function(e){return i.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return i.BROWSER_MAP[e]||""},e}();t.default=n,e.exports=t.default;},18:function(e,t,r){t.__esModule=true,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0;t.BROWSER_ALIASES_MAP={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"};t.BROWSER_MAP={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"};t.PLATFORMS_MAP={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"};t.OS_MAP={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"};t.ENGINE_MAP={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"};},90:function(e,t,r){t.__esModule=true,t.default=void 0;var i,n=(i=r(91))&&i.__esModule?i:{default:i},a=r(18);function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||false,i.configurable=true,"value"in i&&(i.writable=true),Object.defineProperty(e,i.key,i);}}var s=function(){function e(){}var t,r,i;return e.getParser=function(e,t){if(void 0===t&&(t=false),"string"!=typeof e)throw new Error("UserAgent should be a string");return new n.default(e,t)},e.parse=function(e){return new n.default(e).getResult()},t=e,i=[{key:"BROWSER_MAP",get:function(){return a.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return a.ENGINE_MAP}},{key:"OS_MAP",get:function(){return a.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return a.PLATFORMS_MAP}}],(r=null)&&o(t.prototype,r),i&&o(t,i),e}();t.default=s,e.exports=t.default;},91:function(e,t,r){t.__esModule=true,t.default=void 0;var i=u(r(92)),n=u(r(93)),a=u(r(94)),o=u(r(95)),s=u(r(17));function u(e){return e&&e.__esModule?e:{default:e}}var d=function(){function e(e,t){if(void 0===t&&(t=false),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},true!==t&&this.parse();}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){ void 0===e&&(e=false);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,r={},i=0,n={},a=0;if(Object.keys(e).forEach((function(t){var o=e[t];"string"==typeof o?(n[t]=o,a+=1):"object"==typeof o&&(r[t]=o,i+=1);})),i>0){var o=Object.keys(r),u=s.default.find(o,(function(e){return t.isOS(e)}));if(u){var d=this.satisfies(r[u]);if(void 0!==d)return d}var c=s.default.find(o,(function(e){return t.isPlatform(e)}));if(c){var f=this.satisfies(r[c]);if(void 0!==f)return f}}if(a>0){var l=Object.keys(n),b=s.default.find(l,(function(e){return t.isBrowser(e,true)}));if(void 0!==b)return this.compareVersion(n[b])}},t.isBrowser=function(e,t){ void 0===t&&(t=false);var r=this.getBrowserName().toLowerCase(),i=e.toLowerCase(),n=s.default.getBrowserTypeByAlias(i);return t&&n&&(i=n.toLowerCase()),i===r},t.compareVersion=function(e){var t=[0],r=e,i=false,n=this.getBrowserVersion();if("string"==typeof n)return ">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(i=true,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(i=true,r=e.substr(1)),t.indexOf(s.default.compareVersions(n,r,i))>-1},t.isOS=function(e){return this.getOSName(true)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(true)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(true)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=false),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=d,e.exports=t.default;},92:function(e,t,r){t.__esModule=true,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i};var a=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/gptbot/i],describe:function(e){var t={name:"GPTBot"},r=n.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/chatgpt-user/i],describe:function(e){var t={name:"ChatGPT-User"},r=n.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/oai-searchbot/i],describe:function(e){var t={name:"OAI-SearchBot"},r=n.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(e){var t={name:"ClaudeBot"},r=n.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(e){var t={name:"Omgilibot"},r=n.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/diffbot/i],describe:function(e){var t={name:"Diffbot"},r=n.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/perplexitybot/i],describe:function(e){var t={name:"PerplexityBot"},r=n.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/perplexity-user/i],describe:function(e){var t={name:"Perplexity-User"},r=n.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/youbot/i],describe:function(e){var t={name:"YouBot"},r=n.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/meta-webindexer/i],describe:function(e){var t={name:"Meta-WebIndexer"},r=n.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/meta-externalads/i],describe:function(e){var t={name:"Meta-ExternalAds"},r=n.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/meta-externalagent/i],describe:function(e){var t={name:"Meta-ExternalAgent"},r=n.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/meta-externalfetcher/i],describe:function(e){var t={name:"Meta-ExternalFetcher"},r=n.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=n.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/amazonbot/i],describe:function(e){var t={name:"AmazonBot"},r=n.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/bingbot/i],describe:function(e){var t={name:"BingCrawler"},r=n.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/baiduspider/i],describe:function(e){var t={name:"BaiduSpider"},r=n.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/duckduckbot/i],describe:function(e){var t={name:"DuckDuckBot"},r=n.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/ia_archiver/i],describe:function(e){var t={name:"InternetArchiveCrawler"},r=n.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return {name:"FacebookExternalHit"}}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return {name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return {name:"YandexBot"}}},{test:[/pingdom/i],describe:function(){return {name:"PingdomBot"}}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=n.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/PaleMoon/i],describe:function(e){var t={name:"Pale Moon"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=n.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=n.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=n.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=n.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=n.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=n.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=n.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=n.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=n.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=n.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=n.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=n.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=n.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=n.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=n.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=n.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=n.default.getFirstMatch(a,e)||n.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=n.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=n.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=n.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/librewolf/i],describe:function(e){var t={name:"LibreWolf"},r=n.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=n.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=n.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(e){var t={name:"Sogou Browser"},r=n.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),i=n.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),a=n.default.getFirstMatch(/se ([\d.]+)x/i,e),o=r||i||a;return o&&(t.version=o),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=n.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=n.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=n.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=n.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=n.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return {name:n.default.getFirstMatch(t,e),version:n.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default;},93:function(e,t,r){t.__esModule=true,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},a=r(18);var o=[{test:[/Roku\/DVP/],describe:function(e){var t=n.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return {name:a.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=n.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return {name:a.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=n.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=n.default.getWindowsVersionName(t);return {name:a.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:a.OS_MAP.iOS},r=n.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=n.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=n.default.getMacOSVersionName(t),i={name:a.OS_MAP.MacOS,version:t};return r&&(i.versionName=r),i}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=n.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return {name:a.OS_MAP.iOS,version:t}}},{test:[/OpenHarmony/i],describe:function(e){var t=n.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return {name:a.OS_MAP.HarmonyOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=n.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=n.default.getAndroidVersionName(t),i={name:a.OS_MAP.Android,version:t};return r&&(i.versionName=r),i}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=n.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:a.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=n.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||n.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||n.default.getFirstMatch(/\bbb(\d+)/i,e);return {name:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=n.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return {name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=n.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return {name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return {name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return {name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=n.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return {name:a.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default;},94:function(e,t,r){t.__esModule=true,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},a=r(18);var o=[{test:[/googlebot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/amazonbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/yahoo/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe:function(){return {type:a.PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe:function(e){var t=n.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:a.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return {type:a.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return {type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return {type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return {type:a.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return {type:a.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return {type:a.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=n.default.getFirstMatch(/(ipod|iphone)/i,e);return {type:a.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return {type:a.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(e){var t=n.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),r={type:a.PLATFORMS_MAP.mobile,vendor:"Nokia"};return t&&(r.model=t),r}},{test:[/[^-]mobi/i],describe:function(){return {type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return "blackberry"===e.getBrowserName(true)},describe:function(){return {type:a.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return "bada"===e.getBrowserName(true)},describe:function(){return {type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return "windows phone"===e.getBrowserName()},describe:function(){return {type:a.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return "android"===e.getOSName(true)&&t>=3},describe:function(){return {type:a.PLATFORMS_MAP.tablet}}},{test:function(e){return "android"===e.getOSName(true)},describe:function(){return {type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return "macos"===e.getOSName(true)},describe:function(){return {type:a.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return "windows"===e.getOSName(true)},describe:function(){return {type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return "linux"===e.getOSName(true)},describe:function(){return {type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return "playstation 4"===e.getOSName(true)},describe:function(){return {type:a.PLATFORMS_MAP.tv}}},{test:function(e){return "roku"===e.getOSName(true)},describe:function(){return {type:a.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default;},95:function(e,t,r){t.__esModule=true,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},a=r(18);var o=[{test:function(e){return "microsoft edge"===e.getBrowserName(true)},describe:function(e){if(/\sedg\//i.test(e))return {name:a.ENGINE_MAP.Blink};var t=n.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return {name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.ENGINE_MAP.Trident},r=n.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:a.ENGINE_MAP.Presto},r=n.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:a.ENGINE_MAP.Gecko},r=n.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return {name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},r=n.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=o,e.exports=t.default;}})}));
52
+ } (es5$1));
53
+ return es5$1.exports;
54
+ }
55
+
56
+ var es5Exports = requireEs5();
57
+ var Bowser = /*@__PURE__*/getDefaultExportFromCjs(es5Exports);
58
+
59
+ const mbCrosswordCss = () => `*[part=main]{position:relative;display:grid;grid-template-areas:"board" "clues";grid-template-columns:1fr}@media (min-width: 768px){*[part=main]{grid-template-areas:"clues board" "clues .";grid-template-columns:1fr 1fr}*[part=main].--only-board{grid-template-columns:1fr;grid-template-areas:"board"}}*[part=main].--focused{background:lightgrey}*[part=main] input.dummy{pointer-events:none;opacity:0;grid-area:board;border:none;outline:none}[part=clues]{grid-area:clues;display:grid;grid-template-columns:1fr 1fr;gap:16px}[part=clues].oneList{grid-template-columns:1fr}[part=clue-list]{margin:0;padding:0}[part=clue].--current{background:var(--clue-current-background, lightcyan)}[part=clue] .preview{font-weight:bold;letter-spacing:0.2em;text-align:center;display:block;text-transform:uppercase}li[part=clue]{--_clue-padding:var(--clue-padding, .5em);border-radius:var(--clue-radius, 0.5em);padding:var(--_clue-padding);list-style-position:inside;padding-left:calc(1em + var(--_clue-padding));text-indent:-1em;margin:0}[part=board]{grid-area:board;display:block;position:relative;container-type:size;background:var(--board-background, darkgoldenrod);--_cell-border-width:var(--cell-border-width, 2px);--cell-width-temp:calc((100cqw - var(--_cell-border-width)) / var(--board-width, 10));--cell-width:var(--cell-width-temp);--cell-width:round(var(--cell-width-temp), 1px)}[part=cell]{display:block;color:var(--cell-color, #11138d);width:calc(var(--cell-width) - var(--_cell-border-width));aspect-ratio:1;background:var(--cell-background, #d9d9d9);position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));border:var(--_cell-border-width) solid var(--cell-border-color, red)}[part=cell].--alt{background:var(--cell-background-alt, #999)}[part=cell].--in-current-clue{box-shadow:inset 0 0 2px 2px var(--cell-selected-background, lightblue)}[part=cell].--selected{background:var(--cell-selected-background, lightblue)}[part=cell].--special{background:var(--cell-special-background, lightgreen)}[part=cell].--special.--selected:before{content:"";background:var(--cell-selected-background, lightblue);position:absolute;top:0;left:0;right:0;bottom:0;clip-path:polygon(100% 0, 100% 100%, 50% 100%)}[part=cell] ._inner{position:absolute;top:0;left:0;right:0;bottom:0;display:grid;place-content:center;text-transform:uppercase;font-size:80cqh}[part=preview]{display:none}[part=special-border]{display:block;background:black;position:absolute;z-index:100;--s-border:max(2px, var(--_cell-border-width))}[part=special-border].left,[part=special-border].right{width:var(--s-border);height:calc(var(--cell-width) - var(--_cell-border-width));top:calc(var(--y, 0) * var(--cell-width) + var(--_cell-border-width))}[part=special-border].left{left:calc(var(--x, 0) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].right{left:calc((var(--x, 0) + 1) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].top,[part=special-border].bottom{width:calc(var(--cell-width) - var(--_cell-border-width));height:var(--s-border);left:calc(var(--x, 0) * var(--cell-width) + var(--_cell-border-width))}[part=special-border].top{top:calc(var(--y, 0) * var(--cell-width))}[part=special-border].bottom{top:calc((var(--y, 0) + 1) * var(--cell-width))}[part=label]{display:grid;position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));width:calc(var(--cell-width) - var(--_cell-border-width));aspect-ratio:1;border:var(--_cell-border-width) solid transparent;--label-place-content:center end}[part=label] ._inner{position:absolute;top:var(--label-padding, 10cqh);left:var(--label-padding, 10cqh);right:var(--label-padding, 10cqh);bottom:var(--label-padding, 10cqh);display:grid;place-content:var(--label-place-content, center);text-transform:uppercase;font-size:var(--label-font-size, 60cqh)}[part=floating-clue]{position:fixed;color:white;left:0;right:0;bottom:0;--_background:var(--floating-clue-background, blue)}[part=floating-clue] .floating-clue__text{padding:8px;background:var(--_background)}[part=floating-clue] .floating-clue__preview{display:inline-block;padding:8px;background:var(--_background);font-weight:bold;letter-spacing:0.2em;text-transform:uppercase;border-radius:0 16px 0 0}[part=floating-clue] .floating-clue__preview span{display:inline-block;width:1em;text-align:center}.--sticky-bottom-hack [part=floating-clue]{top:var(--height);top:calc(var(--height) + var(--offsetTop));bottom:unset;transform:translate(0, -100%)}@media (orientation: landscape){.--sticky-bottom-hack [part=floating-clue]{top:calc(var(--height) + var(--offsetTop))}}`;
26
60
 
27
61
  const MBCrossword = class {
28
62
  constructor(hostRef) {
29
63
  index.registerInstance(this, hostRef);
64
+ this.clueSelected = index.createEvent(this, "clueSelected");
30
65
  }
31
66
  init = true;
32
67
  data;
33
68
  showCluePreview = true;
69
+ clueListStyle = 'ol';
70
+ clueSelected;
34
71
  textInput;
35
72
  hWords = [];
36
73
  vWords = [];
@@ -38,11 +75,20 @@ const MBCrossword = class {
38
75
  currentClue = null;
39
76
  isFocused = false;
40
77
  selectedCell = null;
78
+ bowserParser = Bowser.getParser(typeof window !== 'undefined' ? window.navigator.userAgent : 'unknown');
79
+ abortController = new AbortController();
41
80
  componentWillLoad() {
42
- console.log('componentWillLoad', this.init, this.data);
43
81
  if (this.init && this.data) {
44
82
  this.initGame();
45
83
  }
84
+ if (this.useStickyBottomHack && typeof window !== 'undefined') {
85
+ window.visualViewport.addEventListener('resize', this.updateFloatingPreview.bind(this), { signal: this.abortController.signal });
86
+ window.visualViewport.addEventListener('scroll', this.updateFloatingPreview.bind(this), { signal: this.abortController.signal });
87
+ this.updateFloatingPreview();
88
+ }
89
+ }
90
+ disconnectedCallback() {
91
+ this.abortController.abort();
46
92
  }
47
93
  watchData() {
48
94
  if (this.init && this.data) {
@@ -56,7 +102,6 @@ const MBCrossword = class {
56
102
  ];
57
103
  }
58
104
  async initGame(data = this.data) {
59
- console.log('initGame');
60
105
  if (!data.words) {
61
106
  throw new Error('Words definition missing');
62
107
  }
@@ -81,10 +126,6 @@ const MBCrossword = class {
81
126
  }
82
127
  async checkAnswer() {
83
128
  const cells = this.cells.filter(c => !c.isBlocked);
84
- console.log(cells);
85
- cells.forEach(c => {
86
- console.log(`${c.value} === ${c.answer}`, `${c.x},${c.y}`, c.value === c.answer);
87
- });
88
129
  return cells.every(c => c.value === c.answer);
89
130
  }
90
131
  specialBorders = [];
@@ -93,6 +134,18 @@ const MBCrossword = class {
93
134
  boardWidth = 0;
94
135
  boardHeight = 0;
95
136
  cells = [];
137
+ useStickyBottomHack = this.bowserParser.isOS('ios');
138
+ floatingPreviewHackParams = {
139
+ height: 0,
140
+ offsetTop: 0
141
+ };
142
+ updateFloatingPreview(_event) {
143
+ this.floatingPreviewHackParams = {
144
+ ...this.floatingPreviewHackParams,
145
+ height: window.visualViewport.height,
146
+ offsetTop: window.visualViewport.offsetTop
147
+ };
148
+ }
96
149
  buildBoard() {
97
150
  let boardWidth = 0;
98
151
  let boardHeight = 0;
@@ -255,15 +308,15 @@ const MBCrossword = class {
255
308
  }
256
309
  onFocusin() {
257
310
  this.isFocused = true;
258
- if (!this.currentClueId) {
259
- this.currentClueId = this.allWords[0]?.id ?? null;
260
- }
261
- this.textInput.focus();
311
+ // if (!this.currentClueId) {
312
+ // this.currentClueId = this.allWords[0]?.id ?? null;
313
+ // }
314
+ // this.textInput.focus();
262
315
  }
263
316
  onFocusOut() {
264
317
  this.isFocused = false;
265
318
  }
266
- selectClue(id, { row, col } = {}) {
319
+ async selectClue(id, { row, col } = {}) {
267
320
  if (!id)
268
321
  return;
269
322
  this.currentClueId = id;
@@ -386,18 +439,26 @@ const MBCrossword = class {
386
439
  render() {
387
440
  const hasVWords = Boolean(this.vWords.length);
388
441
  const hasHWords = Boolean(this.hWords.length);
442
+ const hideList = this.clueListStyle === 'none';
389
443
  const twoLists = hasHWords && hasVWords;
390
- return index.h("div", { key: '87d88806305c6102eeb76c3984d4b9c2ad2d9759', part: "main", class: {
391
- "--focused": this.isFocused
392
- }, onFocusin: this.onFocusin.bind(this), onFocusout: this.onFocusOut.bind(this) }, index.h("input", { key: '49cdb053a4d2c4ad2c7eb881488b18c68e31fe65', type: "text", class: "dummy", ref: (el) => this.textInput = el, onKeyDown: this.onKeyPress.bind(this), onInput: this.onInput.bind(this) }), index.h("div", { key: '0ca71a907f70e17a6d2d10bff9462bd0b2284007', part: "clues", class: {
393
- twoLists, oneList: !twoLists
394
- } }, hasHWords ? index.h("div", { part: "clue-list" }, this.hWords.map(w => {
444
+ const showFloatingClue = this.isFocused && this.currentClue && this.bowserParser.isPlatform('mobile');
445
+ return index.h("div", { key: 'b18bbd3453ad8c96cf6b5f04903380b0357d5842', part: "main", class: {
446
+ "--focused": this.isFocused,
447
+ "--only-board": hideList,
448
+ "--sticky-bottom-hack": this.useStickyBottomHack
449
+ }, onFocusin: this.onFocusin.bind(this), onFocusout: this.onFocusOut.bind(this), onClick: () => {
450
+ this.textInput.blur();
451
+ this.textInput.focus();
452
+ } }, index.h("input", { key: '59e427026f09803d1077d1c36f95284fe8d1b8ae', type: "text", class: "dummy", ref: (el) => this.textInput = el, onKeyDown: this.onKeyPress.bind(this), onInput: this.onInput.bind(this) }), hideList ? '' : index.h("div", { part: "clues", class: {
453
+ twoLists,
454
+ oneList: !twoLists
455
+ } }, hasHWords ? index.h(ClueList, { type: this.clueListStyle }, this.hWords.map(w => {
395
456
  const isCurrent = w.id === this.currentClueId;
396
- return index.h(Clue, { showPreview: this.showCluePreview, preview: this.getCluePreview(w), word: w, isCurrent: isCurrent, onPointerDown: () => this.selectClue(w.id) });
397
- })) : '', hasVWords ? index.h("div", { part: "clue-list" }, this.vWords.map(w => {
457
+ return index.h(Clue, { showPreview: this.showCluePreview, preview: this.getCluePreview(w), word: w, isCurrent: isCurrent, onPointerDown: () => this.selectClue(w.id), tagName: this.clueListStyle === 'ol' ? 'li' : undefined });
458
+ })) : '', hasVWords ? index.h(ClueList, { type: this.clueListStyle }, this.vWords.map(w => {
398
459
  const isCurrent = w.id === this.currentClueId;
399
- return index.h(Clue, { showPreview: this.showCluePreview, preview: this.getCluePreview(w), word: w, isCurrent: isCurrent, onPointerDown: () => this.selectClue(w.id) });
400
- })) : ''), index.h("div", { key: 'ea16dca25fe7884d25f9748f98740ad83e25293e', part: "board", style: {
460
+ return index.h(Clue, { showPreview: this.showCluePreview, preview: this.getCluePreview(w), word: w, isCurrent: isCurrent, onPointerDown: () => this.selectClue(w.id), tagName: this.clueListStyle === 'ol' ? 'li' : undefined });
461
+ })) : ''), index.h("div", { key: 'a4803d792f38119e3ba78584acdbb0db677b4869', part: "board", style: {
401
462
  '--board-width': `${this.boardWidth}`,
402
463
  'grid-template-columns': `repeat(${this.boardWidth}, 1fr)`,
403
464
  aspectRatio: `${this.boardWidth / this.boardHeight}`
@@ -421,7 +482,12 @@ const MBCrossword = class {
421
482
  "--x": `${label.x}`,
422
483
  "--y": `${label.y}`
423
484
  }, onPointerDown: () => this.selectClue(label.clueId) }, index.h("div", { class: "_inner" }, label.text));
424
- })), index.h("div", { key: 'd391413e7be3dee148f2f5e6d8fbf22742278a0c', part: "preview" }, "Tu bedzie podgl\u0105d: ", this.currentClueId));
485
+ })), showFloatingClue ? index.h("div", { part: "floating-clue", style: {
486
+ "--height": `${this.floatingPreviewHackParams.height}px`,
487
+ "--offsetTop": `${this.floatingPreviewHackParams.offsetTop}px`
488
+ } }, index.h("div", { class: "floating-clue__preview" }, Array.from(this.getCluePreview(this.currentClue)).map((c, index$1) => {
489
+ return index.h("span", { key: index$1 }, c);
490
+ })), index.h("div", { class: "floating-clue__text" }, this.currentClue?.clue ?? '')) : '');
425
491
  }
426
492
  static get delegatesFocus() { return true; }
427
493
  static get watchers() { return {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BlTGwvVC.js');
3
+ var index = require('./index-rgQMtYdn.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["mb-crossword.cjs",[[529,"mb-crossword",{"init":[4],"data":[16],"showCluePreview":[4,"show-clue-preview"],"hWords":[32],"vWords":[32],"currentClueId":[32],"currentClue":[32],"isFocused":[32],"selectedCell":[32],"specialBorders":[32],"specialCells":[32],"labels":[32],"boardWidth":[32],"boardHeight":[32],"cells":[32],"initGame":[64],"checkAnswer":[64]},null,{"data":[{"watchData":0}]}]]]], options);
22
+ return index.bootstrapLazy([["mb-crossword.cjs",[[529,"mb-crossword",{"init":[4],"data":[16],"showCluePreview":[4,"show-clue-preview"],"clueListStyle":[1,"clue-list-style"],"hWords":[32],"vWords":[32],"currentClueId":[32],"currentClue":[32],"isFocused":[32],"selectedCell":[32],"specialBorders":[32],"specialCells":[32],"labels":[32],"boardWidth":[32],"boardHeight":[32],"cells":[32],"floatingPreviewHackParams":[32],"initGame":[64],"checkAnswer":[64],"selectClue":[64]},null,{"data":[{"watchData":0}]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -0,0 +1,11 @@
1
+ import { h } from "@stencil/core";
2
+ export const ClueList = ({ type }, children) => {
3
+ if (type === 'p') {
4
+ return h("p", { part: "clue-list" }, children.map((child, index) => {
5
+ return h("p", { key: index }, child);
6
+ }));
7
+ }
8
+ if (type === 'ol') {
9
+ return h("ol", { part: "clue-list" }, children);
10
+ }
11
+ };
@@ -1,6 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
- export function Clue({ isCurrent, word, onPointerDown, preview, showPreview }) {
3
- return h("p", { onPointerDown: onPointerDown, part: "clue", class: {
2
+ export function Clue({ isCurrent, word, onPointerDown, preview, showPreview, tagName }) {
3
+ const Tag = tagName ?? 'div';
4
+ return h(Tag, { role: 'button', onPointerDown: onPointerDown, part: "clue", class: {
4
5
  "--current": isCurrent
5
6
  } }, word.clue, showPreview && h("span", { class: "preview" }, preview));
6
7
  }
@@ -9,14 +9,17 @@
9
9
  grid-template-areas: "clues board" "clues .";
10
10
  grid-template-columns: 1fr 1fr;
11
11
  }
12
+ *[part=main].--only-board {
13
+ grid-template-columns: 1fr;
14
+ grid-template-areas: "board";
15
+ }
12
16
  }
13
17
  *[part=main].--focused {
14
18
  background: lightgrey;
15
19
  }
16
20
  *[part=main] input.dummy {
17
21
  pointer-events: none;
18
- opacity: 0.2;
19
- z-index: 100;
22
+ opacity: 0;
20
23
  grid-area: board;
21
24
  border: none;
22
25
  outline: none;
@@ -32,12 +35,13 @@
32
35
  grid-template-columns: 1fr;
33
36
  }
34
37
 
38
+ [part=clue-list] {
39
+ margin: 0;
40
+ padding: 0;
41
+ }
42
+
35
43
  [part=clue].--current {
36
44
  background: var(--clue-current-background, lightcyan);
37
- position: sticky;
38
- bottom: 0;
39
- left: 0;
40
- right: 0;
41
45
  }
42
46
  [part=clue] .preview {
43
47
  font-weight: bold;
@@ -47,14 +51,24 @@
47
51
  text-transform: uppercase;
48
52
  }
49
53
 
54
+ li[part=clue] {
55
+ --_clue-padding: var(--clue-padding, .5em);
56
+ border-radius: var(--clue-radius, 0.5em);
57
+ padding: var(--_clue-padding);
58
+ list-style-position: inside;
59
+ padding-left: calc(1em + var(--_clue-padding));
60
+ text-indent: -1em;
61
+ margin: 0;
62
+ }
63
+
50
64
  [part=board] {
51
65
  grid-area: board;
52
66
  display: block;
53
67
  position: relative;
54
68
  container-type: size;
55
69
  background: var(--board-background, darkgoldenrod);
56
- --cell-border-width: 2px;
57
- --cell-width-temp: calc((100cqw - var(--cell-border-width)) / var(--board-width, 10));
70
+ --_cell-border-width: var(--cell-border-width, 2px);
71
+ --cell-width-temp: calc((100cqw - var(--_cell-border-width)) / var(--board-width, 10));
58
72
  --cell-width: var(--cell-width-temp);
59
73
  --cell-width: round(var(--cell-width-temp), 1px);
60
74
  }
@@ -62,14 +76,14 @@
62
76
  [part=cell] {
63
77
  display: block;
64
78
  color: var(--cell-color, #11138d);
65
- width: calc(var(--cell-width) - var(--cell-border-width));
79
+ width: calc(var(--cell-width) - var(--_cell-border-width));
66
80
  aspect-ratio: 1;
67
81
  background: var(--cell-background, #d9d9d9);
68
82
  position: absolute;
69
83
  container-type: size;
70
84
  top: calc(var(--y, 0) * var(--cell-width));
71
85
  left: calc(var(--x, 0) * var(--cell-width));
72
- border: var(--cell-border-width) solid var(--cell-border-color, red);
86
+ border: var(--_cell-border-width) solid var(--cell-border-color, red);
73
87
  }
74
88
  [part=cell].--alt {
75
89
  background: var(--cell-background-alt, #999);
@@ -83,6 +97,16 @@
83
97
  [part=cell].--special {
84
98
  background: var(--cell-special-background, lightgreen);
85
99
  }
100
+ [part=cell].--special.--selected:before {
101
+ content: "";
102
+ background: var(--cell-selected-background, lightblue);
103
+ position: absolute;
104
+ top: 0;
105
+ left: 0;
106
+ right: 0;
107
+ bottom: 0;
108
+ clip-path: polygon(100% 0, 100% 100%, 50% 100%);
109
+ }
86
110
  [part=cell] ._inner {
87
111
  position: absolute;
88
112
  top: 0;
@@ -104,12 +128,12 @@
104
128
  background: black;
105
129
  position: absolute;
106
130
  z-index: 100;
107
- --s-border: max(2px, var(--cell-border-width));
131
+ --s-border: max(2px, var(--_cell-border-width));
108
132
  }
109
133
  [part=special-border].left, [part=special-border].right {
110
134
  width: var(--s-border);
111
- height: calc(var(--cell-width) - var(--cell-border-width));
112
- top: calc(var(--y, 0) * var(--cell-width) + var(--cell-border-width));
135
+ height: calc(var(--cell-width) - var(--_cell-border-width));
136
+ top: calc(var(--y, 0) * var(--cell-width) + var(--_cell-border-width));
113
137
  }
114
138
  [part=special-border].left {
115
139
  left: calc(var(--x, 0) * var(--cell-width) - var(--s-border) / 2);
@@ -118,9 +142,9 @@
118
142
  left: calc((var(--x, 0) + 1) * var(--cell-width) - var(--s-border) / 2);
119
143
  }
120
144
  [part=special-border].top, [part=special-border].bottom {
121
- width: calc(var(--cell-width) - var(--cell-border-width));
145
+ width: calc(var(--cell-width) - var(--_cell-border-width));
122
146
  height: var(--s-border);
123
- left: calc(var(--x, 0) * var(--cell-width) + var(--cell-border-width));
147
+ left: calc(var(--x, 0) * var(--cell-width) + var(--_cell-border-width));
124
148
  }
125
149
  [part=special-border].top {
126
150
  top: calc(var(--y, 0) * var(--cell-width));
@@ -135,9 +159,9 @@
135
159
  container-type: size;
136
160
  top: calc(var(--y, 0) * var(--cell-width));
137
161
  left: calc(var(--x, 0) * var(--cell-width));
138
- width: calc(var(--cell-width) - var(--cell-border-width));
162
+ width: calc(var(--cell-width) - var(--_cell-border-width));
139
163
  aspect-ratio: 1;
140
- border: var(--cell-border-width) solid transparent;
164
+ border: var(--_cell-border-width) solid transparent;
141
165
  --label-place-content: center end;
142
166
  }
143
167
  [part=label] ._inner {
@@ -150,4 +174,43 @@
150
174
  place-content: var(--label-place-content, center);
151
175
  text-transform: uppercase;
152
176
  font-size: var(--label-font-size, 60cqh);
177
+ }
178
+
179
+ [part=floating-clue] {
180
+ position: fixed;
181
+ color: white;
182
+ left: 0;
183
+ right: 0;
184
+ bottom: 0;
185
+ --_background: var(--floating-clue-background, blue);
186
+ }
187
+ [part=floating-clue] .floating-clue__text {
188
+ padding: 8px;
189
+ background: var(--_background);
190
+ }
191
+ [part=floating-clue] .floating-clue__preview {
192
+ display: inline-block;
193
+ padding: 8px;
194
+ background: var(--_background);
195
+ font-weight: bold;
196
+ letter-spacing: 0.2em;
197
+ text-transform: uppercase;
198
+ border-radius: 0 16px 0 0;
199
+ }
200
+ [part=floating-clue] .floating-clue__preview span {
201
+ display: inline-block;
202
+ width: 1em;
203
+ text-align: center;
204
+ }
205
+
206
+ .--sticky-bottom-hack [part=floating-clue] {
207
+ top: var(--height);
208
+ top: calc(var(--height) + var(--offsetTop));
209
+ bottom: unset;
210
+ transform: translate(0, -100%);
211
+ }
212
+ @media (orientation: landscape) {
213
+ .--sticky-bottom-hack [part=floating-clue] {
214
+ top: calc(var(--height) + var(--offsetTop));
215
+ }
153
216
  }