1import{a as Y}from"./chunk-FWJYLQED.js";import{v as Q}from"./chunk-TZNULTMS.js";import{d as U,e as G,g as W}from"./chunk-OTFQW5RD.js";import{d as A,e as $,m as q,o as X,r as J}from"./chunk-CRIW2URF.js";import"./chunk-46N4GR24.js";import{a as K}from"./chunk-I753HY6N.js";import{a as L,q as z,t as w}from"./chunk-XCN7D4FF.js";import{Bb as T,Db as x,Fb as S,Gb as O,Hb as y,Ib as l,Jb as s,Kb as p,Na as M,Ob as E,Sb as _,Ta as c,Tb as u,Xb as N,Ya as h,bb as I,bc as f,ca as C,cc as j,da as b,dc as R,gb as v,jc as B,qb as D,ua as V,vb as F,yc as H,zb as k}from"./chunk-EUPJYUUU.js";import"./chunk-TSRGIXR5.js";var tt=()=>[import("./chunk-OWVL53ZV.js").then(r=>r.FooterComponent)],et=()=>[0,1,2,3,4,5,6,7,8];function it(r,d){if(r&1&&(l(0,"div",1),p(1,"img",8),s()),r&2){let t=u();k("hidden",t.showLoader)}}function nt(r,d){if(r&1&&(l(0,"span"),f(1),s()),r&2){let t=u().$implicit;c(),j(t.val)}}function ot(r,d){if(r&1&&(l(0,"div",21),f(1),s()),r&2){let t=d.$implicit,e=u(2).$implicit,i=u(3);c(),R(" ",e.notes.includes(i.arrNumbers[t])?i.arrNumbers[t]:""," ")}}function rt(r,d){r&1&&(l(0,"div",20),O(1,ot,2,1,"div",21,S),s()),r&2&&(c(),y(B(0,et)))}function at(r,d){if(r&1){let t=E();l(0,"td",19),_("click",function(){let i=C(t).$implicit,o=u(3);return b(o.selectCell(i))}),v(1,nt,2,1,"span")(2,rt,3,1,"div",20),s()}if(r&2){let t=d.$implicit,e=u(3);T("locked",t.locked)("success",t.isSuccess)("current",e.selectedCell===t)("highlight",t.isHighlight)("samevalue",t.isSameValue)("error",t.isError)("pencil",t.pencil),c(),x(t.pencil?-1:1),c(),x(t.pencil?2:-1)}}function lt(r,d){if(r&1&&(l(0,"tr"),O(1,at,3,16,"td",18,S),s()),r&2){let t=d.$implicit;c(),y(t)}}function st(r,d){if(r&1){let t=E();l(0,"img",22),_("click",function(){let i=C(t).$index,o=u(2);return b(o.selectDigit(i+1,!0))}),s()}if(r&2){let t=d.$index;N("src","assets/images/",t+1,".png",M)}}function ct(r,d){if(r&1){let t=E();l(0,"div",2)(1,"div",9)(2,"table",10),O(3,lt,3,0,"tr",null,S),s()(),p(5,"div",11),l(6,"div",12)(7,"img",13),_("click",function(){C(t);let i=u();return b(i.addNote())}),s(),l(8,"img",14),_("click",function(){C(t);let i=u();return b(i.clearCell())}),s()(),l(9,"div",15)(10,"div",16),O(11,st,1,2,"img",17,S),s()()()}if(r&2){let t=u();k("hidden",t.showLoader),c(3),y(t.grid),c(4),T("active-pencil",t.selectedCell==null?null:t.selectedCell.pencil),c(4),y(t.arrNumbers)}}function dt(r,d){r&1&&p(0,"app-footer")}function ut(r,d){r&1&&(l(0,"div",23),f(1,"Loading preview..."),s())}function gt(r,d){r&1&&(l(0,"div",39),f(1,"Link Copied!"),s())}function pt(r,d){if(r&1){let t=E();l(0,"div",24),_("click",function(){C(t);let i=u();return b(i.isShareModalShow=!1)}),l(1,"div",25),_("click",function(i){return C(t),b(i.stopPropagation())}),l(2,"div",26)(3,"h3",27),f(4,"\u09B6\u09C7\u09DF\u09BE\u09B0 \u0995\u09B0\u09C1\u09A8"),s(),l(5,"button",28),_("click",function(){C(t);let i=u();return b(i.isShareModalShow=!1)}),p(6,"app-svg-icon",29),s()(),l(7,"div",30)(8,"a",31),p(9,"app-svg-icon",32),f(10," WhatsApp "),s(),l(11,"a",33),p(12,"app-svg-icon",34),f(13," Facebook "),s(),l(14,"a",35),p(15,"app-svg-icon",36),f(16," Twitter "),s(),l(17,"button",37),_("click",function(){C(t);let i=u();return b(i.copyMessage(i.item==null?null:i.item.social_url))}),p(18,"app-svg-icon",38),f(19," Copy Link "),s()(),v(20,gt,2,0,"div",39),s()()}if(r&2){let t=u();c(8),k("href","https://api.whatsapp.com/send?text="+(t.item==null?null:t.item.title)+" - "+(t.item==null?null:t.item.social_url),M),c(3),k("href","https://www.facebook.com/sharer/sharer.php?u="+(t.item==null?null:t.item.social_url),M),c(3),k("href","https://twitter.com/intent/tweet?url="+(t.item==null?null:t.item.social_url)+"&text="+(t.item==null?null:t.item.title),M),c(6),x(t.copieddone?20:-1)}}var Et=(()=>{class r{document;router;route;titleService;meta;storageService;AaroWebServices;events;cdr;platformId;itemid="";catid=0;catName="";item;arrNumbers=["\u09E7","\u09E8","\u09E9","\u09EA","\u09EB","\u09EC","\u09ED","\u09EE","\u09EF"];arrDefValues=[];grid=[];selectedCell=null;showLoader=!0;isMobile=!0;isloggedin=!0;isShareModalShow=!1;copieddone=!1;fullUrl;constructor(t,e,i,o,n,a,g,m,P,Z){this.document=t,this.router=e,this.route=i,this.titleService=o,this.meta=n,this.storageService=a,this.AaroWebServices=g,this.events=m,this.cdr=P,this.platformId=Z,w(this.platformId)&&(this.fullUrl=this.document.location.href)}ngOnInit(){this.route.paramMap.subscribe(t=>{this.itemid=t.get("itemid")||"",this.showLoader=!0,this.item=null,w(this.platformId)&&(localStorage.getItem("unifiedappkey")?(this.isloggedin=!0,this.initEmptyGrid()):(this.isloggedin=!1,this.events.publish("loginpopup:show",!0))),this.itemid&&this.AaroWebServices.getContentSummary(this.itemid).subscribe({next:e=>{this.showLoader=!1,this.item=e,this.catid=e.subSectionId,this.catName=e.subSection,this.updateMeta(),this.cdr.markForCheck(),this.events.publish("flurry:eventstart",{evntName:"story-detail",evntDetails:{subcategory:this.catName,article:this.item.title,article_id:this.item.id}});let i=this.item.description;i&&(this.arrDefValues=i.split(","),this.populateDefaultValues(this.arrDefValues)),w(this.platformId)&&this.storageService.get("sudoku-"+this.item.id).then(o=>{o&&this.paintCurrData(o)})},error:()=>{this.showLoader=!1}})})}initEmptyGrid(){this.grid=[];for(let t=0;t<9;t++){let e=[];for(let i=0;i<9;i++)e.push({row:t,col:i,val:"",locked:!1,pencil:!1,notes:[],isError:!1,isHighlight:!1,isSameValue:!1,isSuccess:!1});this.grid.push(e)}}
1populateDefaultValues(t){t.forEach(e=>{let i=e.split("-");if(i.length===2){let o=i[0],n=parseInt(i[1],10)-1,a=parseInt(o.charAt(0),10)-1,g=parseInt(o.charAt(1),10)-1;this.grid[a]&&this.grid[a][g]&&(this.grid[a][g].val=this.arrNumbers[n],this.grid[a][g].locked=!0)}})}selectCell(t){if(this.grid.forEach(e=>e.forEach(i=>{i.isHighlight=!1,i.isSameValue=!1})),this.selectedCell=null,!t.locked){this.selectedCell=t;for(let o=0;o<9;o++)this.grid[t.row][o].isHighlight=!0,this.grid[o][t.col].isHighlight=!0;let e=Math.floor(t.row/3)*3,i=Math.floor(t.col/3)*3;for(let o=e;o<e+3;o++)for(let n=i;n<i+3;n++)this.grid[o][n].isHighlight=!0}t.val!==""&&this.highlightSameValue(t.val)}selectDigit(t,e){if(!this.selectedCell||this.selectedCell.locked)return;let i=this.arrNumbers[t-1];if(!this.selectedCell.pencil)this.selectedCell.val===i?this.selectedCell.val="":(this.selectedCell.val=i,this.highlightSameValue(i)),this.validateGrid();else{let o=this.selectedCell.notes.indexOf(i);o>-1?this.selectedCell.notes.splice(o,1):this.selectedCell.notes.push(i)}e&&this.checkResult()}addNote(){this.selectedCell&&!this.selectedCell.locked&&(this.selectedCell.pencil=!this.selectedCell.pencil)}clearCell(){this.selectedCell&&!this.selectedCell.locked&&(this.selectedCell.pencil?(this.selectedCell.notes=[],this.selectedCell.pencil=!1):this.selectedCell.val="",this.validateGrid(),this.checkResult())}highlightSameValue(t){this.grid.forEach(e=>e.forEach(i=>{i.isSameValue=i.val===t}))}validateGrid(){this.grid.forEach(t=>t.forEach(e=>e.isError=!1)),this.grid.forEach(t=>t.forEach(e=>{if(e.val==="")return;for(let n=0;n<9;n++)n!==e.col&&this.grid[e.row][n].val===e.val&&(e.isError=!0,this.grid[e.row][n].isError=!0);for(let n=0;n<9;n++)n!==e.row&&this.grid[n][e.col].val===e.val&&(e.isError=!0,this.grid[n][e.col].isError=!0);let i=Math.floor(e.row/3)*3,o=Math.floor(e.col/3)*3;for(let n=i;n<i+3;n++)for(let a=o;a<o+3;a++)(n!==e.row||a!==e.col)&&this.grid[n][a].val===e.val&&(e.isError=!0,this.grid[n][a].isError=!0)}))}checkResult(){let t=!0,e=!0;for(let o=0;o<9;o++)for(let n=0;n<9;n++)if(this.grid[o][n].val===""){t=!1;break}if(t){for(let n=0;n<9;n++){let a=0,g=0;for(let m=0;m<9;m++)a+=this.getEngValue(this.grid[n][m].val),g+=this.getEngValue(this.grid[m][n].val);(a!==45||g!==45)&&(e=!1)}let o=[0,3,6];for(let n of o)for(let a of o){let g=0;for(let m=n;m<n+3;m++)for(let P=a;P<a+3;P++)g+=this.getEngValue(this.grid[m][P].val);g!==45&&(e=!1)}}else e=!1;e&&this.grid.forEach(o=>o.forEach(n=>{n.locked=!0,n.isSuccess=!0}));let i=[];for(let o=0;o<9;o++)for(let n=0;n<9;n++){let a=this.grid[o][n];i.push({x:o+1,y:n+1,value:a.val?this.getEngValue(a.val):0,locked:a.locked,note:a.notes.map(g=>this.getEngValue(g))})}this.item&&this.storageService.set("sudoku-"+this.item.id,i)}paintCurrData(t){t.forEach(e=>{let i=e.x-1,o=e.y-1;if(this.grid[i]&&this.grid[i][o]){let n=this.grid[i][o];n.locked||(e.value&&(n.val=this.arrNumbers[e.value-1]),e.note&&e.note.length>0&&(n.notes=e.note.map(a=>this.arrNumbers[a-1])))}}),this.validateGrid()}getEngValue(t){return t?this.arrNumbers.indexOf(t)+1:0}updateMeta(){this.titleService.setTitle(this.item.meta_title),this.meta.updateTag({name:"title",content:this.item.meta_title},"name='title'"),this.meta.updateTag({name:"description",content:this.item.meta_description},"name='description'"),this.meta.updateTag({property:"og:title",content:this.item.meta_title},"property='og:title'"),this.meta.updateTag({property:"og:url",content:"https://www.aaroananda.com/games/sudoku/"+this.itemid},"property='og:url'"),this.meta.updateTag({property:"og:description",content:this.item.meta_description},"property='og:description'"),this.meta.updateTag({property:"og:image",content:"https://www.aaroananda.com/cdn-cgi/image/width=1200,quality=60,format=auto/https://statics.aaroananda.com/games/sudoku_new.jpg"},"property='og:image'"),this.meta.updateTag({property:"al:ios:url",content:"aaroananda://aaroananda.com/sudoku/"+this.itemid},"property='al:ios:url'"),this.meta.updateTag({property:"al:android:url",content:"aaroananda://aaroananda.com/sudoku/"+this.itemid},"property='al:android:url'"),this.meta.updateTag({name:"twitter:url",content:"https://www.aaroananda.com/games/sudoku/"+this.itemid},"name='twitter:url'"),this.meta.updateTag({name:"twitter:app:url:iphone",content:"aaroananda://aaroananda.com/sudoku/"+this.itemid},"name='twitter:app:url:iphone'"),this.meta.updateTag({name:"twitter:app:url:ipad",content:"aaroananda://aaroananda.com/sudoku/"+this.itemid},"name='twitter:app:url:ipad'")}ionViewDidLeave(){this.item&&this.events.publish("flurry:eventend",{evntName:"story-detail",evntDetails:{subcategory:this.catName,article:this.item.title,article_id:this.item.id}})}goToHomeTab(){this.router.navigate([""])}shareItem(t){t.stopPropagation(),this.isShareModalShow=!0,w(this.platformId)&&setTimeout(()=>{let e=document.getElementsByClassName("sb-twitter")[0];e&&e.classList.add("twitterX")},100)}copyMessage(t){if(w(this.platformId)){this.copieddone=!0,setTimeout(()=>{this.copieddone=!1},5e3);let e=document.createElement("textarea");
1e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.opacity="0",e.value=t,document.body.appendChild(e),e.focus(),e.select(),document.execCommand("copy"),document.body.removeChild(e)}}static \u0275fac=function(e){return new(e||r)(h(L),h(X),h(q),h($),h(A),h(G),h(W),h(U),h(H),h(V))};static \u0275cmp=I({type:r,selectors:[["app-sudoku"]],decls:13,vars:3,consts:[[1,"aa-content"],[1,"nologgedin",3,"hidden"],[1,"sudoku-wrapper",3,"hidden"],[1,"floating-share-container"],["title","Share Content",1,"main-fab-btn",3,"click"],["name","share-social-outline",1,"icon-share"],[2,"height","100px"],[1,"custom-share-overlay"],["src","https://www.aaroananda.com/static/sudoku_new.png"],[1,"sudoku-grid"],["border","0","cellpadding","0","cellspacing","0",2,"width","100%","height","100%","table-layout","fixed","text-align","center"],[1,"sudoku-pad"],[1,"button-box"],["src","assets/images/edit.png",1,"edit",3,"click"],["src","assets/images/erase.png",1,"erase",3,"click"],[1,"word-hint-box"],[1,"inner"],[1,"hint-item",3,"src"],[3,"locked","success","current","highlight","samevalue","error","pencil"],[3,"click"],[1,"sub-grid"],[1,"sub-grid-cell"],[1,"hint-item",3,"click","src"],[1,"defer-placeholder"],[1,"custom-share-overlay",3,"click"],[1,"custom-share-modal",3,"click"],[1,"modal-header"],[2,"font-family","'GeetanjaliUniBold'","font-size","2.2rem","margin","0"],[1,"close-btn",3,"click"],["name","close-outline"],[1,"modal-body"],["target","_blank",1,"share-btn","whatsapp",3,"href"],["name","logo-whatsapp"],["target","_blank",1,"share-btn","facebook",3,"href"],["name","logo-facebook"],["target","_blank",1,"share-btn","twitter",3,"href"],["name","logo-twitter"],[1,"share-btn","copy",3,"click"],["name","copy-outline"],[1,"copy-toast"]],template:function(e,i){e&1&&(l(0,"main",0),p(1,"app-header"),v(2,it,2,1,"div",1)(3,ct,13,3,"div",2),l(4,"div",3)(5,"button",4),_("click",function(){return i.isShareModalShow=!0}),p(6,"app-svg-icon",5),s()(),p(7,"div",6),v(8,dt,1,0)(9,ut,2,0),D(10,8,tt,null,9),F(0,-1),s(),v(12,pt,21,4,"div",7)),e&2&&(c(2),x(i.isloggedin?-1:2),c(),x(i.isloggedin?3:-1),c(9),x(i.isShareModalShow?12:-1))},dependencies:[z,Q,J,K,Y],styles:["ion-navbar.toolbar[_ngcontent-%COMP%]{background:transparent}ion-navbar.toolbar[_ngcontent-%COMP%] .toolbar-background[_ngcontent-%COMP%]{background:transparent!important}.inner-content[_ngcontent-%COMP%]{max-width:1200px;margin:0 auto;height:100%}.left-icon[_ngcontent-%COMP%] .bar-button[_ngcontent-%COMP%]{width:85px;cursor:default}.button[_ngcontent-%COMP%]:hover{background:transparent!important}.nologgedin[_ngcontent-%COMP%]{display:flex;justify-content:center;max-height:55vh;opacity:.5;width:100%;align-self:flex-start}@media(min-width:550px){.nologgedin[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:350px;object-fit:contain}}.sudoku-wrapper[_ngcontent-%COMP%]{margin:4px auto;position:relative;max-width:500px}.sudoku-grid[_ngcontent-%COMP%]{height:450px;width:100%}.sudoku-grid[_ngcontent-%COMP%] > table[_ngcontent-%COMP%]{border-top:2px solid #444;border-left:2px solid #444}.sudoku-grid[_ngcontent-%COMP%] > table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:1px solid #999;font-family:SHREE;font-size:30px;vertical-align:middle}.sudoku-grid[_ngcontent-%COMP%] > table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-block}.sudoku-grid[_ngcontent-%COMP%] > table[_ngcontent-%COMP%] td.highlight[_ngcontent-%COMP%]{background-color:#dddede}.sudoku-grid[_ngcontent-%COMP%] > table[_ngcontent-%COMP%] td.locked[_ngcontent-%COMP%]{background-color:#dbecf5}.sudoku-grid[_ngcontent-%COMP%] > table[_ngcontent-%COMP%] td.samevalue[_ngcontent-%COMP%]{background-color:#a7a9a9}.sudoku-grid[_ngcontent-%COMP%] > table[_ngcontent-%COMP%] td.error[_ngcontent-%COMP%]{color:red;background-color:#f3cdb4}.sudoku-grid[_ngcontent-%COMP%] > table[_ngcontent-%COMP%] td.current[_ngcontent-%COMP%]{background-color:#b3d4f7}.sudoku-grid[_ngcontent-%COMP%] > table[_ngcontent-%COMP%] td.success[_ngcontent-%COMP%]{background-color:#a5e08b}.sudoku-grid[_ngcontent-%COMP%] > table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:nth-child(3n){border-right:2px solid #444}.sudoku-grid[_ngcontent-%COMP%] > table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(3n) td[_ngcontent-%COMP%]{border-bottom:2px solid #444}.sub-grid[_ngcontent-%COMP%]{font-size:10px;display:table;width:100%;height:100%;table-layout:fixed;border:none!important}.sub-grid[_ngcontent-%COMP%] > .sub-grid-row[_ngcontent-%COMP%]{display:table-row}.sub-grid[_ngcontent-%COMP%] > .sub-grid-row[_ngcontent-%COMP%] > .sub-grid-cell[_ngcontent-%COMP%]{height:10px;display:table-cell;vertical-align:middle;text-align:center;border-right:1px solid #bbb;border-bottom:1px solid #bbb}.sub-grid[_ngcontent-%COMP%] > .sub-grid-row[_ngcontent-%COMP%] > .sub-grid-cell[_ngcontent-%COMP%]:last-child{border-right:none}.word-hint-box[_ngcontent-%COMP%]{text-align:center;margin-top:16px;padding:0 6px}.word-hint-box[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{border-bottom:1px solid;border-top:1px solid;margin:auto;width:380px;padding:6px 0}.button-box[_ngcontent-%COMP%]{text-align:center;margin-top:16px}.button-box[_ngcontent-%COMP%] .edit[_ngcontent-%COMP%], .button-box[_ngcontent-%COMP%] .erase[_ngcontent-%COMP%]{width:50px;display:inline-block;margin:0 6px}.word-hint-box[_ngcontent-%COMP%] .hint-item[_ngcontent-%COMP%]{width:36px;display:inline-block;margin:0 6px}ion-title.nav_title_bengali[_ngcontent-%COMP%]{color:#da0202;font-family:GeetanjaliUniBold;padding-top:6px;padding-left:15px;font-size:2.3rem!important;text-align:left;position:absolute;
1left:75px;top:0;bottom:0}.sharehelp[_ngcontent-%COMP%]{margin:0 6px}.sharehelp[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:20px}button.copybtn[_ngcontent-%COMP%]{width:57px;height:35px;border-radius:3px;background:#979797;color:#fff;font-size:1.6rem}.copyclip[_ngcontent-%COMP%]{margin-top:0;display:block;position:absolute;width:100%;color:#000;font-family:SHREE;font-size:1.5rem}@media(min-width:360px){.sudoku-grid[_ngcontent-%COMP%]{height:350px}.word-hint-box[_ngcontent-%COMP%] .hint-item[_ngcontent-%COMP%]{width:26px}.word-hint-box[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{width:344px}}@media(min-width:410px){.sudoku-grid[_ngcontent-%COMP%]{height:400px}.word-hint-box[_ngcontent-%COMP%] .hint-item[_ngcontent-%COMP%]{width:30px}.word-hint-box[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{width:380px}}@media(min-width:600px){.sudoku-grid[_ngcontent-%COMP%]{height:450px}.word-hint-box[_ngcontent-%COMP%] .hint-item[_ngcontent-%COMP%]{width:36px}.word-hint-box[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{width:436px}}@media(max-width:768px){ion-title.nav_title_bengali[_ngcontent-%COMP%]{font-size:2.2rem!important;left:60px}}"]})}return r})();export{Et as SudokuPage};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.