proto-sudoku-wc 0.1.138 → 0.1.140

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.
@@ -5,7 +5,7 @@ const BUILD = /* proto-sudoku-wc */ { allRenderFn: true, appendChildSlotFix: fal
5
5
  const Env = /* proto-sudoku-wc */ {};
6
6
 
7
7
  /*
8
- Stencil Client Platform v4.41.0 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Platform v4.41.1 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  var __create = Object.create;
11
11
  var __defProp = Object.defineProperty;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CwegWrJ9.js');
3
+ var index = require('./index-DqlRWhrZ.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  const defineCustomElements = async (win, options) => {
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CwegWrJ9.js');
3
+ var index = require('./index-DqlRWhrZ.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
7
  /*
8
- Stencil Client Patch Browser v4.41.0 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.41.1 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
 
11
11
  var patchBrowser = () => {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CwegWrJ9.js');
3
+ var index = require('./index-DqlRWhrZ.js');
4
4
 
5
5
  const Alien = props => {
6
6
  const hex = props.hex || 'currentColor';
@@ -4,7 +4,7 @@
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "4.41.0",
7
+ "version": "4.41.1",
8
8
  "typescriptVersion": "5.8.3"
9
9
  },
10
10
  "collections": [],
@@ -3,7 +3,7 @@ const BUILD = /* proto-sudoku-wc */ { allRenderFn: true, appendChildSlotFix: fal
3
3
  const Env = /* proto-sudoku-wc */ {};
4
4
 
5
5
  /*
6
- Stencil Client Platform v4.41.0 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Platform v4.41.1 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
  var __create = Object.create;
9
9
  var __defProp = Object.defineProperty;
@@ -1,5 +1,5 @@
1
- import { b as bootstrapLazy } from './index-BhoER2hU.js';
2
- export { s as setNonce } from './index-BhoER2hU.js';
1
+ import { b as bootstrapLazy } from './index-CBkAXsXk.js';
2
+ export { s as setNonce } from './index-CBkAXsXk.js';
3
3
  import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
@@ -1,9 +1,9 @@
1
- import { p as promiseResolve, B as BUILD, c as consoleDevInfo, w as win, N as NAMESPACE, H, b as bootstrapLazy } from './index-BhoER2hU.js';
2
- export { s as setNonce } from './index-BhoER2hU.js';
1
+ import { p as promiseResolve, B as BUILD, c as consoleDevInfo, w as win, N as NAMESPACE, H, b as bootstrapLazy } from './index-CBkAXsXk.js';
2
+ export { s as setNonce } from './index-CBkAXsXk.js';
3
3
  import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v4.41.0 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v4.41.1 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
 
9
9
  var patchBrowser = () => {
@@ -1,4 +1,4 @@
1
- import { h, S as StencilCore, r as registerInstance } from './index-BhoER2hU.js';
1
+ import { h, S as StencilCore, r as registerInstance } from './index-CBkAXsXk.js';
2
2
 
3
3
  const Alien = props => {
4
4
  const hex = props.hex || 'currentColor';
@@ -1,2 +1,2 @@
1
- import{h as t,S as e,r}from"./p-BhoER2hU.js";const o=e=>{const r=e.hex||"currentColor",o=e.size||24;return t("svg",{class:e.class,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"alien"),t("g",{fill:r},t("path",{d:"M10.31 10.93C11.33 12.57 11.18 14.5 9.96 15.28C8.74 16.04 6.92 15.33\n 5.89 13.69C4.87 12.05 5.03 10.1 6.25 9.34C7.47 8.58 9.29 9.29 10.31\n 10.93M12 17.75C14 17.75 14.5 17 14.5 17C14.5 17 14 19 12 19C10 19 9.5\n 17.03 9.5 17C9.5 17 10 17.75 12 17.75M17.75 9.34C18.97 10.1 19.13 12.05\n 18.11 13.69C17.08 15.33 15.26 16.04 14.04 15.28C12.82 14.5 12.67 12.57\n 13.69 10.93C14.71 9.29 16.53 8.58 17.75 9.34M12 20C14.5 20 20 14.86 20\n 11C20 7.14 16.41 4 12 4C7.59 4 4 7.14 4 11C4 14.86 9.5 20 12 20M12 2C17.5\n 2 22 6.04 22 11C22 15.08 16.32 22 12 22C7.68 22 2 15.08 2 11C2 6.04 6.5 2\n 12 2Z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},n="proto-sudoku",s=`${n}::data`,i=`${n}::inputs`,a=`${n}::pick`,l=t=>{const e=localStorage.getItem(t);return e?JSON.parse(e):void 0},c=(t,e)=>{const r=JSON.stringify(e);localStorage.setItem(t,r)},h=()=>[...l(i)],f=t=>{c(i,t.join(""))},d=()=>{const t=l(a);return null!==t?t:void 0},u=t=>{c(a,t>=0&&t<81?t:null)},p="Check ?",g="New Puzzle",b=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys()){const r=t.get(e).filter((t=>{const e=t.deref();return e&&(!("isConnected"in(r=e))||r.isConnected);var r}));t.set(e,r)}})(...e)}),2e3)}})(),y=e.forceUpdate,w=e.getRenderingRef,m=(t,e)=>{const r=t.indexOf(e);r>=0&&(t[r]=t[t.length-1],t.length--)};class v extends Error{response;request;options;constructor(t,e,r){const o=`${t.status||0===t.status?t.status:""} ${t.statusText??""}`.trim();super(`Request failed with ${o?`status code ${o}`:"an unknown error"}: ${e.method} ${e.url}`),this.name="HTTPError",this.response=t,this.request=e,this.options=r}}class x extends Error{name="NonError";value;constructor(t){let e="Non-error value was thrown";try{"string"==typeof t?e=t:t&&"object"==typeof t&&"message"in t&&"string"==typeof t.message&&(e=t.message)}catch{}super(e),this.value=t}}class C extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(t){const e=t?.cause?t.cause instanceof Error?t.cause:new x(t.cause):void 0;super(t?.code?`Forced retry: ${t.code}`:"Forced retry",e?{cause:e}:void 0),this.customDelay=t?.delay,this.code=t?.code,this.customRequest=t?.request}}const T=(()=>{let t=!1,e=!1;const r="function"==typeof globalThis.ReadableStream,o="function"==typeof globalThis.Request;if(r&&o)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(t){if(t instanceof Error&&"unsupported BodyInit type"===t.message)return!1;throw t}return t&&!e})(),k="function"==typeof globalThis.AbortController,R="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,E="function"==typeof globalThis.ReadableStream,S="function"==typeof globalThis.FormData,j=["get","post","put","patch","head","delete"],M={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},P=2147483647,A=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,O=Symbol("stop");class z{options;constructor(t){this.options=t}}const U=t=>new z(t),N={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},q={next:!0},L={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},B=(t,e,r)=>{let o,n=0;return t.pipeThrough(new TransformStream({transform(t,s){if(s.enqueue(t),o){n+=o.byteLength;let t=0===e?0:n/e;t>=1&&(t=1-Number.EPSILON),r?.({percent:t,totalBytes:Math.max(e,n),transferredBytes:n},o)}o=t},flush(){o&&(n+=o.byteLength,r?.({percent:1,totalBytes:Math.max(e,n),transferredBytes:n},o))}}))},$=t=>null!==t&&"object"==typeof t,D=(...t)=>{for(const e of t)if((!$(e)||Array.isArray(e))&&void 0!==e)throw new TypeError("The `options` argument must be an object");return X({},...t)},H=(t={},e={})=>{const r=new globalThis.Headers(t),o=e instanceof globalThis.Headers,n=new globalThis.Headers(e);for(const[t,e]of n.entries())o&&"undefined"===e||void 0===e?r.delete(t):r.set(t,e);return r};function J(t,e,r){return Object.hasOwn(e,r)&&void 0===e[r]?[]:X(t[r]??[],e[r]??[])}const F=(t={},e={})=>({beforeRequest:J(t,e,"beforeRequest"),beforeRetry:J(t,e,"beforeRetry"),afterResponse:J(t,e,"afterResponse"),beforeError:J(t,e,"beforeError")}),W=(t,e)=>{const r=new URLSearchParams;for(const o of[t,e])if(void 0!==o)if(o instanceof URLSearchParams)for(const[t,e]of o.entries())r.append(t,e);else if(Array.isArray(o))for(const t of o){if(!Array.isArray(t)||2!==t.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(t[0]),String(t[1]))}else if($(o))for(const[t,e]of Object.entries(o))void 0!==e&&r.append(t,String(e));else{const t=new URLSearchParams(o);for(const[e,o]of t.entries())r.append(e,o)}return r},X=(...t)=>{let e,r={},o={},n={};const s=[];for(const i of t)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if($(i)){for(let[t,o]of Object.entries(i))if("signal"===t&&o instanceof globalThis.AbortSignal)s.push(o);else if("context"!==t)"searchParams"!==t?($(o)&&t in r&&(o=X(r[t],o)),r={...r,[t]:o}):e=null==o?void 0:void 0===e?o:W(e,o);else{if(null!=o&&(!$(o)||Array.isArray(o)))throw new TypeError("The `context` option must be an object");r={...r,context:null==o?{}:{...r.context,...o}}}$(i.hooks)&&(n=F(n,i.hooks),r.hooks=n),$(i.headers)&&(o=H(o,i.headers),r.headers=o)}return void 0!==e&&(r.searchParams=e),s.length>0&&(r.signal=1===s.length?s[0]:R?AbortSignal.any(s):s.at(-1)),void 0===r.context&&(r.context={}),r},I=t=>j.includes(t)?t.toUpperCase():t,K={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},Z=(t={})=>{if("number"==typeof t)return{...K,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.methods&&=t.methods.map((t=>t.toLowerCase())),t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");const e=Object.fromEntries(Object.entries(t).filter((([,t])=>void 0!==t)));return{...K,...e}};class G extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}}class V{static create(t,e){const r=new V(t,e),o=r.#t((async()=>{if("number"==typeof r.#e.timeout&&r.#e.timeout>P)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let t=await r.#r();for(const e of r.#e.hooks.afterResponse){const o=r.#o(t.clone());let n;try{n=await e(r.request,r.#n(),o,{retryCount:r.#s})}catch(e){throw r.#i(o),r.#i(t),e}if(n instanceof z)throw r.#i(o),r.#i(t),new C(n.options);const s=n instanceof globalThis.Response?n:t;o!==s&&r.#i(o),t!==s&&r.#i(t),t=s}if(r.#o(t),!t.ok&&("function"==typeof r.#e.throwHttpErrors?r.#e.throwHttpErrors(t.status):r.#e.throwHttpErrors)){let e=new v(t,r.request,r.#n());for(const t of r.#e.hooks.beforeError)e=await t(e,{retryCount:r.#s});throw e}if(r.#e.onDownloadProgress){if("function"!=typeof r.#e.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!E)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const e=t.clone();return r.#i(t),((t,e)=>{if(!t.body)return t;if(204===t.status)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});const r=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response(B(t.body,r,e),{status:t.status,statusText:t.statusText,headers:t.headers})})(e,r.#e.onDownloadProgress)}return t})).finally((()=>{const t=r.#a;r.#l(t?.body??void 0),r.#l(r.request.body??void 0)}));for(const[t,n]of Object.entries(M))"bytes"===t&&"function"!=typeof globalThis.Response?.prototype?.bytes||(o[t]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||n);const s=await o;if("json"===t){if(204===s.status)return"";const t=await s.text();return""===t?"":e.parseJson?e.parseJson(t):JSON.parse(t)}return s[t]()});return o}static#c(t){return!t||"object"!=typeof t||Array.isArray(t)||t instanceof URLSearchParams?t:Object.fromEntries(Object.entries(t).filter((([,t])=>void 0!==t)))}request;#h;#s=0;#f;#e;#a;#d;#u;constructor(t,e={}){if(this.#f=t,this.#e={...e,headers:H(this.#f.headers,e.headers),hooks:F({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},e.hooks),method:I(e.method??this.#f.method??"GET"),prefixUrl:String(e.prefixUrl||""),retry:Z(e.retry),throwHttpErrors:e.throwHttpErrors??!0,timeout:e.timeout??1e4,fetch:e.fetch??globalThis.fetch.bind(globalThis),context:e.context??{}},"string"!=typeof this.#f&&!(this.#f instanceof URL||this.#f instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&"string"==typeof this.#f){if(this.#f.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#f=this.#e.prefixUrl+this.#f}k&&R&&(this.#d=this.#e.signal??this.#f.signal,this.#h=new globalThis.AbortController,this.#e.signal=this.#d?AbortSignal.any([this.#d,this.#h.signal]):this.#h.signal),T&&(this.#e.duplex="half"),void 0!==this.#e.json&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const r=e.headers&&new globalThis.Headers(e.headers).has("content-type");if(this.#f instanceof globalThis.Request&&(S&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#f,this.#e),void 0!==(o=this.#e.searchParams)&&(Array.isArray(o)?o.length>0:o instanceof URLSearchParams?o.size>0:"object"==typeof o?Object.keys(o).length>0:"string"==typeof o?o.trim().length>0:Boolean(o))){const t="string"==typeof this.#e.searchParams?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(V.#c(this.#e.searchParams)).toString(),e=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,"?"+t);this.request=new globalThis.Request(e,this.#e)}var o;if(this.#e.onUploadProgress){if("function"!=typeof this.#e.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!T)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#p(this.request,this.#e.body??void 0)}}#g(){const t=this.#e.retry.delay(this.#s);let e=t;!0===this.#e.retry.jitter?e=Math.random()*t:"function"==typeof this.#e.retry.jitter&&(e=this.#e.retry.jitter(t),(!Number.isFinite(e)||e<0)&&(e=t));const r=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,e)}async#b(t){if(this.#s++,this.#s>this.#e.retry.limit)throw t;const e=t instanceof Error?t:new x(t);if(e instanceof C)return e.customDelay??this.#g();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw t;if(void 0!==this.#e.retry.shouldRetry){const r=await this.#e.retry.shouldRetry({error:e,retryCount:this.#s});if(!1===r)throw t;if(!0===r)return this.#g()}if(function(t){return t instanceof G||t?.name===G.name}(t)&&!this.#e.retry.retryOnTimeout)throw t;if(function(t){return t instanceof v||t?.name===v.name}(t)){if(!this.#e.retry.statusCodes.includes(t.response.status))throw t;const e=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Retry-After")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(e&&this.#e.retry.afterStatusCodes.includes(t.response.status)){let t=1e3*Number(e);Number.isNaN(t)?t=Date.parse(e)-Date.now():t>=Date.parse("2024-01-01")&&(t-=Date.now());const r=this.#e.retry.maxRetryAfter??t;return t<r?t:r}if(413===t.response.status)throw t}return this.#g()}#o(t){return this.#e.parseJson&&(t.json=async()=>this.#e.parseJson(await t.text())),t}#l(t){t&&t.cancel().catch((()=>{}))}#i(t){this.#l(t.body??void 0)}async#t(t){try{return await t()}catch(e){const r=Math.min(await this.#b(e),P);if(this.#s<1)throw e;if(await async function(t,{signal:e}){return new Promise(((r,o)=>{function n(){clearTimeout(s),o(e.reason)}e&&(e.throwIfAborted(),e.addEventListener("abort",n,{once:!0}));const s=setTimeout((()=>{e?.removeEventListener("abort",n),r()}),t)}))}(r,this.#d?{signal:this.#d}:{}),e instanceof C&&e.customRequest){const t=this.#e.signal?new globalThis.Request(e.customRequest,{signal:this.#e.signal}):new globalThis.Request(e.customRequest);this.#y(t)}for(const t of this.#e.hooks.beforeRetry){const r=await t({request:this.request,options:this.#n(),error:e,retryCount:this.#s});if(r instanceof globalThis.Request){this.#y(r);break}if(r instanceof globalThis.Response)return r;if(r===O)return}return this.#t(t)}}async#r(){this.#h?.signal.aborted&&(this.#h=new globalThis.AbortController,this.#e.signal=this.#d?AbortSignal.any([this.#d,this.#h.signal]):this.#h.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(const t of this.#e.hooks.beforeRequest){const e=await t(this.request,this.#n(),{retryCount:this.#s});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#y(e);break}}const t=((t,e)=>{const r={};for(const o in e)Object.hasOwn(e,o)&&(o in L||o in N||o in t&&!(o in q)||(r[o]=e[o]));return r})(this.request,this.#e);return this.#a=this.request,this.request=this.#a.clone(),!1===this.#e.timeout?this.#e.fetch(this.#a,t):async function(t,e,r,o){return new Promise(((n,s)=>{const i=setTimeout((()=>{r&&r.abort(),s(new G(t))}),o.timeout);o.fetch(t,e).then(n).catch(s).then((()=>{clearTimeout(i)}))}))}(this.#a,t,this.#h,this.#e)}#n(){if(!this.#u){const{hooks:t,...e}=this.#e;this.#u=Object.freeze(e)}return this.#u}#y(t){this.#u=void 0,this.request=this.#p(t)}#p(t,e){return this.#e.onUploadProgress&&t.body?((t,e,r)=>{if(!t.body)return t;const o=(t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(const[r,o]of t)e+=A,e+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,e+="string"==typeof o?(new TextEncoder).encode(o).length:o.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if("string"==typeof t)return(new TextEncoder).encode(t).length;if(t instanceof URLSearchParams)return(new TextEncoder).encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if("object"==typeof t&&null!==t)try{const e=JSON.stringify(t);return(new TextEncoder).encode(e).length}catch{return 0}return 0})(r??t.body);return new Request(t,{duplex:"half",body:B(t.body,o,e)})})(t,this.#e.onUploadProgress,e??this.#e.body??void 0):t}}
2
- /*! MIT License © Sindre Sorhus */const Y=t=>{const e=(e,r)=>V.create(e,D(t,r));for(const r of j)e[r]=(e,o)=>V.create(e,D(t,o,{method:r}));return e.create=t=>Y(D(t)),e.extend=e=>("function"==typeof e&&(e=e(t??{})),Y(D(t,e))),e.stop=O,e.retry=U,e},_=Y(),Q={list:[],keys:[],locs:[],loading:!1,solved:!1,error:void 0,pick:void 0,data:void 0},{state:tt}=(()=>{const t=((t,e=(t,e)=>t!==e)=>{const r=()=>{return("function"==typeof(e=t)?e():e)??{};var e},o=r();let n=new Map(Object.entries(o));const s="undefined"!=typeof Proxy,i=s?null:{},a={dispose:[],get:[],set:[],reset:[]},l=new Map,c=()=>{n=new Map(Object.entries(r())),s||g(),a.reset.forEach((t=>t()))},h=t=>(a.get.forEach((e=>e(t))),n.get(t)),f=(t,r)=>{const o=n.get(t);e(r,o,t)&&(n.set(t,r),s||p(t),a.set.forEach((e=>e(t,r,o))))},d=s?new Proxy(o,{get:(t,e)=>h(e),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>n.has(e),set:(t,e,r)=>(f(e,r),!0)}):(g(),i),u=(t,e)=>(a[t].push(e),()=>{m(a[t],e)});function p(t){!s&&i&&(Object.prototype.hasOwnProperty.call(i,t)||Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:()=>h(t),set(e){f(t,e)}}))}function g(){if(s||!i)return;const t=new Set(n.keys());for(const e of Object.keys(i))t.has(e)||delete i[e];for(const e of t)p(e)}return{state:d,get:h,set:f,on:u,onChange:(t,e)=>{const o=(r,o)=>{r===t&&e(o)},n=()=>{const o=r();e(o[t])},s=u("set",o),i=u("reset",n);return l.set(e,{setHandler:o,resetHandler:n,propName:t}),()=>{s(),i(),l.delete(e)}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(u("set",e.set)),e.get&&t.push(u("get",e.get)),e.reset&&t.push(u("reset",e.reset)),e.dispose&&t.push(u("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{a.dispose.forEach((t=>t())),c()},reset:c,forceUpdate:t=>{const e=n.get(t);a.set.forEach((r=>r(t,e,e)))},removeListener:(t,e)=>{const r=l.get(e);r&&r.propName===t&&(m(a.set,r.setHandler),m(a.reset,r.resetHandler),l.delete(e))}}})(Q,void 0);return t.use((()=>{if("function"!=typeof w||"function"!=typeof y)return{};const t=y,e=w,r=new Map;return{dispose:()=>r.clear(),get:t=>{const o=e();o&&((t,e,r)=>{let o=t.get(e);o||(o=[],t.set(e,o)),o.some((t=>t.deref()===r))||o.push(new WeakRef(r))})(r,t,o)},set:e=>{const o=r.get(e);if(o){const n=o.filter((e=>{const r=e.deref();return!!r&&t(r)}));r.set(e,n)}b(r)},reset:()=>{r.forEach((e=>{e.forEach((e=>{const r=e.deref();r&&t(r)}))})),b(r)}}})()),t})(),et=new Map([["row",new Map],["column",new Map],["box",new Map]]),rt=["1","2","3","4","5","6","7","8","9"],ot=t=>{if(void 0!==t&&t.indx!=tt.pick){const{isClue:e,indx:r,row:o,column:n,box:s}=t,i=((t,e,r,o)=>{const n=new Map([["row",e],["column",r],["box",o]]),s=new Set;return n.forEach(((e,r)=>{et.get(r).get(e).forEach((e=>{e!==t&&s.add(e)}))})),Array.from(s)})(r,o,n,s),a=e?[]:(t=>{const{list:e}=tt,r=new Set;return t.map((t=>{const{key:o}=e[t];"."!=o&&r.add(o)})),rt.filter((t=>!r.has(t)))})(i);tt.pick=r,tt.keys=a,tt.locs=i}else tt.pick=void 0,tt.keys=[],tt.locs=[];at(tt.pick)};let nt;const st={local:"http://localhost:8080/api",netlify:"/.netlify/functions",vercel:"https://sudoku-rust-api.vercel.app/api"},it=t=>{f(t)},at=t=>{u(t)},lt=(t=!1)=>{tt.list=[],tt.keys=[],tt.locs=[],tt.loading=t,tt.solved=!1,tt.error=void 0,tt.pick=void 0,tt.data=void 0},ct=(t,e=!0)=>{const{puzzle:r,ref:o}=t;e&&(f([]),c(s,t)),(t=>{if(t){const{puzzle:e,ref:r}=t,o=e?[...e]:[],n=r?atob(r):void 0,s=n?[...n]:[],i=o.map(((t,e)=>{const r=s[e],o=t===r,n=Math.floor(e/9),i=e%9,a=((t,e)=>e<3?t<3?0:t<6?3:6:e<6?t<3?1:t<6?4:7:t<3?2:t<6?5:8)(n,i);return((t,e,r,o)=>{new Map([["row",e],["column",r],["box",o]]).forEach(((e,r)=>{const o=et.get(r);o.has(e)?o.get(e).add(t):o.set(e,new Set([t]))}))})(e,n,i,a),{key:t,isClue:o,value:r,indx:e,row:n,column:i,box:a}}));(t=>{h().forEach(((e,r)=>{const o=t[r],{isClue:n}=o;n||(o.key=e)}))})(i),tt.data=t,tt.list=i}else tt.data=void 0,tt.list=[]})({puzzle:r,ref:o})},ht=t=>{tt.list=[...t],t.length=0},ft={initApp:t=>{(t=>{const e=(t=>{const e=Object.keys(st).includes(t)?t:"vercel";return st[e]})(t);nt=_.extend({hooks:{beforeRequest:[t=>{t.headers.set("X-Requested-With","ky"),t.headers.set("X-Custom-Header","foobar")}]},prefixUrl:e,timeout:1e4})})(t),lt();const e=l(s),r=d();if(e&&(ct(e,!1),r>=0)){const{list:t}=tt;ot(t[r])}},refresh:async()=>{lt(!0),it([]),at(tt.pick);try{const t=await nt.get("puzzle").json();ct(t)}catch(t){const{message:e}=t;console.log("-- ",e),console.log(t),tt.error=e}finally{tt.loading=!1}},select:t=>{ot(t)},check:()=>{const{list:t}=tt,e=[];let r=0,o=0,n=0;t.forEach((t=>{const{key:s,value:i,isClue:a}=t;a?n+=1:"."!==s&&(s!==i?(r+=1,t.key="."):o+=1),e.push(t.key)}));const s=n+o;it(o?e:[]),r>0?ht(t):81===s&&(tt.solved=!0)},input:t=>{const{pick:e,list:r}=tt;r[e].key=t,ht(r)}},dt=(...t)=>t.filter(Boolean).join(" "),ut=e=>{const r=e.hex||"currentColor",o=e.label||"loading...",n=e.size||24;return t("svg",{class:dt(e.class||"","animate-spin"),width:n,height:n,fill:"none",viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,o),t("g",null,t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:r,"stroke-width":"4"}),t("path",{class:"opacity-75",fill:r,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},pt=e=>{const{message:r,salute:n,spinner:s=!1}=e;return t("div",{class:"mt-5 flex h-24px flex-row items-center"},t(s?ut:o,{class:"mr-2"}),n?t("label",{class:"mr-1 font-bold"},n,":"):"",t("label",{class:"italic"},r))},gt=()=>{const{solved:e,loading:r,error:o}=tt;return t("div",{class:"flex flex-col"},r||o||e?"":t(pt,{message:"Welcome, are you ready to play?..."}),r?t(pt,{message:"Loading...",spinner:!0}):"",o?t(pt,{message:o,salute:"ERROR"}):"",e?t(pt,{message:"You solved the puzzle!!"}):"")},bt=e=>{const r=e.hex||"currentColor",o=e.size||24;return t("svg",{class:e.class,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"fingerprint"),t("g",{fill:r},t("path",{d:"M17.81,4.47C17.73,4.47 17.65,4.45 17.58,4.41C15.66,3.42 14,3\n 12,3C10.03,3 8.15,3.47 6.44,4.41C6.2,4.54 5.9,4.45 5.76,4.21C5.63,3.97\n 5.72,3.66 5.96,3.53C7.82,2.5 9.86,2 12,2C14.14,2 16,2.47\n 18.04,3.5C18.29,3.65 18.38,3.95 18.25,4.19C18.16,4.37 18,4.47\n 17.81,4.47M3.5,9.72C3.4,9.72 3.3,9.69 3.21,9.63C3,9.47 2.93,9.16\n 3.09,8.93C4.08,7.53 5.34,6.43 6.84,5.66C10,4.04 14,4.03\n 17.15,5.65C18.65,6.42 19.91,7.5 20.9,8.9C21.06,9.12 21,9.44\n 20.78,9.6C20.55,9.76 20.24,9.71 20.08,9.5C19.18,8.22 18.04,7.23\n 16.69,6.54C13.82,5.07 10.15,5.07 7.29,6.55C5.93,7.25 4.79,8.25\n 3.89,9.5C3.81,9.65 3.66,9.72 3.5,9.72M9.75,21.79C9.62,21.79 9.5,21.74\n 9.4,21.64C8.53,20.77 8.06,20.21 7.39,19C6.7,17.77 6.34,16.27\n 6.34,14.66C6.34,11.69 8.88,9.27 12,9.27C15.12,9.27 17.66,11.69\n 17.66,14.66A0.5,0.5 0 0,1 17.16,15.16A0.5,0.5 0 0,1\n 16.66,14.66C16.66,12.24 14.57,10.27 12,10.27C9.43,10.27 7.34,12.24\n 7.34,14.66C7.34,16.1 7.66,17.43 8.27,18.5C8.91,19.66 9.35,20.15\n 10.12,20.93C10.31,21.13 10.31,21.44 10.12,21.64C10,21.74 9.88,21.79\n 9.75,21.79M16.92,19.94C15.73,19.94 14.68,19.64 13.82,19.05C12.33,18.04\n 11.44,16.4 11.44,14.66A0.5,0.5 0 0,1 11.94,14.16A0.5,0.5 0 0,1\n 12.44,14.66C12.44,16.07 13.16,17.4 14.38,18.22C15.09,18.7 15.92,18.93\n 16.92,18.93C17.16,18.93 17.56,18.9 17.96,18.83C18.23,18.78 18.5,18.96\n 18.54,19.24C18.59,19.5 18.41,19.77 18.13,19.82C17.56,19.93 17.06,19.94\n 16.92,19.94M14.91,22C14.87,22 14.82,22 14.78,22C13.19,21.54 12.15,20.95\n 11.06,19.88C9.66,18.5 8.89,16.64 8.89,14.66C8.89,13.04 10.27,11.72\n 11.97,11.72C13.67,11.72 15.05,13.04 15.05,14.66C15.05,15.73 16,16.6\n 17.13,16.6C18.28,16.6 19.21,15.73 19.21,14.66C19.21,10.89 15.96,7.83\n 11.96,7.83C9.12,7.83 6.5,9.41 5.35,11.86C4.96,12.67 4.76,13.62\n 4.76,14.66C4.76,15.44 4.83,16.67 5.43,18.27C5.53,18.53 5.4,18.82\n 5.14,18.91C4.88,19 4.59,18.87 4.5,18.62C4,17.31 3.77,16\n 3.77,14.66C3.77,13.46 4,12.37 4.45,11.42C5.78,8.63 8.73,6.82\n 11.96,6.82C16.5,6.82 20.21,10.33 20.21,14.65C20.21,16.27 18.83,17.59\n 17.13,17.59C15.43,17.59 14.05,16.27 14.05,14.65C14.05,13.58 13.12,12.71\n 11.97,12.71C10.82,12.71 9.89,13.58 9.89,14.65C9.89,16.36 10.55,17.96\n 11.76,19.16C12.71,20.1 13.62,20.62 15.03,21C15.3,21.08 15.45,21.36\n 15.38,21.62C15.33,21.85 15.12,22 14.91,22Z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},yt="eswat2",wt=()=>t("a",{class:"absolute right-0 top-0 text-clrs-gray hover:text-clrs-navy",href:"https://eswat2.dev","aria-label":yt,target:"blank",title:yt},t(bt,{label:yt})),mt=(e,r)=>t("h1",{class:dt("text-center uppercase text-clrs-red","mb-11 ml-0 mr-0 mt-11","text-6xl font-thin")},r),vt=e=>{const{label:r,callback:o,matched:n=!1}=e;return t("button",{class:dt("rounded-md border border-solid border-clrs-slate4 font-bold",r===p?"mr-2 bg-clrs-yellow px-3 py-2 text-clrs-navy":r===g?"mr-2 bg-clrs-navy px-3 py-2 text-white":"x"===r?"mr-1 bg-clrs-red px-2 py-1 text-white":n?"mr-1 bg-clrs-slate4 px-2 py-1 text-white":"mr-1 bg-gray-50 px-2 py-1 text-clrs-navy"),onClick:o},r)},xt=()=>{const{keys:e,list:r,pick:o,solved:n}=tt,s=t=>()=>{ft.input(t)},i=n?[]:e,a=null!=o?r[o]:void 0;return t("div",{class:"mt-2 flex flex-row justify-end"},n||!a||a.isClue||"."==a.key?"":t(vt,{label:"x",callback:s(".")}),i.map((e=>t(vt,{label:e,callback:s(e),matched:a.key===e}))))},Ct=[2,5,11,14,20,23,29,32,38,41,47,50,56,59,65,68,74,77],Tt=Ct.map((t=>t+1)),kt=[18,19,20,21,22,23,24,25,26,45,46,47,48,49,50,51,52,53],Rt=kt.map((t=>t+9)),Et=e=>{const{cell:r,focus:o,selected:n,solved:s}=e,{key:i,isClue:a,indx:l}=r,c="."!=i?i:"";return t("label",{class:dt(`cell-${l}`,Ct.includes(l)?"border-xbr-clrs-navy":"",Tt.includes(l)?"border-xbl-clrs-navy":"",kt.includes(l)?"border-xbb-clrs-navy":"",Rt.includes(l)?"border-xbt-clrs-navy":"","h-8 w-8 border border-solid text-center leading-8",n?"border-clrs-red bg-clrs-red-a50 text-clrs-red":o?"border-clrs-gray bg-clrs-green-a50 font-bold":a?"border-clrs-gray bg-clrs-silver":""!==c?"border-clrs-gray text-clrs-red":"border-clrs-gray"),onClick:((t,e)=>()=>{e||ft.select(t)})(r,s)},c)},St=()=>{const{list:e,pick:r,locs:o,solved:n}=tt;return t("div",{class:dt("flex flex-row flex-wrap","border border-solid border-clrs-navy","h-76p5 w-76p5 text-lg")},e.map(((e,s)=>{const i=!n&&s===r,a=!n&&o.includes(s);return t(Et,{cell:e,focus:a,selected:i,solved:n})})))},jt=()=>t("label",{class:"ml-auto align-top text-xs italic text-clrs-slate4"},"Tailwind ","4.1.18"),Mt=t=>()=>{t.refresh()},Pt=t=>()=>{t.check()},At=()=>{const{list:e,solved:r}=tt;return t("div",{class:"flex flex-row"},t(vt,{label:g,callback:Mt(ft)}),81!==e.length||r?"":t(vt,{label:p,callback:Pt(ft)}),t(jt,null))},Ot=class{constructor(t){r(this,t),this.tag="proto-sudoku",this.platform="vercel"}componentDidLoad(){ft.initApp(this.platform)}render(){return t("div",{key:"9f50eec975c4da5f4984b80380067d5155dda0d1",id:"app",class:"ds1-main relative max-w-min p-0.5"},t(wt,{key:"e7bab7e257022a9920f8b43785d9dc33ab7fed65"}),t(mt,{key:"d8c32e6b9c20b9fe6c8ff2e9fc7a9900057a2679"},"Sudoku"),t(St,{key:"8a028015ae4380aaa54a406ccf5cc908816ca6a4"}),t(xt,{key:"951b6d20ca7a99ced4c60aa39fe040af6e96dd46"}),t("hr",{key:"35ba2812a3b068b21b5252c5f07d0b5dc2f18527",class:"ml-0 mr-0"}),t(At,{key:"114e7edd4bf3da82ae344f56cb7e856ce17a6da8"}),t(gt,{key:"2c15eb0ba714d1e0c378882c62ce575c428adc2a"}))}};Ot.style=" @layer properties; @layer theme, base, components, utilities; @layer theme { :root, :host { --font-sans: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; --color-gray-50: oklch(98.5% 0.002 247.839); --color-white: #fff; --spacing: 0.25rem; --text-xs: 0.75rem; --text-xs--line-height: calc(1 / 0.75); --text-lg: 1.125rem; --text-lg--line-height: calc(1.75 / 1.125); --text-6xl: 3.75rem; --text-6xl--line-height: 1; --font-weight-thin: 100; --font-weight-bold: 700; --radius-md: 0.375rem; --animate-spin: spin 1s linear infinite; } } @layer utilities { .absolute { position: absolute; } .relative { position: relative; } .top-0 { top: calc(var(--spacing) * 0); } .right-0 { right: calc(var(--spacing) * 0); } .m-6 { margin: calc(var(--spacing) * 6); } .mt-2 { margin-top: calc(var(--spacing) * 2); } .mt-5 { margin-top: calc(var(--spacing) * 5); } .mt-11 { margin-top: calc(var(--spacing) * 11); } .mr-0 { margin-right: calc(var(--spacing) * 0); } .mr-1 { margin-right: calc(var(--spacing) * 1); } .mr-2 { margin-right: calc(var(--spacing) * 2); } .mb-11 { margin-bottom: calc(var(--spacing) * 11); } .ml-0 { margin-left: calc(var(--spacing) * 0); } .ml-auto { margin-left: auto; } .flex { display: flex; } .grid { display: grid; } .h-8 { height: calc(var(--spacing) * 8); } .h-24px { height: 24px; } .h-76p5 { height: 19.125rem; } .w-8 { width: calc(var(--spacing) * 8); } .w-76p5 { width: 19.125rem; } .max-w-min { max-width: min-content; } .animate-spin { animation: var(--animate-spin); } .flex-col { flex-direction: column; } .flex-row { flex-direction: row; } .flex-wrap { flex-wrap: wrap; } .items-center { align-items: center; } .justify-end { justify-content: flex-end; } .rounded-md { border-radius: var(--radius-md); } .border { border-style: var(--tw-border-style); border-width: 1px; } .border-solid { --tw-border-style: solid; border-style: solid; } .border-clrs-gray { border-color: var(--clrs-gray, #aaaaaa); } .border-clrs-navy { border-color: var(--clrs-navy, #001f3f); } .border-clrs-red { border-color: var(--clrs-red, #ff4136); } .border-clrs-slate4 { border-color: var(--clrs-slate4, #4e5964); } .bg-clrs-green-a50 { background-color: var(--clrs-green-a50, #2ecc4050); } .bg-clrs-navy { background-color: var(--clrs-navy, #001f3f); } .bg-clrs-red { background-color: var(--clrs-red, #ff4136); } .bg-clrs-red-a50 { background-color: var(--clrs-red-a50, #ff413650); } .bg-clrs-silver { background-color: var(--clrs-silver, #dddddd); } .bg-clrs-slate4 { background-color: var(--clrs-slate4, #4e5964); } .bg-clrs-yellow { background-color: var(--clrs-yellow, #ffdc00); } .bg-gray-50 { background-color: var(--color-gray-50); } .p-0\\.5 { padding: calc(var(--spacing) * 0.5); } .px-2 { padding-inline: calc(var(--spacing) * 2); } .px-3 { padding-inline: calc(var(--spacing) * 3); } .py-1 { padding-block: calc(var(--spacing) * 1); } .py-2 { padding-block: calc(var(--spacing) * 2); } .text-center { text-align: center; } .align-top { vertical-align: top; } .font-sans { font-family: var(--font-sans); } .text-6xl { font-size: var(--text-6xl); line-height: var(--tw-leading, var(--text-6xl--line-height)); } .text-lg { font-size: var(--text-lg); line-height: var(--tw-leading, var(--text-lg--line-height)); } .text-xs { font-size: var(--text-xs); line-height: var(--tw-leading, var(--text-xs--line-height)); } .leading-8 { --tw-leading: calc(var(--spacing) * 8); line-height: calc(var(--spacing) * 8); } .font-bold { --tw-font-weight: var(--font-weight-bold); font-weight: var(--font-weight-bold); } .font-thin { --tw-font-weight: var(--font-weight-thin); font-weight: var(--font-weight-thin); } .text-clrs-gray { color: var(--clrs-gray, #aaaaaa); } .text-clrs-navy { color: var(--clrs-navy, #001f3f); } .text-clrs-red { color: var(--clrs-red, #ff4136); } .text-clrs-slate4 { color: var(--clrs-slate4, #4e5964); } .text-white { color: var(--color-white); } .uppercase { text-transform: uppercase; } .italic { font-style: italic; } .opacity-25 { opacity: 25%; } .opacity-75 { opacity: 75%; } .shadow { --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)); box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); } .border-xbb-clrs-navy { border-bottom: 1px solid var(--clrs-navy, #001f3f) !important; } .border-xbl-clrs-navy { border-left: 1px solid var(--clrs-navy, #001f3f) !important; } .border-xbr-clrs-navy { border-right: 1px solid var(--clrs-navy, #001f3f) !important; } .border-xbt-clrs-navy { border-top: 1px solid var(--clrs-navy, #001f3f) !important; } .hover\\:text-clrs-navy { &:hover { @media (hover: hover) { color: var(--clrs-navy, #001f3f); } } } } @layer components { .ds1-main { margin: calc(var(--spacing) * 6); display: flex; flex-direction: column; font-family: var(--font-sans); color: var(--clrs-navy, #001f3f); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } } @keyframes spin { to { transform: rotate(360deg); } } @layer properties { @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) { *, ::before, ::after, ::backdrop { --tw-border-style: solid; --tw-leading: initial; --tw-font-weight: initial; --tw-shadow: 0 0 #0000; --tw-shadow-color: initial; --tw-shadow-alpha: 100%; --tw-inset-shadow: 0 0 #0000; --tw-inset-shadow-color: initial; --tw-inset-shadow-alpha: 100%; --tw-ring-color: initial; --tw-ring-shadow: 0 0 #0000; --tw-inset-ring-color: initial; --tw-inset-ring-shadow: 0 0 #0000; --tw-ring-inset: initial; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; } } } ";export{Ot as proto_sudoku}
1
+ import{h as t,S as e,r}from"./p-CBkAXsXk.js";const o=e=>{const r=e.hex||"currentColor",o=e.size||24;return t("svg",{class:e.class,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"alien"),t("g",{fill:r},t("path",{d:"M10.31 10.93C11.33 12.57 11.18 14.5 9.96 15.28C8.74 16.04 6.92 15.33\n 5.89 13.69C4.87 12.05 5.03 10.1 6.25 9.34C7.47 8.58 9.29 9.29 10.31\n 10.93M12 17.75C14 17.75 14.5 17 14.5 17C14.5 17 14 19 12 19C10 19 9.5\n 17.03 9.5 17C9.5 17 10 17.75 12 17.75M17.75 9.34C18.97 10.1 19.13 12.05\n 18.11 13.69C17.08 15.33 15.26 16.04 14.04 15.28C12.82 14.5 12.67 12.57\n 13.69 10.93C14.71 9.29 16.53 8.58 17.75 9.34M12 20C14.5 20 20 14.86 20\n 11C20 7.14 16.41 4 12 4C7.59 4 4 7.14 4 11C4 14.86 9.5 20 12 20M12 2C17.5\n 2 22 6.04 22 11C22 15.08 16.32 22 12 22C7.68 22 2 15.08 2 11C2 6.04 6.5 2\n 12 2Z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},n="proto-sudoku",s=`${n}::data`,i=`${n}::inputs`,a=`${n}::pick`,l=t=>{const e=localStorage.getItem(t);return e?JSON.parse(e):void 0},c=(t,e)=>{const r=JSON.stringify(e);localStorage.setItem(t,r)},h=()=>[...l(i)],f=t=>{c(i,t.join(""))},d=()=>{const t=l(a);return null!==t?t:void 0},u=t=>{c(a,t>=0&&t<81?t:null)},p="Check ?",g="New Puzzle",b=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys()){const r=t.get(e).filter((t=>{const e=t.deref();return e&&(!("isConnected"in(r=e))||r.isConnected);var r}));t.set(e,r)}})(...e)}),2e3)}})(),y=e.forceUpdate,w=e.getRenderingRef,m=(t,e)=>{const r=t.indexOf(e);r>=0&&(t[r]=t[t.length-1],t.length--)};class v extends Error{response;request;options;constructor(t,e,r){const o=`${t.status||0===t.status?t.status:""} ${t.statusText??""}`.trim();super(`Request failed with ${o?`status code ${o}`:"an unknown error"}: ${e.method} ${e.url}`),this.name="HTTPError",this.response=t,this.request=e,this.options=r}}class x extends Error{name="NonError";value;constructor(t){let e="Non-error value was thrown";try{"string"==typeof t?e=t:t&&"object"==typeof t&&"message"in t&&"string"==typeof t.message&&(e=t.message)}catch{}super(e),this.value=t}}class C extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(t){const e=t?.cause?t.cause instanceof Error?t.cause:new x(t.cause):void 0;super(t?.code?`Forced retry: ${t.code}`:"Forced retry",e?{cause:e}:void 0),this.customDelay=t?.delay,this.code=t?.code,this.customRequest=t?.request}}const T=(()=>{let t=!1,e=!1;const r="function"==typeof globalThis.ReadableStream,o="function"==typeof globalThis.Request;if(r&&o)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(t){if(t instanceof Error&&"unsupported BodyInit type"===t.message)return!1;throw t}return t&&!e})(),k="function"==typeof globalThis.AbortController,R="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,E="function"==typeof globalThis.ReadableStream,S="function"==typeof globalThis.FormData,j=["get","post","put","patch","head","delete"],M={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},A=2147483647,P=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,O=Symbol("stop");class z{options;constructor(t){this.options=t}}const N=t=>new z(t),U={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},q={next:!0},L={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},B=(t,e,r)=>{let o,n=0;return t.pipeThrough(new TransformStream({transform(t,s){if(s.enqueue(t),o){n+=o.byteLength;let t=0===e?0:n/e;t>=1&&(t=1-Number.EPSILON),r?.({percent:t,totalBytes:Math.max(e,n),transferredBytes:n},o)}o=t},flush(){o&&(n+=o.byteLength,r?.({percent:1,totalBytes:Math.max(e,n),transferredBytes:n},o))}}))},$=t=>null!==t&&"object"==typeof t,D=(...t)=>{for(const e of t)if((!$(e)||Array.isArray(e))&&void 0!==e)throw new TypeError("The `options` argument must be an object");return W({},...t)},H=(t={},e={})=>{const r=new globalThis.Headers(t),o=e instanceof globalThis.Headers,n=new globalThis.Headers(e);for(const[t,e]of n.entries())o&&"undefined"===e||void 0===e?r.delete(t):r.set(t,e);return r};function J(t,e,r){return Object.hasOwn(e,r)&&void 0===e[r]?[]:W(t[r]??[],e[r]??[])}const X=(t={},e={})=>({beforeRequest:J(t,e,"beforeRequest"),beforeRetry:J(t,e,"beforeRetry"),afterResponse:J(t,e,"afterResponse"),beforeError:J(t,e,"beforeError")}),F=(t,e)=>{const r=new URLSearchParams;for(const o of[t,e])if(void 0!==o)if(o instanceof URLSearchParams)for(const[t,e]of o.entries())r.append(t,e);else if(Array.isArray(o))for(const t of o){if(!Array.isArray(t)||2!==t.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(t[0]),String(t[1]))}else if($(o))for(const[t,e]of Object.entries(o))void 0!==e&&r.append(t,String(e));else{const t=new URLSearchParams(o);for(const[e,o]of t.entries())r.append(e,o)}return r},W=(...t)=>{let e,r={},o={},n={};const s=[];for(const i of t)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if($(i)){for(let[t,o]of Object.entries(i))if("signal"===t&&o instanceof globalThis.AbortSignal)s.push(o);else if("context"!==t)"searchParams"!==t?($(o)&&t in r&&(o=W(r[t],o)),r={...r,[t]:o}):e=null==o?void 0:void 0===e?o:F(e,o);else{if(null!=o&&(!$(o)||Array.isArray(o)))throw new TypeError("The `context` option must be an object");r={...r,context:null==o?{}:{...r.context,...o}}}$(i.hooks)&&(n=X(n,i.hooks),r.hooks=n),$(i.headers)&&(o=H(o,i.headers),r.headers=o)}return void 0!==e&&(r.searchParams=e),s.length>0&&(r.signal=1===s.length?s[0]:R?AbortSignal.any(s):s.at(-1)),void 0===r.context&&(r.context={}),r},I=t=>j.includes(t)?t.toUpperCase():t,K={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},Z=(t={})=>{if("number"==typeof t)return{...K,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.methods&&=t.methods.map((t=>t.toLowerCase())),t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");const e=Object.fromEntries(Object.entries(t).filter((([,t])=>void 0!==t)));return{...K,...e}};class G extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}}class V{static create(t,e){const r=new V(t,e),o=r.#t((async()=>{if("number"==typeof r.#e.timeout&&r.#e.timeout>A)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let t=await r.#r();for(const e of r.#e.hooks.afterResponse){const o=r.#o(t.clone());let n;try{n=await e(r.request,r.#n(),o,{retryCount:r.#s})}catch(e){throw r.#i(o),r.#i(t),e}if(n instanceof z)throw r.#i(o),r.#i(t),new C(n.options);const s=n instanceof globalThis.Response?n:t;o!==s&&r.#i(o),t!==s&&r.#i(t),t=s}if(r.#o(t),!t.ok&&("function"==typeof r.#e.throwHttpErrors?r.#e.throwHttpErrors(t.status):r.#e.throwHttpErrors)){let e=new v(t,r.request,r.#n());for(const t of r.#e.hooks.beforeError)e=await t(e,{retryCount:r.#s});throw e}if(r.#e.onDownloadProgress){if("function"!=typeof r.#e.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!E)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const e=t.clone();return r.#i(t),((t,e)=>{if(!t.body)return t;if(204===t.status)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});const r=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response(B(t.body,r,e),{status:t.status,statusText:t.statusText,headers:t.headers})})(e,r.#e.onDownloadProgress)}return t})).finally((()=>{const t=r.#a;r.#l(t?.body??void 0),r.#l(r.request.body??void 0)}));for(const[t,n]of Object.entries(M))"bytes"===t&&"function"!=typeof globalThis.Response?.prototype?.bytes||(o[t]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||n);const s=await o;if("json"===t){if(204===s.status)return"";const t=await s.text();return""===t?"":e.parseJson?e.parseJson(t):JSON.parse(t)}return s[t]()});return o}static#c(t){return!t||"object"!=typeof t||Array.isArray(t)||t instanceof URLSearchParams?t:Object.fromEntries(Object.entries(t).filter((([,t])=>void 0!==t)))}request;#h;#s=0;#f;#e;#a;#d;#u;constructor(t,e={}){if(this.#f=t,this.#e={...e,headers:H(this.#f.headers,e.headers),hooks:X({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},e.hooks),method:I(e.method??this.#f.method??"GET"),prefixUrl:String(e.prefixUrl||""),retry:Z(e.retry),throwHttpErrors:e.throwHttpErrors??!0,timeout:e.timeout??1e4,fetch:e.fetch??globalThis.fetch.bind(globalThis),context:e.context??{}},"string"!=typeof this.#f&&!(this.#f instanceof URL||this.#f instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&"string"==typeof this.#f){if(this.#f.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#f=this.#e.prefixUrl+this.#f}k&&R&&(this.#d=this.#e.signal??this.#f.signal,this.#h=new globalThis.AbortController,this.#e.signal=this.#d?AbortSignal.any([this.#d,this.#h.signal]):this.#h.signal),T&&(this.#e.duplex="half"),void 0!==this.#e.json&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const r=e.headers&&new globalThis.Headers(e.headers).has("content-type");if(this.#f instanceof globalThis.Request&&(S&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#f,this.#e),void 0!==(o=this.#e.searchParams)&&(Array.isArray(o)?o.length>0:o instanceof URLSearchParams?o.size>0:"object"==typeof o?Object.keys(o).length>0:"string"==typeof o?o.trim().length>0:Boolean(o))){const t="string"==typeof this.#e.searchParams?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(V.#c(this.#e.searchParams)).toString(),e=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,"?"+t);this.request=new globalThis.Request(e,this.#e)}var o;if(this.#e.onUploadProgress){if("function"!=typeof this.#e.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!T)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#p(this.request,this.#e.body??void 0)}}#g(){const t=this.#e.retry.delay(this.#s);let e=t;!0===this.#e.retry.jitter?e=Math.random()*t:"function"==typeof this.#e.retry.jitter&&(e=this.#e.retry.jitter(t),(!Number.isFinite(e)||e<0)&&(e=t));const r=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,e)}async#b(t){if(this.#s++,this.#s>this.#e.retry.limit)throw t;const e=t instanceof Error?t:new x(t);if(e instanceof C)return e.customDelay??this.#g();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw t;if(void 0!==this.#e.retry.shouldRetry){const r=await this.#e.retry.shouldRetry({error:e,retryCount:this.#s});if(!1===r)throw t;if(!0===r)return this.#g()}if(function(t){return t instanceof G||t?.name===G.name}(t)&&!this.#e.retry.retryOnTimeout)throw t;if(function(t){return t instanceof v||t?.name===v.name}(t)){if(!this.#e.retry.statusCodes.includes(t.response.status))throw t;const e=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Retry-After")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(e&&this.#e.retry.afterStatusCodes.includes(t.response.status)){let t=1e3*Number(e);Number.isNaN(t)?t=Date.parse(e)-Date.now():t>=Date.parse("2024-01-01")&&(t-=Date.now());const r=this.#e.retry.maxRetryAfter??t;return t<r?t:r}if(413===t.response.status)throw t}return this.#g()}#o(t){return this.#e.parseJson&&(t.json=async()=>this.#e.parseJson(await t.text())),t}#l(t){t&&t.cancel().catch((()=>{}))}#i(t){this.#l(t.body??void 0)}async#t(t){try{return await t()}catch(e){const r=Math.min(await this.#b(e),A);if(this.#s<1)throw e;if(await async function(t,{signal:e}){return new Promise(((r,o)=>{function n(){clearTimeout(s),o(e.reason)}e&&(e.throwIfAborted(),e.addEventListener("abort",n,{once:!0}));const s=setTimeout((()=>{e?.removeEventListener("abort",n),r()}),t)}))}(r,this.#d?{signal:this.#d}:{}),e instanceof C&&e.customRequest){const t=this.#e.signal?new globalThis.Request(e.customRequest,{signal:this.#e.signal}):new globalThis.Request(e.customRequest);this.#y(t)}for(const t of this.#e.hooks.beforeRetry){const r=await t({request:this.request,options:this.#n(),error:e,retryCount:this.#s});if(r instanceof globalThis.Request){this.#y(r);break}if(r instanceof globalThis.Response)return r;if(r===O)return}return this.#t(t)}}async#r(){this.#h?.signal.aborted&&(this.#h=new globalThis.AbortController,this.#e.signal=this.#d?AbortSignal.any([this.#d,this.#h.signal]):this.#h.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(const t of this.#e.hooks.beforeRequest){const e=await t(this.request,this.#n(),{retryCount:this.#s});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#y(e);break}}const t=((t,e)=>{const r={};for(const o in e)Object.hasOwn(e,o)&&(o in L||o in U||o in t&&!(o in q)||(r[o]=e[o]));return r})(this.request,this.#e);return this.#a=this.request,this.request=this.#a.clone(),!1===this.#e.timeout?this.#e.fetch(this.#a,t):async function(t,e,r,o){return new Promise(((n,s)=>{const i=setTimeout((()=>{r&&r.abort(),s(new G(t))}),o.timeout);o.fetch(t,e).then(n).catch(s).then((()=>{clearTimeout(i)}))}))}(this.#a,t,this.#h,this.#e)}#n(){if(!this.#u){const{hooks:t,...e}=this.#e;this.#u=Object.freeze(e)}return this.#u}#y(t){this.#u=void 0,this.request=this.#p(t)}#p(t,e){return this.#e.onUploadProgress&&t.body?((t,e,r)=>{if(!t.body)return t;const o=(t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(const[r,o]of t)e+=P,e+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,e+="string"==typeof o?(new TextEncoder).encode(o).length:o.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if("string"==typeof t)return(new TextEncoder).encode(t).length;if(t instanceof URLSearchParams)return(new TextEncoder).encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if("object"==typeof t&&null!==t)try{const e=JSON.stringify(t);return(new TextEncoder).encode(e).length}catch{return 0}return 0})(r??t.body);return new Request(t,{duplex:"half",body:B(t.body,o,e)})})(t,this.#e.onUploadProgress,e??this.#e.body??void 0):t}}
2
+ /*! MIT License © Sindre Sorhus */const Y=t=>{const e=(e,r)=>V.create(e,D(t,r));for(const r of j)e[r]=(e,o)=>V.create(e,D(t,o,{method:r}));return e.create=t=>Y(D(t)),e.extend=e=>("function"==typeof e&&(e=e(t??{})),Y(D(t,e))),e.stop=O,e.retry=N,e},_=Y(),Q={list:[],keys:[],locs:[],loading:!1,solved:!1,error:void 0,pick:void 0,data:void 0},{state:tt}=(()=>{const t=((t,e=(t,e)=>t!==e)=>{const r=()=>{return("function"==typeof(e=t)?e():e)??{};var e},o=r();let n=new Map(Object.entries(o));const s="undefined"!=typeof Proxy,i=s?null:{},a={dispose:[],get:[],set:[],reset:[]},l=new Map,c=()=>{n=new Map(Object.entries(r())),s||g(),a.reset.forEach((t=>t()))},h=t=>(a.get.forEach((e=>e(t))),n.get(t)),f=(t,r)=>{const o=n.get(t);e(r,o,t)&&(n.set(t,r),s||p(t),a.set.forEach((e=>e(t,r,o))))},d=s?new Proxy(o,{get:(t,e)=>h(e),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>n.has(e),set:(t,e,r)=>(f(e,r),!0)}):(g(),i),u=(t,e)=>(a[t].push(e),()=>{m(a[t],e)});function p(t){!s&&i&&(Object.prototype.hasOwnProperty.call(i,t)||Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:()=>h(t),set(e){f(t,e)}}))}function g(){if(s||!i)return;const t=new Set(n.keys());for(const e of Object.keys(i))t.has(e)||delete i[e];for(const e of t)p(e)}return{state:d,get:h,set:f,on:u,onChange:(t,e)=>{const o=(r,o)=>{r===t&&e(o)},n=()=>{const o=r();e(o[t])},s=u("set",o),i=u("reset",n);return l.set(e,{setHandler:o,resetHandler:n,propName:t}),()=>{s(),i(),l.delete(e)}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(u("set",e.set)),e.get&&t.push(u("get",e.get)),e.reset&&t.push(u("reset",e.reset)),e.dispose&&t.push(u("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{a.dispose.forEach((t=>t())),c()},reset:c,forceUpdate:t=>{const e=n.get(t);a.set.forEach((r=>r(t,e,e)))},removeListener:(t,e)=>{const r=l.get(e);r&&r.propName===t&&(m(a.set,r.setHandler),m(a.reset,r.resetHandler),l.delete(e))}}})(Q,void 0);return t.use((()=>{if("function"!=typeof w||"function"!=typeof y)return{};const t=y,e=w,r=new Map;return{dispose:()=>r.clear(),get:t=>{const o=e();o&&((t,e,r)=>{let o=t.get(e);o||(o=[],t.set(e,o)),o.some((t=>t.deref()===r))||o.push(new WeakRef(r))})(r,t,o)},set:e=>{const o=r.get(e);if(o){const n=o.filter((e=>{const r=e.deref();return!!r&&t(r)}));r.set(e,n)}b(r)},reset:()=>{r.forEach((e=>{e.forEach((e=>{const r=e.deref();r&&t(r)}))})),b(r)}}})()),t})(),et=new Map([["row",new Map],["column",new Map],["box",new Map]]),rt=["1","2","3","4","5","6","7","8","9"],ot=t=>{if(void 0!==t&&t.indx!=tt.pick){const{isClue:e,indx:r,row:o,column:n,box:s}=t,i=((t,e,r,o)=>{const n=new Map([["row",e],["column",r],["box",o]]),s=new Set;return n.forEach(((e,r)=>{et.get(r).get(e).forEach((e=>{e!==t&&s.add(e)}))})),Array.from(s)})(r,o,n,s),a=e?[]:(t=>{const{list:e}=tt,r=new Set;return t.map((t=>{const{key:o}=e[t];"."!=o&&r.add(o)})),rt.filter((t=>!r.has(t)))})(i);tt.pick=r,tt.keys=a,tt.locs=i}else tt.pick=void 0,tt.keys=[],tt.locs=[];at(tt.pick)};let nt;const st={local:"http://localhost:8080/api",netlify:"/.netlify/functions",vercel:"https://sudoku-rust-api.vercel.app/api"},it=t=>{f(t)},at=t=>{u(t)},lt=(t=!1)=>{tt.list=[],tt.keys=[],tt.locs=[],tt.loading=t,tt.solved=!1,tt.error=void 0,tt.pick=void 0,tt.data=void 0},ct=(t,e=!0)=>{const{puzzle:r,ref:o}=t;e&&(f([]),c(s,t)),(t=>{if(t){const{puzzle:e,ref:r}=t,o=e?[...e]:[],n=r?atob(r):void 0,s=n?[...n]:[],i=o.map(((t,e)=>{const r=s[e],o=t===r,n=Math.floor(e/9),i=e%9,a=((t,e)=>e<3?t<3?0:t<6?3:6:e<6?t<3?1:t<6?4:7:t<3?2:t<6?5:8)(n,i);return((t,e,r,o)=>{new Map([["row",e],["column",r],["box",o]]).forEach(((e,r)=>{const o=et.get(r);o.has(e)?o.get(e).add(t):o.set(e,new Set([t]))}))})(e,n,i,a),{key:t,isClue:o,value:r,indx:e,row:n,column:i,box:a}}));(t=>{h().forEach(((e,r)=>{const o=t[r],{isClue:n}=o;n||(o.key=e)}))})(i),tt.data=t,tt.list=i}else tt.data=void 0,tt.list=[]})({puzzle:r,ref:o})},ht=t=>{tt.list=[...t],t.length=0},ft={initApp:t=>{(t=>{const e=(t=>{const e=Object.keys(st).includes(t)?t:"vercel";return st[e]})(t);nt=_.extend({hooks:{beforeRequest:[t=>{t.headers.set("X-Requested-With","ky"),t.headers.set("X-Custom-Header","foobar")}]},prefixUrl:e,timeout:1e4})})(t),lt();const e=l(s),r=d();if(e&&(ct(e,!1),r>=0)){const{list:t}=tt;ot(t[r])}},refresh:async()=>{lt(!0),it([]),at(tt.pick);try{const t=await nt.get("puzzle").json();ct(t)}catch(t){const{message:e}=t;console.log("-- ",e),console.log(t),tt.error=e}finally{tt.loading=!1}},select:t=>{ot(t)},check:()=>{const{list:t}=tt,e=[];let r=0,o=0,n=0;t.forEach((t=>{const{key:s,value:i,isClue:a}=t;a?n+=1:"."!==s&&(s!==i?(r+=1,t.key="."):o+=1),e.push(t.key)}));const s=n+o;it(o?e:[]),r>0?ht(t):81===s&&(tt.solved=!0)},input:t=>{const{pick:e,list:r}=tt;r[e].key=t,ht(r)}},dt=(...t)=>t.filter(Boolean).join(" "),ut=e=>{const r=e.hex||"currentColor",o=e.label||"loading...",n=e.size||24;return t("svg",{class:dt(e.class||"","animate-spin"),width:n,height:n,fill:"none",viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,o),t("g",null,t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:r,"stroke-width":"4"}),t("path",{class:"opacity-75",fill:r,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},pt=e=>{const{message:r,salute:n,spinner:s=!1}=e;return t("div",{class:"mt-5 flex h-24px flex-row items-center"},t(s?ut:o,{class:"mr-2"}),n?t("label",{class:"mr-1 font-bold"},n,":"):"",t("label",{class:"italic"},r))},gt=()=>{const{solved:e,loading:r,error:o}=tt;return t("div",{class:"flex flex-col"},r||o||e?"":t(pt,{message:"Welcome, are you ready to play?..."}),r?t(pt,{message:"Loading...",spinner:!0}):"",o?t(pt,{message:o,salute:"ERROR"}):"",e?t(pt,{message:"You solved the puzzle!!"}):"")},bt=e=>{const r=e.hex||"currentColor",o=e.size||24;return t("svg",{class:e.class,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"fingerprint"),t("g",{fill:r},t("path",{d:"M17.81,4.47C17.73,4.47 17.65,4.45 17.58,4.41C15.66,3.42 14,3\n 12,3C10.03,3 8.15,3.47 6.44,4.41C6.2,4.54 5.9,4.45 5.76,4.21C5.63,3.97\n 5.72,3.66 5.96,3.53C7.82,2.5 9.86,2 12,2C14.14,2 16,2.47\n 18.04,3.5C18.29,3.65 18.38,3.95 18.25,4.19C18.16,4.37 18,4.47\n 17.81,4.47M3.5,9.72C3.4,9.72 3.3,9.69 3.21,9.63C3,9.47 2.93,9.16\n 3.09,8.93C4.08,7.53 5.34,6.43 6.84,5.66C10,4.04 14,4.03\n 17.15,5.65C18.65,6.42 19.91,7.5 20.9,8.9C21.06,9.12 21,9.44\n 20.78,9.6C20.55,9.76 20.24,9.71 20.08,9.5C19.18,8.22 18.04,7.23\n 16.69,6.54C13.82,5.07 10.15,5.07 7.29,6.55C5.93,7.25 4.79,8.25\n 3.89,9.5C3.81,9.65 3.66,9.72 3.5,9.72M9.75,21.79C9.62,21.79 9.5,21.74\n 9.4,21.64C8.53,20.77 8.06,20.21 7.39,19C6.7,17.77 6.34,16.27\n 6.34,14.66C6.34,11.69 8.88,9.27 12,9.27C15.12,9.27 17.66,11.69\n 17.66,14.66A0.5,0.5 0 0,1 17.16,15.16A0.5,0.5 0 0,1\n 16.66,14.66C16.66,12.24 14.57,10.27 12,10.27C9.43,10.27 7.34,12.24\n 7.34,14.66C7.34,16.1 7.66,17.43 8.27,18.5C8.91,19.66 9.35,20.15\n 10.12,20.93C10.31,21.13 10.31,21.44 10.12,21.64C10,21.74 9.88,21.79\n 9.75,21.79M16.92,19.94C15.73,19.94 14.68,19.64 13.82,19.05C12.33,18.04\n 11.44,16.4 11.44,14.66A0.5,0.5 0 0,1 11.94,14.16A0.5,0.5 0 0,1\n 12.44,14.66C12.44,16.07 13.16,17.4 14.38,18.22C15.09,18.7 15.92,18.93\n 16.92,18.93C17.16,18.93 17.56,18.9 17.96,18.83C18.23,18.78 18.5,18.96\n 18.54,19.24C18.59,19.5 18.41,19.77 18.13,19.82C17.56,19.93 17.06,19.94\n 16.92,19.94M14.91,22C14.87,22 14.82,22 14.78,22C13.19,21.54 12.15,20.95\n 11.06,19.88C9.66,18.5 8.89,16.64 8.89,14.66C8.89,13.04 10.27,11.72\n 11.97,11.72C13.67,11.72 15.05,13.04 15.05,14.66C15.05,15.73 16,16.6\n 17.13,16.6C18.28,16.6 19.21,15.73 19.21,14.66C19.21,10.89 15.96,7.83\n 11.96,7.83C9.12,7.83 6.5,9.41 5.35,11.86C4.96,12.67 4.76,13.62\n 4.76,14.66C4.76,15.44 4.83,16.67 5.43,18.27C5.53,18.53 5.4,18.82\n 5.14,18.91C4.88,19 4.59,18.87 4.5,18.62C4,17.31 3.77,16\n 3.77,14.66C3.77,13.46 4,12.37 4.45,11.42C5.78,8.63 8.73,6.82\n 11.96,6.82C16.5,6.82 20.21,10.33 20.21,14.65C20.21,16.27 18.83,17.59\n 17.13,17.59C15.43,17.59 14.05,16.27 14.05,14.65C14.05,13.58 13.12,12.71\n 11.97,12.71C10.82,12.71 9.89,13.58 9.89,14.65C9.89,16.36 10.55,17.96\n 11.76,19.16C12.71,20.1 13.62,20.62 15.03,21C15.3,21.08 15.45,21.36\n 15.38,21.62C15.33,21.85 15.12,22 14.91,22Z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},yt="eswat2",wt=()=>t("a",{class:"absolute right-0 top-0 text-clrs-gray hover:text-clrs-navy",href:"https://eswat2.dev","aria-label":yt,target:"blank",title:yt},t(bt,{label:yt})),mt=(e,r)=>t("h1",{class:dt("text-center uppercase text-clrs-red","mb-11 ml-0 mr-0 mt-11","text-6xl font-thin")},r),vt=e=>{const{label:r,callback:o,matched:n=!1}=e;return t("button",{class:dt("rounded-md border border-solid border-clrs-slate4 font-bold",r===p?"mr-2 bg-clrs-yellow px-3 py-2 text-clrs-navy":r===g?"mr-2 bg-clrs-navy px-3 py-2 text-white":"x"===r?"mr-1 bg-clrs-red px-2 py-1 text-white":n?"mr-1 bg-clrs-slate4 px-2 py-1 text-white":"mr-1 bg-gray-50 px-2 py-1 text-clrs-navy"),onClick:o},r)},xt=()=>{const{keys:e,list:r,pick:o,solved:n}=tt,s=t=>()=>{ft.input(t)},i=n?[]:e,a=null!=o?r[o]:void 0;return t("div",{class:"mt-2 flex flex-row justify-end"},n||!a||a.isClue||"."==a.key?"":t(vt,{label:"x",callback:s(".")}),i.map((e=>t(vt,{label:e,callback:s(e),matched:a.key===e}))))},Ct=[2,5,11,14,20,23,29,32,38,41,47,50,56,59,65,68,74,77],Tt=Ct.map((t=>t+1)),kt=[18,19,20,21,22,23,24,25,26,45,46,47,48,49,50,51,52,53],Rt=kt.map((t=>t+9)),Et=e=>{const{cell:r,focus:o,selected:n,solved:s}=e,{key:i,isClue:a,indx:l}=r,c="."!=i?i:"";return t("label",{class:dt(`cell-${l}`,Ct.includes(l)?"border-xbr-clrs-navy":"",Tt.includes(l)?"border-xbl-clrs-navy":"",kt.includes(l)?"border-xbb-clrs-navy":"",Rt.includes(l)?"border-xbt-clrs-navy":"","h-8 w-8 border border-solid text-center leading-8",n?"border-clrs-red bg-clrs-red-a50 text-clrs-red":o?"border-clrs-gray bg-clrs-green-a50 font-bold":a?"border-clrs-gray bg-clrs-silver":""!==c?"border-clrs-gray text-clrs-red":"border-clrs-gray"),onClick:((t,e)=>()=>{e||ft.select(t)})(r,s)},c)},St=()=>{const{list:e,pick:r,locs:o,solved:n}=tt;return t("div",{class:dt("flex flex-row flex-wrap","border border-solid border-clrs-navy","h-76p5 w-76p5 text-lg")},e.map(((e,s)=>{const i=!n&&s===r,a=!n&&o.includes(s);return t(Et,{cell:e,focus:a,selected:i,solved:n})})))},jt=()=>t("label",{class:"ml-auto align-top text-xs italic text-clrs-slate4"},"Tailwind ","4.1.18"),Mt=t=>()=>{t.refresh()},At=t=>()=>{t.check()},Pt=()=>{const{list:e,solved:r}=tt;return t("div",{class:"flex flex-row"},t(vt,{label:g,callback:Mt(ft)}),81!==e.length||r?"":t(vt,{label:p,callback:At(ft)}),t(jt,null))},Ot=class{constructor(t){r(this,t),this.tag="proto-sudoku",this.platform="vercel"}componentDidLoad(){ft.initApp(this.platform)}render(){return t("div",{key:"9f50eec975c4da5f4984b80380067d5155dda0d1",id:"app",class:"ds1-main relative max-w-min p-0.5"},t(wt,{key:"e7bab7e257022a9920f8b43785d9dc33ab7fed65"}),t(mt,{key:"d8c32e6b9c20b9fe6c8ff2e9fc7a9900057a2679"},"Sudoku"),t(St,{key:"8a028015ae4380aaa54a406ccf5cc908816ca6a4"}),t(xt,{key:"951b6d20ca7a99ced4c60aa39fe040af6e96dd46"}),t("hr",{key:"35ba2812a3b068b21b5252c5f07d0b5dc2f18527",class:"ml-0 mr-0"}),t(Pt,{key:"114e7edd4bf3da82ae344f56cb7e856ce17a6da8"}),t(gt,{key:"2c15eb0ba714d1e0c378882c62ce575c428adc2a"}))}};Ot.style=" @layer properties; @layer theme, base, components, utilities; @layer theme { :root, :host { --font-sans: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; --color-gray-50: oklch(98.5% 0.002 247.839); --color-white: #fff; --spacing: 0.25rem; --text-xs: 0.75rem; --text-xs--line-height: calc(1 / 0.75); --text-lg: 1.125rem; --text-lg--line-height: calc(1.75 / 1.125); --text-6xl: 3.75rem; --text-6xl--line-height: 1; --font-weight-thin: 100; --font-weight-bold: 700; --radius-md: 0.375rem; --animate-spin: spin 1s linear infinite; } } @layer utilities { .absolute { position: absolute; } .relative { position: relative; } .top-0 { top: calc(var(--spacing) * 0); } .right-0 { right: calc(var(--spacing) * 0); } .m-6 { margin: calc(var(--spacing) * 6); } .mt-2 { margin-top: calc(var(--spacing) * 2); } .mt-5 { margin-top: calc(var(--spacing) * 5); } .mt-11 { margin-top: calc(var(--spacing) * 11); } .mr-0 { margin-right: calc(var(--spacing) * 0); } .mr-1 { margin-right: calc(var(--spacing) * 1); } .mr-2 { margin-right: calc(var(--spacing) * 2); } .mb-11 { margin-bottom: calc(var(--spacing) * 11); } .ml-0 { margin-left: calc(var(--spacing) * 0); } .ml-auto { margin-left: auto; } .flex { display: flex; } .grid { display: grid; } .h-8 { height: calc(var(--spacing) * 8); } .h-24px { height: 24px; } .h-76p5 { height: 19.125rem; } .w-8 { width: calc(var(--spacing) * 8); } .w-76p5 { width: 19.125rem; } .max-w-min { max-width: min-content; } .animate-spin { animation: var(--animate-spin); } .flex-col { flex-direction: column; } .flex-row { flex-direction: row; } .flex-wrap { flex-wrap: wrap; } .items-center { align-items: center; } .justify-end { justify-content: flex-end; } .rounded-md { border-radius: var(--radius-md); } .border { border-style: var(--tw-border-style); border-width: 1px; } .border-solid { --tw-border-style: solid; border-style: solid; } .border-clrs-gray { border-color: var(--clrs-gray, #aaaaaa); } .border-clrs-navy { border-color: var(--clrs-navy, #001f3f); } .border-clrs-red { border-color: var(--clrs-red, #ff4136); } .border-clrs-slate4 { border-color: var(--clrs-slate4, #4e5964); } .bg-clrs-green-a50 { background-color: var(--clrs-green-a50, #2ecc4050); } .bg-clrs-navy { background-color: var(--clrs-navy, #001f3f); } .bg-clrs-red { background-color: var(--clrs-red, #ff4136); } .bg-clrs-red-a50 { background-color: var(--clrs-red-a50, #ff413650); } .bg-clrs-silver { background-color: var(--clrs-silver, #dddddd); } .bg-clrs-slate4 { background-color: var(--clrs-slate4, #4e5964); } .bg-clrs-yellow { background-color: var(--clrs-yellow, #ffdc00); } .bg-gray-50 { background-color: var(--color-gray-50); } .p-0\\.5 { padding: calc(var(--spacing) * 0.5); } .px-2 { padding-inline: calc(var(--spacing) * 2); } .px-3 { padding-inline: calc(var(--spacing) * 3); } .py-1 { padding-block: calc(var(--spacing) * 1); } .py-2 { padding-block: calc(var(--spacing) * 2); } .text-center { text-align: center; } .align-top { vertical-align: top; } .font-sans { font-family: var(--font-sans); } .text-6xl { font-size: var(--text-6xl); line-height: var(--tw-leading, var(--text-6xl--line-height)); } .text-lg { font-size: var(--text-lg); line-height: var(--tw-leading, var(--text-lg--line-height)); } .text-xs { font-size: var(--text-xs); line-height: var(--tw-leading, var(--text-xs--line-height)); } .leading-8 { --tw-leading: calc(var(--spacing) * 8); line-height: calc(var(--spacing) * 8); } .font-bold { --tw-font-weight: var(--font-weight-bold); font-weight: var(--font-weight-bold); } .font-thin { --tw-font-weight: var(--font-weight-thin); font-weight: var(--font-weight-thin); } .text-clrs-gray { color: var(--clrs-gray, #aaaaaa); } .text-clrs-navy { color: var(--clrs-navy, #001f3f); } .text-clrs-red { color: var(--clrs-red, #ff4136); } .text-clrs-slate4 { color: var(--clrs-slate4, #4e5964); } .text-white { color: var(--color-white); } .uppercase { text-transform: uppercase; } .italic { font-style: italic; } .opacity-25 { opacity: 25%; } .opacity-75 { opacity: 75%; } .shadow { --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)); box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); } .border-xbb-clrs-navy { border-bottom: 1px solid var(--clrs-navy, #001f3f) !important; } .border-xbl-clrs-navy { border-left: 1px solid var(--clrs-navy, #001f3f) !important; } .border-xbr-clrs-navy { border-right: 1px solid var(--clrs-navy, #001f3f) !important; } .border-xbt-clrs-navy { border-top: 1px solid var(--clrs-navy, #001f3f) !important; } .hover\\:text-clrs-navy { &:hover { @media (hover: hover) { color: var(--clrs-navy, #001f3f); } } } } @layer components { .ds1-main { margin: calc(var(--spacing) * 6); display: flex; flex-direction: column; font-family: var(--font-sans); color: var(--clrs-navy, #001f3f); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } } @keyframes spin { to { transform: rotate(360deg); } } @layer properties { @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) { *, ::before, ::after, ::backdrop { --tw-border-style: solid; --tw-leading: initial; --tw-font-weight: initial; --tw-shadow: 0 0 #0000; --tw-shadow-color: initial; --tw-shadow-alpha: 100%; --tw-inset-shadow: 0 0 #0000; --tw-inset-shadow-color: initial; --tw-inset-shadow-alpha: 100%; --tw-ring-color: initial; --tw-ring-shadow: 0 0 #0000; --tw-inset-ring-color: initial; --tw-inset-ring-shadow: 0 0 #0000; --tw-ring-inset: initial; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; } } } ";export{Ot as proto_sudoku}
@@ -1 +1 @@
1
- import{p as t,B as a,c as o,w as n,N as r,H as e,b as i}from"./p-BhoER2hU.js";export{s as setNonce}from"./p-BhoER2hU.js";import{g as p}from"./p-DQuL1Twl.js";var m=s=>{const t=s.cloneNode;s.cloneNode=function(s){if("TEMPLATE"===this.nodeName)return t.call(this,s);const a=t.call(this,!1),o=this.childNodes;if(s)for(let s=0;s<o.length;s++)2!==o[s].nodeType&&a.appendChild(o[s].cloneNode(!0));return a}};(()=>{a.isDev&&!a.isTesting&&o("Running in development mode."),a.cloneNodeFix&&m(e.prototype);const s=a.scriptDataOpts?n.document&&Array.from(n.document.querySelectorAll("script")).find((s=>new RegExp(`/${r}(\\.esm)?\\.js($|\\?|#)`).test(s.src)||s.getAttribute("data-stencil-namespace")===r)):null,i=import.meta.url,p=a.scriptDataOpts&&(s||{})["data-opts"]||{};return""!==i&&(p.resourcesUrl=new URL(".",i).href),t(p)})().then((async s=>(await p(),i([["p-42d05a0f",[[1,"proto-sudoku",{tag:[1],platform:[1]}]]]],s))));
1
+ import{p as t,B as a,c as n,w as r,N as e,H as o,b as i}from"./p-CBkAXsXk.js";export{s as setNonce}from"./p-CBkAXsXk.js";import{g as p}from"./p-DQuL1Twl.js";var m=s=>{const t=s.cloneNode;s.cloneNode=function(s){if("TEMPLATE"===this.nodeName)return t.call(this,s);const a=t.call(this,!1),n=this.childNodes;if(s)for(let s=0;s<n.length;s++)2!==n[s].nodeType&&a.appendChild(n[s].cloneNode(!0));return a}};(()=>{a.isDev&&!a.isTesting&&n("Running in development mode."),a.cloneNodeFix&&m(o.prototype);const s=a.scriptDataOpts?r.document&&Array.from(r.document.querySelectorAll("script")).find((s=>new RegExp(`/${e}(\\.esm)?\\.js($|\\?|#)`).test(s.src)||s.getAttribute("data-stencil-namespace")===e)):null,i=import.meta.url,p=a.scriptDataOpts&&(s||{})["data-opts"]||{};return""!==i&&(p.resourcesUrl=new URL(".",i).href),t(p)})().then((async s=>(await p(),i([["p-ff3c032f",[[1,"proto-sudoku",{tag:[1],platform:[1]}]]]],s))));
@@ -618,7 +618,7 @@ export interface FunctionalUtilities {
618
618
  map: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => ChildNode) => VNode[];
619
619
  }
620
620
  export interface FunctionalComponent<T = {}> {
621
- (props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[];
621
+ (props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[] | null;
622
622
  }
623
623
  /**
624
624
  * A Child VDOM node
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proto-sudoku-wc",
3
- "version": "0.1.138",
3
+ "version": "0.1.140",
4
4
  "description": "prototype - a simple Sudoku app rendered in Stencil and Tailwind",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -27,14 +27,14 @@
27
27
  "format": "prettier --write src"
28
28
  },
29
29
  "dependencies": {
30
- "@stencil/core": "4.41.0",
30
+ "@stencil/core": "4.41.1",
31
31
  "@stencil/store": "2.2.2",
32
32
  "ky": "1.14.2"
33
33
  },
34
34
  "devDependencies": {
35
35
  "autoprefixer": "10.4.23",
36
36
  "concurrently": "9.2.1",
37
- "cspell": "9.4.0",
37
+ "cspell": "9.6.0",
38
38
  "cssnano": "7.1.2",
39
39
  "eslint": "9.39.2",
40
40
  "postcss": "8.5.6",