지금 입주할 수 있는 도쿄 집이에요.
(async()=>{
if(document.getElementById('ml'))return;
const CFG={
eyebrow:'TOKYO HOMES',city:'도쿄',
photo:'https://images.unsplash.com/photo-1779275859283-4c91ebcb4130?w=2000&q=80&auto=format',
view:'40f9fba8-c844-8110-825c-000c00e34e68',
collection:'b0d9fba8-c844-8300-8594-8719257e2a23',
groups:{'23구':['지요다구','주오구','미나토구','신주쿠구','시부야구','세타가야구','메구로구','시나가와구','오타구','나카노구','스기나미구','네리마구','이타바시구','도시마구','기타구','분쿄구','다이토구','스미다구','고토구','아라카와구','아다치구','가쓰시카구','에도가와구'],'도쿄 서부(시)':['하치오지시','다치카와시','후추시','조후시','무사시노시','구니타치시','고가네이시']}
};
/* 지역 지도: 국토수치정보 N03 경계를 줄인 SVG 경로. 생성 스크립트는 블로그 임대 매물/_도구/지역지도/gen.py */
const MAP={"23구":{"w":720,"h":721,"p":{"지요다구":{"d":"M423,283L418,282L410,291L400,291L370,288L351,314L342,320L339,330L342,340L352,346L357,358L374,368L387,368L405,361L418,347L418,321L438,312L442,303L438,294L424,290Z","x":383,"y":330,"a":55},"주오구":{"d":"M387,368L394,371L396,394L407,401L412,413L423,426L454,401L456,401L455,378L451,362L453,351L460,337L461,326L458,321L455,308L442,303L438,312L418,321L418,347L405,361Z","x":426,"y":380,"a":50},"미나토구":{"d":"M397,469L396,456L389,456L386,462L385,479L393,479ZM442,466L432,461L415,473L420,481ZM342,340L332,345L318,347L318,357L312,359L297,382L305,396L324,403L322,407L326,424L313,444L319,453L331,452L332,459L340,463L341,473L354,478L365,476L372,481L379,477L382,473L383,454L389,442L399,448L399,428L400,410L407,401L396,394L394,371L387,368L374,368L357,358L352,346Z","x":363,"y":414,"a":92},"신주쿠구":{"d":"M370,288L364,275L350,273L331,273L324,265L291,262L292,249L289,239L268,241L246,238L243,229L235,224L231,238L233,247L243,261L246,270L260,267L255,291L257,297L248,314L247,322L256,339L270,327L284,321L291,324L294,333L309,341L305,350L312,359L318,357L318,347L332,345L342,340L339,330L342,320L351,314Z","x":311,"y":298,"a":87},"분쿄구":{"d":"M418,282L420,273L411,274L409,262L412,251L404,242L408,229L403,220L400,217L384,210L377,215L368,208L353,230L343,237L332,229L325,234L328,246L316,252L314,260L324,265L331,273L350,273L364,275L370,288L400,291L410,291Z","x":375,"y":248,"a":52},"다이토구":{"d":"M442,303L455,308L471,276L490,253L493,246L496,227L479,224L467,225L459,219L456,225L446,227L440,235L431,235L417,227L410,228L403,220L408,229L404,242L412,251L409,262L411,274L420,273L418,282L423,283L424,290L438,294Z","x":447,"y":261,"a":48},"스미다구":{"d":"M458,321L464,317L475,320L486,327L500,323L499,315L515,312L513,276L537,288L546,288L547,279L554,271L543,261L546,252L553,253L559,248L523,204L517,190L505,201L496,227L493,246L490,253L471,276L455,308Z","x":520,"y":245,"a":65},"고토구":{"d":"M497,552L510,542L506,537L517,530L519,523L516,519L488,538ZM510,513L497,505L474,520L459,544L461,551L513,516ZM420,481L424,488L424,492L450,533L462,514L439,479L447,473L442,466ZM555,462L549,460L527,463L530,489L537,492L546,507L553,503ZM456,401L462,409L430,434L437,442L466,423L466,428L435,447L452,471L461,465L474,484L481,474L477,462L479,449L490,448L492,439L517,436L519,433L544,430L543,453L518,456L519,460L556,455L561,399L566,400L569,358L571,345L566,340L570,324L570,307L563,296L546,288L537,288L513,276L515,312L499,315L500,323L486,327L475,320L464,317L458,321L461,326L460,337L453,351L451,362L455,378Z","x":511,"y":380,"a":165},"시나가와구":{"d":"M424,547L405,516L402,502L394,494L384,494L382,526L376,535L377,564L390,563L390,574L403,573L403,550L411,555ZM385,479L384,491L397,490L397,469L393,479ZM318,436L315,436L306,446L309,467L288,477L285,488L271,507L271,519L282,534L308,537L310,544L321,551L335,551L340,556L339,568L350,568L371,561L374,530L379,519L382,477L379,477L372,481L365,476L354,478L341,473L340,463L332,459L331,452L319,453L313,444Z","x":337,"y":512,"a":83},"메구로구":{"d":"M315,436L310,434L297,435L277,419L266,406L255,388L240,383L231,382L250,413L249,431L252,445L240,474L225,465L209,460L205,470L212,484L214,492L208,499L208,516L218,521L227,517L235,518L239,524L241,535L244,523L250,524L253,509L263,511L271,519L271,507L285,488L288,477L309,467L306,446Z","x":276,"y":455,"a":70},"오타구":{"d":"M377,564L386,589L390,593L443,592L452,585L434,570L424,547L411,555L403,550L403,573L390,574L390,563ZM271,519L263,511L253,509L250,524L244,523L241,535L242,549L232,557L220,539L206,541L201,537L193,546L195,553L192,561L208,562L219,574L233,619L243,630L259,640L275,643L286,650L287,659L277,669L276,679L287,691L301,691L314,687L331,674L348,680L357,670L372,673L391,671L413,684L430,696L441,685L446,693L466,701L495,685L479,662L448,608L419,612L405,633L395,623L384,626L379,616L391,612L374,564L371,561L350,568L339,568L340,556L335,551L321,551L310,544L308,537L282,534Z","x":282,"y":591,"a":261},"세타가야구":{"d":"M231,382L226,374L226,362L205,364L205,361L182,368L160,378L147,372L132,370L126,361L108,353L101,356L90,342L72,338L59,339L57,358L53,362L61,369L63,376L59,381L63,398L68,403L68,426L59,425L53,438L59,452L66,457L70,473L62,486L64,492L83,492L93,499L107,499L118,503L132,513L144,519L192,561L195,553L193,546L201,537L206,541L220,539L232,557L242,549L239,524L235,518L227,517L218,521L208,516L208,499L214,492L212,484L205,470L209,460L225,465L240,474L252,445L249,431L250,413Z","x":133,"y":438,"a":277},"시부야구":{"d":"M312,359L305,350L309,341L294,333L291,324L284,321L270,327L256,339L247,322L248,314L241,320L223,340L209,352L205,361L205,364L226,362L226,374L231,382L240,383L255,388L266,406L277,419L297,435L310,434L315,436L318,436L326,424L322,407L324,403L305,396L297,382Z","x":275,"y":363,"a":71},"나카노구":{"d":"M235,224L237,221L230,215L210,220L206,230L194,231L176,230L169,234L162,231L149,209L139,209L131,222L140,244L146,254L165,259L167,267L185,273L198,273L198,283L203,284L206,297L203,307L213,307L216,315L203,327L200,339L209,352L223,340L241,320L248,314L257,297L255,291L260,267L246,270L243,261L233,247L231,238Z","x":231,"y":292,"a":74},"스기나미구":{"d":"M205,361L209,352L200,339L203,327L216,315L213,307L203,307L206,297L203,284L198,283L198,273L185,273L167,267L165,259L146,254L140,244L131,222L113,222L87,232L75,243L71,251L62,246L54,251L57,266L74,282L64,307L57,310L71,322L65,326L72,338L90,342L101,356L108,353L126,361L132,370L147,372L160,378L182,368Z","x":127,"y":304,"a":160},"도시마구":{"d":"M324,265L314,260L316,252L328,246L325,234L332,229L343,237L353,230L368,208L377,215L384,210L375,201L366,199L361,192L350,197L335,187L326,198L319,194L318,186L300,184L296,194L288,205L284,205L278,192L259,195L242,201L235,224L243,229L246,238L268,241L289,239L292,249L291,262Z","x":306,"y":221,"a":62},"기타구":{"d":"M275,57L274,55L261,76L259,85L270,95L285,99L292,133L312,148L324,166L322,183L318,186L319,194L326,198L335,187L350,197L361,192L366,199L375,201L384,210L400,217L400,213L420,203L414,195L392,185L387,176L378,174L380,165L393,166L394,162L378,158L376,150L394,139L398,133L394,125L381,132L370,132L352,125L351,115L355,101L356,83L346,77L328,84L324,75L314,72L298,72L290,69Z","x":319,"y":116,"a":99},"아라카와구":{"d":"M403,220L410,228L417,227L431,235L440,235L446,227L456,225L459,219L467,225L479,224L496,227L505,201L494,196L481,201L462,196L455,187L459,173L454,168L442,164L421,165L394,162L393,166L380,165L378,174L387,176L392,185L414,195L420,203L400,213L400,217Z","x":441,"y":206,"a":48},"이타바시구":{"d":"M174,58L163,58L161,70L151,76L146,86L138,90L132,102L141,109L143,120L151,126L163,128L168,123L177,129L184,127L203,129L219,134L222,145L228,154L231,169L225,185L242,189L242,201L259,195L278,192L284,205L288,205L296,194L300,184L318,186L322,183L324,166L312,148L292,133L285,99L270,95L259,85L261,76L274,55L256,51L237,56L220,52L188,52Z","x":219,"y":93,"a":152},"네리마구":{"d":"M72,104L61,105L52,114L48,123L40,123L33,135L24,137L10,146L20,162L22,169L18,180L21,191L19,207L23,212L16,229L16,242L32,248L48,261L57,266L54,251L62,246L71,251L75,243L87,232L113,222L131,222L139,209L149,209L162,231L169,234L176,230L194,231L206,230L210,220L230,215L237,221L242,201L242,189L225,185L231,169L228,154L222,145L219,134L203,129L184,127L177,129L168,123L163,128L151,126L143,120L141,109L132,102L128,133L118,134L117,125L89,123L92,113L77,110L78,105Z","x":80,"y":176,"a":231},"아다치구":{"d":"M355,101L351,115L352,125L370,132L381,132L394,125L398,133L394,139L376,150L378,158L394,162L421,165L442,164L454,168L459,173L455,187L462,196L481,201L494,196L505,201L517,190L503,163L503,150L515,149L516,159L523,160L537,152L540,140L550,142L551,136L558,134L567,127L577,126L579,136L588,139L592,131L590,123L574,102L566,83L564,68L568,61L562,53L551,51L541,63L528,69L517,59L517,39L526,24L518,16L515,24L503,33L481,32L474,38L462,40L436,33L421,12L413,10L400,22L380,28L379,37L389,45L399,59L398,67L389,77L388,85L376,87L364,97Z","x":453,"y":101,"a":253},"가쓰시카구":{"d":"M568,61L564,68L566,83L574,102L590,123L592,131L588,139L579,136L577,126L567,127L558,134L551,136L550,142L540,140L537,152L523,160L516,159L515,149L503,150L503,163L523,204L535,219L577,269L587,260L599,264L611,260L607,250L622,206L634,198L639,175L653,172L640,153L639,145L633,131L639,117L660,105L661,95L648,92L628,98L623,97L617,88L617,82L627,68L623,61L616,59L602,65L592,66L588,75L580,72Z","x":574,"y":190,"a":164},"에도가와구":{"d":"M654,173L653,172L639,175L634,198L622,206L607,250L611,260L599,264L587,260L577,269L559,248L553,253L546,252L543,261L554,271L547,279L546,288L563,296L570,307L570,324L566,340L571,345L569,358L566,400L576,400L574,433L591,442L598,444L622,440L641,428L648,401L648,370L646,365L645,356L649,343L660,338L681,336L690,330L700,317L710,300L705,276L689,261L681,247L671,238L668,230L669,218L675,204L672,187Z","x":618,"y":308,"a":231}}},"도쿄 서부(시)":{"w":720,"h":676,"p":{"하치오지시":{"d":"M307,268L302,274L295,262L289,257L284,266L273,265L265,269L253,272L251,268L225,267L221,265L212,274L200,273L196,270L187,270L178,272L170,267L164,268L158,264L136,261L134,258L123,267L118,269L114,279L115,294L108,295L106,315L97,314L94,316L83,314L64,314L62,330L56,340L54,348L49,353L57,365L61,384L70,387L76,395L83,396L94,392L96,386L104,381L115,384L125,388L131,395L129,403L131,411L140,425L138,433L146,436L151,443L153,453L165,463L166,468L179,471L187,477L195,473L206,476L208,467L212,463L212,458L223,452L225,446L238,442L250,442L250,446L257,450L265,452L271,450L281,453L307,452L323,455L332,464L354,470L360,464L372,473L384,477L391,483L394,476L393,472L403,465L413,453L419,442L442,427L450,425L457,417L453,409L447,403L439,400L435,392L426,397L422,396L411,403L400,406L398,404L385,403L379,398L365,397L359,394L348,379L349,369L370,357L367,352L371,343L376,337L374,320L380,315L376,309L363,308L356,305L331,308L321,305L315,300L316,290L310,283L307,275L309,269Z","x":212,"y":359,"a":532},"다치카와시":{"d":"M434,231L405,230L389,215L389,222L379,227L360,220L351,219L350,223L340,225L341,241L344,246L354,244L366,247L382,245L404,271L410,272L404,281L401,295L397,295L395,306L389,309L439,325L445,314L450,318L455,310L460,311L460,299L454,296L451,289L458,286L466,286L455,260L463,258L468,265L476,263L479,269L482,250L466,247L463,242L452,236Z","x":429,"y":256,"a":69},"무사시노시":{"d":"M697,271L677,257L665,252L652,252L640,261L621,272L609,269L610,260L605,261L603,269L606,274L614,276L614,288L620,302L629,299L642,302L641,280L672,295L681,290L686,295L694,298L697,304L702,303L710,283Z","x":662,"y":270,"a":31},"미타카시":{"d":"M708,327L703,317L708,314L697,304L694,298L686,295L681,290L672,295L641,280L642,302L629,299L620,302L616,295L617,303L612,303L608,311L602,315L606,323L603,329L605,336L609,342L612,354L622,355L628,360L632,356L628,349L630,330L634,327L644,329L657,325L665,360L676,360L680,368L686,358L684,349L696,348L700,350L693,345L697,342L698,327Z","x":679,"y":318,"a":48},"오메시":{"d":"M52,10L50,12L56,25L64,30L75,48L70,55L73,68L68,81L70,93L64,99L54,102L48,107L31,112L26,118L28,139L20,141L12,147L12,157L20,150L29,152L30,145L38,156L43,155L44,147L51,146L57,141L65,139L70,134L80,129L90,126L105,131L106,135L117,146L123,156L139,154L166,167L176,167L185,169L194,179L201,181L223,177L241,179L245,180L254,191L256,180L255,169L248,152L257,141L265,146L278,151L288,146L292,148L297,141L291,137L291,127L300,130L306,123L306,117L299,114L294,106L285,82L283,79L284,61L277,58L270,62L264,60L262,40L254,40L246,34L234,36L232,31L217,31L200,38L187,34L172,36L170,30L164,30L157,37L137,26L127,18L119,18L112,28L96,30L68,15Z","x":196,"y":105,"a":295},"후추시":{"d":"M510,298L504,293L503,307L498,309L494,316L490,329L490,346L484,343L476,345L460,344L458,348L476,372L525,388L525,385L544,382L564,384L569,387L583,385L596,394L596,380L591,375L605,345L602,331L596,327L598,317L592,309L587,313L585,320L564,317L548,310L549,302L544,308L530,313L516,315L513,309L514,302Z","x":542,"y":346,"a":85},"아키시마시":{"d":"M376,309L389,309L395,306L397,295L401,295L404,281L410,272L404,271L382,245L366,247L354,244L344,246L340,250L330,254L323,253L319,257L319,263L309,269L307,275L310,283L316,290L315,300L321,305L331,308L356,305L363,308Z","x":371,"y":278,"a":50},"조후시":{"d":"M700,350L696,348L684,349L686,358L680,368L676,360L665,360L657,325L644,329L634,327L630,330L628,349L632,356L628,360L622,355L612,354L609,342L605,336L603,329L606,323L598,317L596,327L602,331L605,345L591,375L596,380L596,394L603,401L612,402L619,407L637,412L640,416L654,417L659,419L661,403L666,391L678,385L687,392L692,390L698,394L705,394L705,377L701,373L698,360L702,356Z","x":640,"y":384,"a":61},"마치다시":{"d":"M212,463L229,459L234,456L248,458L255,463L259,469L267,472L281,472L291,468L305,474L317,472L346,482L353,482L371,490L377,496L390,503L395,502L399,508L411,509L414,523L417,526L426,527L433,544L440,552L446,557L449,563L456,574L481,591L486,602L501,616L496,626L497,630L509,635L511,648L516,657L515,664L529,666L541,661L536,658L529,647L539,632L544,630L546,616L543,609L544,602L537,593L535,587L538,579L537,564L534,557L519,555L516,549L519,537L524,530L524,524L528,517L537,515L542,509L549,511L538,534L544,539L551,553L559,547L565,536L575,534L575,526L573,528L563,516L555,513L556,506L537,489L533,489L529,481L521,479L519,474L509,463L500,467L493,467L487,459L482,464L470,463L464,470L455,466L447,468L443,462L436,458L424,458L417,463L410,461L393,472L394,476L391,483L384,477L372,473L360,464L354,470L332,464L323,455L307,452L281,453L271,450L265,452L257,450L250,446L250,442L238,442L225,446L223,452L212,458Z","x":475,"y":520,"a":204},"고가네이시":{"d":"M605,261L600,257L578,262L576,270L558,268L558,275L552,278L543,277L545,281L541,289L551,293L548,310L564,317L585,320L587,313L592,309L606,323L602,315L608,311L612,303L617,303L616,295L614,288L614,276L606,274L603,269Z","x":575,"y":293,"a":32},"고다이라시":{"d":"M482,250L500,254L502,259L522,264L522,272L532,277L534,266L543,277L552,278L558,275L558,268L576,270L578,262L600,257L600,249L591,242L590,236L595,230L597,220L577,221L572,224L570,213L562,210L551,215L549,210L543,211L544,218L544,228L532,227L530,218L513,210L482,227L477,225L456,237L452,236L463,242L466,247Z","x":559,"y":245,"a":58},"히노시":{"d":"M435,392L438,389L453,398L463,390L470,387L472,373L476,372L474,368L446,332L439,325L405,313L389,309L376,309L380,315L374,320L376,337L371,343L367,352L370,357L349,369L348,379L359,394L365,397L379,398L385,403L398,404L400,406L411,403L422,396L426,397Z","x":409,"y":358,"a":78},"히가시무라야마시":{"d":"M474,167L474,180L479,188L483,189L485,201L490,206L490,224L513,210L530,218L532,227L544,228L544,218L543,211L548,198L555,192L557,184L572,178L560,176L566,170L563,159L561,158L560,145L555,140L549,145L542,141L533,143L521,155L519,154L505,155L501,162L490,163L481,168Z","x":523,"y":184,"a":49},"고쿠분지시":{"d":"M458,286L461,290L486,291L503,307L504,293L514,302L513,309L516,315L530,313L544,308L549,302L551,293L541,289L545,281L534,266L532,277L522,272L522,264L502,259L500,254L482,250L479,269L476,263L468,265L463,258L455,260L466,286Z","x":496,"y":276,"a":33},"구니타치시":{"d":"M439,325L446,332L458,348L460,344L476,345L484,343L490,346L490,329L494,316L498,309L503,307L486,291L461,290L458,286L451,289L454,296L460,299L460,311L455,310L450,318L445,314Z","x":471,"y":326,"a":23},"훗사시":{"d":"M309,269L319,263L319,257L323,253L330,254L340,250L344,246L341,241L340,225L350,223L351,219L343,213L343,207L339,216L325,200L293,192L292,199L281,205L285,212L290,231L303,241L303,249L307,268Z","x":314,"y":221,"a":29},"고마에시":{"d":"M698,394L692,390L687,392L678,385L666,391L661,403L659,419L673,435L682,440L696,442L702,446L701,441L707,431L704,419L698,415L693,404Z","x":678,"y":414,"a":18},"히가시야마토시":{"d":"M399,174L420,177L426,184L423,195L423,202L428,204L429,223L434,231L456,237L477,225L482,227L490,224L490,206L485,201L483,189L479,188L474,180L474,167L470,166L460,169L446,166L442,169L420,163L413,166L410,172Z","x":456,"y":204,"a":38},"기요세시":{"d":"M560,145L561,158L563,159L566,170L560,176L572,178L589,170L600,158L614,155L630,143L631,128L622,123L632,112L636,100L632,93L628,92L621,98L609,116L595,127L586,127L583,133L575,138L564,139Z","x":581,"y":155,"a":29},"히가시쿠루메시":{"d":"M589,170L557,184L555,192L548,198L543,211L549,210L551,215L562,210L570,213L572,224L577,221L597,220L595,230L612,217L606,211L616,209L632,190L636,180L637,154L611,165L597,166Z","x":588,"y":196,"a":37},"무사시무라야마시":{"d":"M380,159L373,164L364,160L362,166L347,189L348,198L343,207L343,213L351,219L360,220L379,227L389,222L389,215L405,230L434,231L429,223L428,204L423,202L423,195L426,184L420,177L399,174L396,167L389,171L382,169Z","x":375,"y":193,"a":43},"다마시":{"d":"M403,465L410,461L417,463L424,458L436,458L443,462L447,468L455,466L464,470L470,463L482,464L492,451L510,435L510,425L521,417L517,405L517,397L525,393L525,388L476,372L472,373L470,387L463,390L453,398L438,389L435,392L439,400L447,403L453,409L457,417L450,425L442,427L419,442L413,453Z","x":485,"y":411,"a":59},"이나기시":{"d":"M525,388L525,393L517,397L517,405L521,417L510,425L510,435L516,442L528,445L529,452L536,462L544,465L548,472L555,470L561,471L565,467L558,457L557,448L570,438L587,434L591,423L600,420L597,412L603,401L583,385L569,387L564,384L544,382L525,385Z","x":552,"y":413,"a":51},"하무라시":{"d":"M254,191L264,189L277,198L281,205L292,199L293,192L325,200L325,193L319,191L314,182L311,160L304,159L288,146L278,151L265,146L257,141L248,152L255,169L256,180Z","x":281,"y":174,"a":28},"아키루노시":{"d":"M307,268L303,249L303,241L290,231L285,212L277,198L264,189L254,191L245,180L241,179L223,177L201,181L194,179L192,182L202,189L214,193L222,192L230,204L228,214L233,217L236,233L226,230L203,232L195,227L177,224L175,220L167,218L157,220L147,218L136,210L131,210L124,196L115,192L110,185L91,176L79,175L78,164L51,146L44,147L43,155L38,156L30,145L29,152L20,150L10,161L21,169L27,176L19,181L17,189L30,191L37,199L41,209L53,215L55,225L53,232L56,238L55,251L56,267L55,281L65,290L66,299L64,314L83,314L94,316L97,314L106,315L108,295L115,294L114,279L118,269L123,267L134,258L136,261L158,264L164,268L170,267L178,272L187,270L196,270L200,273L212,274L221,265L225,267L251,268L253,272L265,269L273,265L284,266L289,257L295,262L302,274Z","x":99,"y":235,"a":209},"니시토쿄시":{"d":"M632,190L616,209L606,211L612,217L590,236L591,242L600,249L600,257L605,261L610,260L609,269L621,272L640,261L652,252L665,252L665,242L670,229L667,225L668,213L666,204L670,196L660,177L636,193Z","x":638,"y":227,"a":45}}}};
const KAKAO='https://ashitamo.s.gy/listing';
const API='https://oopy.lazyrockets.com/api/v2/notion/';
const pageId=location.pathname.split('/').pop();
const $=(s,e=document)=>e.querySelector(s),$$=(s,e=document)=>[...e.querySelectorAll(s)];
const esc=s=>String(s==null?'':s).replace(/[&<>"]/g,c=>({'&':'&','<':'<','>':'>','"':'"'}[c]));
const yen=n=>Number(n).toLocaleString('ko-KR')+'엔';
const code=$('.notion-code-block'),gal=$('.notion-collection_view-block'),host=$('.notion-page-content');
if(!host)return;
const hideEls=[code,gal,...$$('.notion-text-block',host)].filter(Boolean);
hideEls.forEach(e=>e.style.display='none');
const pageTitle=$$('h1,[class*=title]').find(e=>e.textContent.trim()==document.title.trim()&&!e.closest('.notion-topbar'));
if(pageTitle)pageTitle.style.display='none';
const css=`
#ml{--w:min(1080px,calc(100vw - 32px));--ink:#242222;--mut:#77726e;--line:#e8e6e2;--soft:#f6f5f2;--g:#1f9d55;width:var(--w);margin-top:-40px;margin-bottom:56px;color:var(--ink);font-family:inherit;letter-spacing:-.01em}
#ml *{box-sizing:border-box}
#ml a{text-decoration:none;color:inherit}
.ml-hero{position:relative;height:320px;border-radius:20px;overflow:hidden;background:#111 center/cover;display:flex;flex-direction:column;justify-content:flex-end;padding:34px 38px;color:#fff}
.ml-hero:before{content:"";position:absolute;inset:0;background:linear-gradient(#0003,#0000 35%,#000b)}
.ml-hero>*{position:relative}
.ml-eb{font:700 12px Arial;letter-spacing:4px;color:#fff}
.ml-hero h2{margin:10px 0 6px;font-size:40px;line-height:1.2;font-weight:800;color:#fff}
.ml-hero p{margin:0;font-size:15px;opacity:.88}
.ml-f{margin-top:18px;border:1px solid var(--line);border-radius:18px;padding:8px 26px;background:#fff}
.ml-row{display:grid;grid-template-columns:92px 1fr;gap:14px;padding:14px 0;border-top:1px solid var(--line)}
.ml-f>.ml-row:first-child,.ml-f>details:first-child{border-top:0}
.ml-lb{padding-top:7px;font-size:14px;font-weight:700}
.ml-ch{display:flex;flex-wrap:wrap;gap:6px}
.ml-ch button{height:34px;padding:0 13px;border:1px solid var(--line);border-radius:99px;background:#fff;font-family:inherit;font-size:14px;font-weight:600;color:var(--ink);cursor:pointer;transition:.15s;white-space:nowrap}
.ml-ch button em{margin-left:5px;font-style:normal;font-size:12px;font-weight:500;color:#a5a19b}
.ml-ch button:hover:not(:disabled){border-color:var(--ink)}
.ml-ch button[aria-pressed=true]{background:var(--ink);border-color:var(--ink);color:#fff}
.ml-ch button[aria-pressed=true] em{color:#ffffffa8}
.ml-ch button:disabled{opacity:.38;cursor:default}
.ml-ck button{border-radius:8px;padding:0 11px 0 8px}
.ml-ck button:before{content:"";display:inline-block;width:14px;height:14px;margin-right:6px;border:1.5px solid #c9c5bf;border-radius:4px;vertical-align:-2px}
.ml-ck button[aria-pressed=true]:before{content:"✓";border-color:#fff;color:#fff;font-size:11px;line-height:12px;text-align:center}
.ml-sub{margin:10px 0 6px;font-size:12px;font-weight:700;color:var(--mut)}
.ml-sub:first-child{margin-top:7px}
.ml-hint{margin:7px 0 0;font-size:12px;color:var(--mut)}
#ml details>summary{display:flex;align-items:center;gap:10px;padding:14px 0;font-size:14px;font-weight:700;cursor:pointer;list-style:none}
#ml details>summary::-webkit-details-marker{display:none}
#ml details>summary:after{content:"+";margin-left:auto;color:var(--mut)}
#ml details[open]>summary:after{content:"-"}
#ml details>summary b{font-weight:600;color:var(--g)}
.ml-more2{border-top:1px solid var(--line)}
.ml-more2 .ml-row:first-of-type{border-top:0;padding-top:2px}
.ml-rgn{padding-bottom:14px}
.ml-sel{display:flex;flex-wrap:wrap;gap:6px;margin:14px 2px 0}
.ml-sel:empty{display:none}
.ml-sel button{height:28px;padding:0 10px;border:0;border-radius:8px;background:#e4f6ea;color:#17803f;font-family:inherit;font-size:13px;font-weight:600;cursor:pointer}
.ml-s{height:36px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:#fff;font-family:inherit;font-size:14px;font-weight:600;color:var(--ink);cursor:pointer}
.ml-bar{display:flex;align-items:center;gap:12px;margin:22px 2px 8px}
.ml-bar strong{font-size:18px;font-weight:800;white-space:nowrap}
.ml-bar strong span{color:var(--g)}
.ml-rs{flex:none;white-space:nowrap;border:0;background:none;color:var(--mut);font-family:inherit;font-size:13px;font-weight:600;text-decoration:underline;cursor:pointer}
.ml-bar .ml-s{min-width:0;margin-left:auto}
.ml-r{display:grid;grid-template-columns:230px 1fr 220px;gap:26px;align-items:center;padding:20px 0;border-top:1px solid var(--line)}
.ml-ph{position:relative;aspect-ratio:4/3;border-radius:12px;overflow:hidden;background:var(--soft);display:grid;place-items:center;color:#b5b1ab;font-size:12px}
.ml-ph:empty{background:linear-gradient(100deg,#f6f5f2 30%,#eceae5 50%,#f6f5f2 70%) 0 0/200% 100%;animation:ml-sh 1.4s linear infinite}
@keyframes ml-sh{to{background-position:-200% 0}}
.ml-ph img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .5s,transform .7s}
.ml-ph img.on{opacity:1}
.ml-r:hover .ml-ph img{transform:scale(1.05)}
.ml-r:hover h3{color:var(--g)}
.ml-loc{display:flex;align-items:center;gap:7px;font-size:14px;font-weight:700;color:var(--g)}
.ml-ty{padding:2px 8px;border-radius:6px;background:var(--ink);color:#fff;font-size:12px;font-weight:700}
.ml-r h3{margin:6px 0 6px;font-size:20px;line-height:1.3;font-weight:800;transition:.15s;color:var(--ink)}
.ml-st{margin:0 0 10px;font-size:14px;color:var(--mut)}
.ml-sp{display:flex;flex-wrap:wrap;gap:0 13px;font-size:13px;color:var(--ink)}
.ml-sp span+span{position:relative}
.ml-sp span+span:before{content:"";position:absolute;left:-7px;top:50%;width:1px;height:10px;margin-top:-5px;background:#d6d3ce}
.ml-no{margin-top:9px;font:600 11px Arial;letter-spacing:1px;color:#aaa6a0}
.ml-dl{margin:0;font-size:13px;color:var(--mut)}
.ml-dl div{display:flex;justify-content:space-between;padding:1px 0}
.ml-dl dt,.ml-dl dd{margin:0}
.ml-tot{display:flex;justify-content:space-between;align-items:baseline;margin-top:6px;padding-top:6px;border-top:1px solid var(--line)}
.ml-tot small{font-size:13px;font-weight:700}
.ml-tot b{font-size:25px;font-weight:800;white-space:nowrap}
.ml-nt{margin-top:2px;text-align:right;font-size:11px;color:var(--mut)}
.ml-tg{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:4px;margin-top:8px}
.ml-tg span{padding:3px 9px;border-radius:99px;background:var(--soft);font-size:12px;font-weight:600;white-space:nowrap}
.ml-tg .z{background:#e4f6ea;color:#17803f}
.ml-more{display:block;width:100%;height:52px;margin-top:6px;border:1px solid var(--ink);border-radius:12px;background:#fff;font-family:inherit;font-size:15px;font-weight:700;color:var(--ink);cursor:pointer;transition:.15s}
.ml-more:hover{background:var(--ink);color:#fff}
.ml-em{padding:60px 0;border-top:1px solid var(--line);text-align:center;color:var(--mut)}.ml-q{margin:18px 0 6px}.ml-q input{width:100%;height:52px;padding:0 18px 0 46px;border:1.5px solid var(--line);border-radius:14px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%2377726e' stroke-width='2'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='m14 14 4 4'/%3E%3C/svg%3E") 16px 50%/20px no-repeat;font-family:inherit;font-size:16px;color:var(--ink);outline:none;transition:border-color .15s}.ml-q input:focus{border-color:var(--g)}
.ml-top{display:flex;flex-wrap:wrap;align-items:center;gap:10px 22px;margin-bottom:16px;padding-bottom:14px;border-bottom:1px solid var(--line)}.ml-top b{font:800 15px Arial;letter-spacing:3px}.ml-top span{display:flex;flex-wrap:wrap;gap:4px 18px;flex:1 1 auto;font-size:14px;font-weight:600;color:var(--mut)}#ml .ml-top span a:hover{color:var(--ink)}#ml .ml-top .k{padding:9px 16px;border-radius:99px;background:#fee500;color:#191919;font-size:14px;font-weight:800}.ml-nb{display:block;margin-top:14px;padding:16px 18px;border-radius:14px;background:var(--soft)}.ml-nb small{display:block;font:700 11px Arial;letter-spacing:2px;color:var(--g)}.ml-nb b{display:block;margin:5px 0 4px;font-size:15px}.ml-nb span{font-size:13px;font-weight:700;text-decoration:underline}.ml-ev{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);margin:16px 0;border-radius:16px;overflow:hidden;background:#2d2824;color:#fff}#ml .ml-ev{color:#fff}.ml-ev img{display:block;width:100%;height:100%;min-height:170px;object-fit:cover}.ml-ev div{display:flex;flex-direction:column;justify-content:center;gap:8px;padding:24px 26px}.ml-ev small{font:700 11px Arial;letter-spacing:3px;color:#f5d9a8}.ml-ev b{font-size:21px;font-weight:800}.ml-ev p{margin:0;font-size:14px;opacity:.85}.ml-ev span{font-size:13px;font-weight:700;text-decoration:underline}.ml-ct{margin-top:44px}.ml-ct>small{font:700 11px Arial;letter-spacing:3px;color:var(--g)}.ml-ct h3{margin:6px 0 14px;font-size:24px;font-weight:800}.ml-ct>div{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.ml-ct>div a{display:flex;flex-direction:column;gap:3px}.ml-ct i{display:block;aspect-ratio:4/5;border-radius:14px;background:#eee center/cover;margin-bottom:6px;transition:transform .3s}.ml-ct>div a:hover i{transform:scale(1.03)}.ml-ct b{font-size:15px;font-weight:800}.ml-ct span{font-size:12px;color:var(--mut)}#ml .ml-cta2{display:inline-block;margin-top:14px;font-size:14px;font-weight:700;text-decoration:underline}.ml-fw{margin-top:44px}.ml-fw>small{font:700 11px Arial;letter-spacing:3px;color:var(--g)}.ml-fw h3{margin:6px 0 14px;font-size:24px;font-weight:800}.ml-fw>div{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.ml-fw>div a{padding:20px 8px;text-align:center;border-right:1px solid var(--line)}.ml-fw>div a:last-child{border-right:0}.ml-fw a b{display:block;font-size:14px}.ml-fw a span{font-size:12px;color:var(--mut)}.ml-fw p{margin:28px 0 0;text-align:center;font-weight:800}.ml-fw p small{display:block;margin-top:4px;font:600 11px Arial;letter-spacing:3px;color:var(--mut)}.ml-cta{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:30px;padding:24px 28px;border-radius:18px;background:var(--ink);color:#fff}
.ml-cta p{margin:0;font-size:17px;font-weight:700}
.ml-cta small{display:block;margin-top:3px;font-size:13px;font-weight:400;opacity:.7}
#ml .ml-cta a{flex:none;padding:11px 18px;border-radius:99px;background:#fee500;color:#191919;font-size:14px;font-weight:800}
.ml-ca{display:flex;flex-wrap:wrap;gap:8px}
#ml .ml-cta a.l{background:#fff}
.ml-mp{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);gap:22px;align-items:start}
.ml-mp>div{min-width:0}
.ml-mtab{display:flex;gap:4px;padding:4px;border-radius:12px;background:var(--soft);width:max-content;max-width:100%}
.ml-mtab button{height:34px;padding:0 14px;border:0;border-radius:9px;background:none;font-family:inherit;font-size:14px;font-weight:700;color:var(--mut);cursor:pointer}
.ml-mtab button[aria-selected=true]{background:#fff;color:var(--ink);box-shadow:0 1px 3px #0000001f}
.ml-mtab button i{margin-left:5px;font-style:normal;font-size:12px;color:var(--g)}
.ml-mbox{position:relative;margin-top:12px;border-radius:16px;background:linear-gradient(180deg,#f4f2ee,#efede8);overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
.ml-mbox svg{display:block;width:100%;min-width:520px;height:auto;padding:14px 12px 8px;user-select:none;-webkit-tap-highlight-color:transparent}
.ml-mbox svg[hidden]{display:none}
.ml-mside{padding-top:4px}
.ml-mside h4{margin:0 0 6px;font-size:16px;font-weight:800;color:var(--ink)}
.ml-mside p{margin:0 0 14px;font-size:13px;line-height:1.6;color:var(--mut)}
.ml-lgd{display:flex;flex-wrap:wrap;gap:14px;margin:0 0 16px;font-size:12px;color:var(--mut)}
.ml-lgd span{display:flex;align-items:center;gap:6px}
.ml-lgd i{width:18px;height:12px;border-radius:3px}
.ml-lgd .u{background:#fff;box-shadow:0 3px 0 #cfc9c0,0 0 0 1px #e2ded7}
.ml-lgd .d{background:var(--g);box-shadow:inset 0 2px 3px #0006}
.ml-lgd .o{background:#e6e3de}
.ml-mside details{border-top:1px solid var(--line)}
.ml-mbox .s{fill:#cdc6bb;stroke:#cdc6bb;stroke-width:1}
.ml-mbox .t{fill:#fff;stroke:#e3dfd8;stroke-width:1.3;stroke-linejoin:round;cursor:pointer;transition:fill .15s}
.ml-mbox .t.off{fill:#e6e3de;stroke:#dad6cf;cursor:default}
.ml-mbox .t.on{fill:var(--g);stroke:#178548;filter:url(#ml-ins)}
.ml-mbox .t.up:hover,.ml-mbox .t.up:focus-visible{fill:#effaf3;outline:none}
.ml-mbox .t.up:focus-visible{stroke:var(--g);stroke-width:2.5}
.ml-mbox .l{pointer-events:none;text-anchor:middle;font-family:inherit;transition:transform .18s}
.ml-mbox .l .n{font-size:14px;font-weight:700;fill:var(--ink)}
.ml-mbox .l .c{font-size:12px;font-weight:600;fill:var(--g)}
.ml-mbox .l.off .n{font-size:12px;font-weight:500;fill:#aaa49c}
.ml-mbox .l.on{transform:translateY(6px)}
.ml-mbox .l.on .n,.ml-mbox .l.on .c{fill:#fff}
.ml-mbox .l.up{transform:translateY(-1px)}
.ml-mbox .src{font-size:10px;fill:#b3ada5}
@media(prefers-reduced-motion:reduce){.ml-mbox .l{transition:none}}
@media(max-width:760px){
.ml-mp{grid-template-columns:1fr;gap:14px}.ml-mside h4,.ml-mside p,.ml-lgd{display:none}
.ml-hero{height:210px;padding:22px}.ml-hero h2{font-size:28px}.ml-hero p{font-size:13px}
.ml-f{padding:4px 16px}
.ml-row{grid-template-columns:1fr;gap:6px}.ml-lb{padding-top:0}
.ml-ch button{height:32px;padding:0 10px;font-size:13px}
.ml-r{grid-template-columns:112px 1fr;gap:8px 14px;align-items:start;padding:16px 0}
.ml-ph{aspect-ratio:1}.ml-r h3{font-size:16px;margin:4px 0}.ml-st{font-size:12px;margin:0 0 4px}
.ml-sp{font-size:12px;gap:0 11px}.ml-no{display:none}
.ml-pr{grid-column:1/-1}
.ml-dl{display:flex;gap:12px}.ml-dl div{gap:4px}
.ml-tot b{font-size:22px}.ml-nt{text-align:left}.ml-tg{justify-content:flex-start}
.ml-cta{flex-direction:column;align-items:flex-start;padding:20px}.ml-top{gap:8px 14px}.ml-top span{order:3;flex-basis:100%;gap:4px 14px;font-size:13px}#ml .ml-top .k{margin-left:auto;padding:7px 12px;font-size:13px}.ml-ct>div{grid-template-columns:repeat(5,42%);overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:6px}.ml-ct>div a{scroll-snap-align:start}.ml-ev{grid-template-columns:1fr}.ml-ev img{min-height:0;height:150px}.ml-ev div{padding:18px 20px}.ml-fw>div{grid-template-columns:repeat(2,minmax(0,1fr))}.ml-fw>div a:nth-child(2){border-right:0}.ml-fw>div a:nth-child(-n+2){border-bottom:1px solid var(--line)}
.ml-bar{gap:8px}.ml-bar strong{font-size:16px}.ml-bar .ml-s{width:118px;padding:0 6px;font-size:13px}
}`;
const root=document.createElement('div');root.id='ml';
root.innerHTML=`<style>${css}</style>
<div class="ml-hero" style="background-image:url('${CFG.photo}')"><span class="ml-eb">${CFG.eyebrow}</span><h2>내일도 살고 싶은<br>${CFG.city} 집 찾기</h2><p>매물을 불러오고 있어요…</p></div>`;
host.prepend(root);
const fail=()=>{root.remove();hideEls.forEach(e=>{if(e!==code)e.style.setProperty('display','block','important')});if(pageTitle)pageTitle.style.setProperty('display','block','important')};
const all=Object.values(CFG.groups).flat();
const f=(p,o,v)=>({property:p,filter:v===undefined?{operator:o}:{operator:o,value:{type:'exact',value:v}}});
const body={collectionId:CFG.collection,collectionViewId:CFG.view,loader:{type:'reducer',reducers:{collection_group_results:{type:'results',limit:1000}},searchQuery:'',userTimeZone:'Asia/Seoul',
sort:[{property:'>tjz',direction:'ascending'},{property:'?V}V',direction:'ascending'}],
filter:{operator:'and',filters:[f('d}_^','enum_is','모집중'),f('>tjz','is_not_empty'),{operator:'or',filters:all.map(g=>f('=yCN','enum_is',g))}]}}};
const unwrap=o=>o&&((o.value&&o.value.value)||o.value);
const now=new Date(),today=now.toISOString().slice(0,10),thisYear=now.getFullYear();
const TYPE={'원룸':'1R'};
const num=s=>s?+s.replace(/,/g,''):null;
/* 매물 데이터: 30분 안에 받은 목록이 있으면 바로 보여 주고, 뒤에서 새로 받아 다음 방문용으로 저장한다 */
const CK='ml-items-'+pageId;
const load=async()=>{
let J;
try{
const res=await fetch(API+'queryCollection?src=reset&pageId='+pageId,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(body)});
J=await res.json();
}catch(e){return null}
const blk=J&&J.recordMap&&J.recordMap.block;
const ids=J&&J.result&&J.result.reducerResults.collection_group_results.blockIds;
if(!blk||!ids||!ids.length)return null;
const schema=unwrap(Object.values(J.recordMap.collection)[0]).schema,K={};
for(const k in schema)K[schema[k].name]=k;
const val=(r,n)=>{const v=(r.properties||{})[K[n]];return v?v.map(x=>x[0]).join(''):''};
const it=ids.map(id=>{
const r=unwrap(blk[id]);if(!r)return null;
const d=(r.properties||{})[K['입주 가능 날짜']];
const date=d&&d[0]&&d[0][1]&&d[0][1][0]&&d[0][1][0][1]&&d[0][1][0][1].start_date||'';
const t=val(r,'형태'),price=+val(r,'월 총액(엔)')||0;
const pm=val(r,'월세 관리비'),rent=num((pm.match(/월세\s*([\d,]+)/)||[])[1]);
let fee=num((pm.match(/(?:관리비|공익비)\s*([\d,]+)/)||[])[1]);
if(rent!=null&&fee==null&&rent==price)fee=0;
const note=(pm.match(/\(([^)]*별도[^)]*)\)/)||[])[1]||'';
const sta=val(r,'주변 역');
const walks=[...sta.matchAll(/(?:徒歩|도보)\s*(\d+)/g)].map(m=>+m[1]);
const year=+(val(r,'완공').match(/\d{4}/)||[])[0]||0;
const fac=val(r,'내부시설').split(',').map(x=>x.trim()).filter(Boolean);
return{id,content:r.content||[],title:(r.properties.title||[]).map(x=>x[0]).join(''),gu:val(r,'지역'),type:TYPE[t]||t,price,rent,fee,note,
size:val(r,'크기(㎡)'),floor:+(val(r,'층수').match(/\d+/)||[])[0]||0,floorText:val(r,'층수'),year,age:year?thisYear-year:null,
st:val(r,'구조'),siki:val(r,'시키킹(敷金)'),rei:val(r,'레이킹(礼金)'),when:val(r,'입주시기'),date,no:val(r,'매물번호 1'),fac,
walk:walks.length?Math.min(...walks):null,
sta:sta.split(' / ')[0].replace('徒歩','도보 ').replace('分','분')};
}).filter(Boolean);
try{localStorage.setItem(CK,JSON.stringify({t:Date.now(),items:it}))}catch(e){}
return it};
let items=null;
try{const c=JSON.parse(localStorage.getItem(CK)||'null');if(c&&Date.now()-c.t<18e5&&c.items&&c.items.length)items=c.items}catch(e){}
if(items)load();else items=await load();
if(!items)return fail();
const when=i=>(i.when=='즉시·상시 가능'||!i.date||i.date<=today)?'즉시 입주':(+i.date.slice(5,7))+'/'+(+i.date.slice(8))+' 입주';
const has=n=>i=>i.fac.includes(n);
const band=(a,b,l)=>({l,t:i=>i.price>a&&i.price<=b});
/* 'N월 입주 가능' = 그 달 말까지 입주할 수 있는 집. 더 일찍 비는 집도 포함한다 */
const lastYm=items.reduce((a,i)=>i.date>a?i.date:a,today).slice(0,7);
const moveOpts=[{l:'지금 바로',t:i=>when(i)=='즉시 입주'}];
for(let k=0;k<4;k++){
const d=new Date(now.getFullYear(),now.getMonth()+k,1),ym=d.getFullYear()+'-'+String(d.getMonth()+1).padStart(2,'0');
if(ym>lastYm)break;
moveOpts.push({l:(d.getMonth()+1)+'월 안에',t:i=>when(i)=='즉시 입주'||i.date.slice(0,7)<=ym});
}
const G=[
{k:'gu',l:'지역',mode:'or',check:true,opts:Object.entries(CFG.groups).flatMap(([g,l])=>l.filter(w=>items.some(i=>i.gu==w)).map(w=>({l:w,sub:g,t:i=>i.gu==w})))},
{k:'type',l:'방 유형',mode:'or',opts:[...['1R','1K','1DK','1LDK'].map(t=>({l:t,t:i=>i.type==t})),{l:'2K 이상',t:i=>/^[2-9]/.test(i.type)}]},
{k:'price',l:'월 총액',mode:'or',opts:[{l:'5만엔 미만',t:i=>i.price>0&&i.price<50000},...[5,6,7,8,9].map(n=>({l:n+'만엔대',t:i=>i.price>=n*10000&&i.price<(n+1)*10000})),{l:'10만엔 이상',t:i=>i.price>=100000}]},
{k:'move',l:'입주 시기',mode:'one',opts:moveOpts},
{k:'cost',l:'초기비용 줄이기',mode:'and',more:1,opts:[{l:'보증금(시키킹) 0엔',t:i=>i.siki=='없음'},{l:'사례금(레이킹) 0엔',t:i=>i.rei=='없음'}]},
{k:'safe',l:'안심',mode:'and',more:1,opts:[{l:'2층 이상',t:i=>i.floor>=2},{l:'오토록(자동잠금)',t:i=>i.fac.some(f=>f.includes('오토록'))}]},
{k:'walk',l:'역까지',mode:'one',more:1,opts:[5,10].map(n=>({l:'도보 '+n+'분 이내',t:i=>i.walk!=null&&i.walk<=n}))},
{k:'fac',l:'생활 편의<small style="display:block;margin-top:3px;font-size:11px;font-weight:500;color:var(--mut)">설비 정보 있는 집만</small>',mode:'and',more:1,opts:[{l:'방 안 세탁기 자리',t:i=>i.fac.includes('실내세탁기보관소')||i.fac.includes('세탁기두는곳있음')},{l:'에어컨',t:has('에어컨')},{l:'화장실·욕실 따로',t:has('화장실 별도')},{l:'와이파이 무료',t:has('인터넷사용무료')},{l:'택배함',t:has('택배박스')}]},
{k:'cond',l:'건물',mode:'and',more:1,opts:[{l:'2010년 이후 건물',t:i=>i.year>=2010},{l:'콘크리트(방음 좋음)',t:i=>/콘크리트/.test(i.st)}]}
];
G.forEach(g=>{if(g.k!='gu')g.opts=g.opts.filter(o=>items.some(o.t))});const sel=Object.fromEntries(G.map(g=>[g.k,new Set()]));
const S={sort:'date',n:20,q:''};const norm=s=>String(s||'').normalize('NFKC').toLowerCase().replace(/[\s·\-]/g,'');const hit=i=>!S.q||norm(i.no).includes(S.q)||norm(i.title).includes(S.q);
const pass=(g,i)=>{const s=[...sel[g.k]];if(!s.length)return true;return g.mode=='and'?s.every(x=>g.opts[x].t(i)):s.some(x=>g.opts[x].t(i))};
const match=()=>items.filter(i=>hit(i)&&G.every(g=>pass(g,i)));
const facet=(g,x)=>items.filter(i=>hit(i)&&G.every(h=>h===g?(g.mode=='and'?pass(g,i)&&g.opts[x].t(i):g.opts[x].t(i)):pass(h,i))).length;
const chip=(g,o,x)=>`<button type="button" aria-pressed="false" data-g="${g.k}" data-x="${x}">${esc(o.l)}<em></em></button>`;
const chips=g=>{
if(!g.check)return `<div class="ml-ch">${g.opts.map((o,x)=>chip(g,o,x)).join('')}</div>`;
const subs=[...new Set(g.opts.map(o=>o.sub))];
return subs.map(s=>`<div class="ml-sub">${esc(s)}</div><div class="ml-ch ml-ck">${g.opts.map((o,x)=>o.sub==s?chip(g,o,x):'').join('')}</div>`).join('')};
const rowOf=g=>`<div class="ml-row"><div class="ml-lb">${g.l}</div><div>${chips(g)}</div></div>`;
const wide=document.documentElement.clientWidth>760;
/* 지역 지도: 매물 있는 구는 볼록(.up), 고르면 쏙 들어감(.on), 없는 구는 바닥(.off). 체크 목록은 '목록에서 고르기'에 둔다 */
const short=w=>w.replace(/[구시]$/,'');
const gIdx=w=>G[0].opts.findIndex(o=>o.l==w);
const mapSvg=(g,k)=>{const m=MAP[g],ws=Object.keys(m.p),up=ws.filter(w=>gIdx(w)>=0);
const top=w=>{const x=gIdx(w),p=m.p[w];return x<0?`<path class="t off" d="${p.d}" transform="translate(0 6)"/>`:`<path class="t up" d="${p.d}" data-g="gu" data-x="${x}" data-w="${w}" tabindex="0" role="checkbox" aria-checked="false" aria-label="${w}"/>`};
const lab=w=>{const x=gIdx(w),p=m.p[w];if(x<0&&k&&p.a<60)return '';return `<text class="l ${x<0?'off':'up'}" data-lw="${w}" x="${p.x}" y="${p.y+(x<0?10:2)}"><tspan class="n">${short(w)}</tspan>${x<0?'':`<tspan class="c" x="${p.x}" dy="16"></tspan>`}</text>`};
return `<svg viewBox="0 0 ${m.w} ${m.h+18}" data-mt="${k}" ${k?'hidden':''} aria-label="${g} 지도"><g class="lo">${ws.filter(w=>gIdx(w)<0).map(top).join('')}</g><g class="sd">${up.map(w=>`<path class="s" data-sw="${w}" d="${m.p[w].d}" transform="translate(0 6)"/>`).join('')}</g><g class="hi">${up.map(top).join('')}</g><g>${ws.map(lab).join('')}</g><text class="src" x="${m.w-4}" y="${m.h+14}" text-anchor="end">지도 데이터: 국토수치정보(N03)</text></svg>`};
const mapBox=()=>`<div class="ml-mp"><div><div class="ml-mtab" role="tablist">${Object.keys(MAP).map((g,k)=>`<button type="button" role="tab" data-mt="${k}" aria-selected="${!k}">${g}<i></i></button>`).join('')}</div><div class="ml-mbox"><svg width="0" height="0" style="position:absolute"><defs><filter id="ml-ins" x="-5%" y="-5%" width="110%" height="110%"><feComponentTransfer in="SourceAlpha"><feFuncA type="table" tableValues="1 0"/></feComponentTransfer><feGaussianBlur stdDeviation="2.4"/><feOffset dy="3" result="o"/><feFlood flood-color="#063d1e" flood-opacity=".75"/><feComposite in2="o" operator="in"/><feComposite in2="SourceAlpha" operator="in" result="sh"/><feMerge><feMergeNode in="SourceGraphic"/><feMergeNode in="sh"/></feMerge></filter></defs></svg>${Object.keys(MAP).map(mapSvg).join('')}</div></div><div class="ml-mside"><h4>동네를 눌러 고르세요</h4><p>볼록한 곳이 지금 매물이 있는 동네예요. 누르면 쏙 들어가며 선택되고, 여러 곳을 함께 고를 수 있어요.</p><div class="ml-lgd"><span><i class="u"></i>매물 있음</span><span><i class="d"></i>선택함</span><span><i class="o"></i>매물 없음</span></div><details class="ml-ls"><summary>목록에서 고르기</summary>${chips(G[0])}</details><a class="ml-nb" href="/40e9fba8-c844-8147-be41-c1c27e05c711"><small>NOT SURE?</small><b>어느 동네가 좋을지 아직 모르겠다면</b><span>월세·분위기·통근으로 동네 추천 받기 →</span></a></div></div>`;
const press=(el,down)=>{try{el.animate([{transform:`translate(0,${down?0:6}px)`},{transform:`translate(0,${down?6:0}px)`}],{duration:170,easing:'cubic-bezier(.3,.7,.4,1)'})}catch(e){}};
const paintMap=()=>{
$$('.ml-mbox .t[data-x]',root).forEach(t=>{
const svg=t.ownerSVGElement,w=t.dataset.w,x=+t.dataset.x,on=sel.gu.has(x),c=facet(G[0],x),st=on?'on':c?'up':'off';
const was=t.classList.contains('up')?'high':'low',now=st=='up'?'high':'low';
t.setAttribute('class','t '+st);t.setAttribute('aria-checked',on);t.setAttribute('aria-label',w+' '+c+'곳');t.tabIndex=st=='off'?-1:0;
if(was!=now){const s=$(`[data-sw="${w}"]`,svg);
if(now=='low'){$('.lo',svg).append(t);t.setAttribute('transform','translate(0 6)');s.style.display='none';press(t,1)}
else{$('.hi',svg).append(t);t.removeAttribute('transform');s.style.display='';press(t,0)}}
const l=$(`[data-lw="${w}"]`,svg);if(l){l.setAttribute('class','l '+st);$('.c',l).textContent=c?c+'곳':''}
});
$$('.ml-mtab button',root).forEach(b=>{const g=Object.keys(MAP)[+b.dataset.mt],n=[...sel.gu].filter(x=>G[0].opts[x].sub==g).length;$('i',b).textContent=n||''});
};
const mCenter=()=>$$('.ml-mbox',root).forEach(b=>b.scrollLeft=(b.scrollWidth-b.clientWidth)/2);
root.innerHTML=`<style>${css}</style>
<nav class="ml-top" aria-label="아시타모 바로가기"><b>ASHITAMO</b><span><a href="https://kkakhouse.com" target="_blank" rel="noopener">홈페이지</a><a href="/40f9fba8-c844-8124-97b8-f859f57950b9">이벤트</a><a href="https://www.instagram.com/ashitamo.official/" target="_blank" rel="noopener">인스타</a><a href="https://blog.naver.com/kkakhouse" target="_blank" rel="noopener">블로그</a><a href="https://www.youtube.com/@kkak_house" target="_blank" rel="noopener">유튜브</a><a href="/40e9fba8-c844-814b-84e9-ef52d13155ad">다른 도시</a></span><a class="k" href="${KAKAO}" target="_blank" rel="noopener">카톡으로 상담하기</a></nav><div class="ml-hero" style="background-image:url('${CFG.photo}')"><span class="ml-eb">${CFG.eyebrow}</span><h2>내일도 살고 싶은<br>${CFG.city} 집 찾기</h2><p>원하는 키워드를 눌러 내게 맞는 집을 찾아보세요.</p></div>
<div class="ml-q"><input id="ml-q" type="search" placeholder="매물번호나 이름으로 찾기 (예: ED1828, 루카사)" aria-label="매물번호나 이름으로 찾기" autocomplete="off" enterkeyhint="search"></div><div class="ml-f">
<details class="ml-rgn" ${wide?'open':''}><summary>지역 <b id="ml-gs"></b></summary>${mapBox()}</details>
${G.filter(g=>!g.more&&!g.check).map(rowOf).join('')}
<details class="ml-more2" ${wide?'open':''}><summary>조건 더 고르기</summary>${G.filter(g=>g.more).map(rowOf).join('')}</details>
</div>
<div class="ml-sel" id="ml-se"></div>
<div class="ml-bar"><strong>조건에 맞는 집 <span id="ml-c"></span>곳</strong><button type="button" class="ml-rs" id="ml-x">초기화</button>
<select class="ml-s" id="ml-so" aria-label="정렬"><option value="date">입주 빠른 순</option><option value="low">월 총액 낮은 순</option><option value="high">월 총액 높은 순</option><option value="big">넓은 순</option><option value="near">역 가까운 순</option><option value="new">신축 순</option></select></div>
<div id="ml-l"></div>
<div class="ml-cta"><p>마음에 드는 집이 있나요?<small>매물번호를 알려 주시면 최신 공실과 초기비용을 바로 확인해 드려요.</small></p><div class="ml-ca"><a class="l" href="/40f9fba8-c844-8118-8172-f4132e0049bf">입주 상담 신청 →</a><a href="${KAKAO}" target="_blank" rel="noopener">카톡으로 상담하기 →</a></div></div><div class="ml-ct"><small>OTHER CITIES</small><h3>도쿄 말고, 다른 도시도 궁금하다면</h3><div><a href="/40e9fba8-c844-8134-ba22-f648d2395d42"><i style="background-image:url('https://images.pexels.com/photos/33425254/pexels-photo-33425254.jpeg?auto=compress&cs=tinysrgb&w=600')"></i><b>오사카</b><span>먹고 걷기 좋은 간사이</span></a><a href="/40e9fba8-c844-818f-98f2-d838a3eaae97"><i style="background-image:url('https://images.pexels.com/photos/16096352/pexels-photo-16096352.jpeg?auto=compress&cs=tinysrgb&w=600')"></i><b>교토</b><span>골목 사이 일상</span></a><a href="/40e9fba8-c844-8149-91b2-d0fb56181851"><i style="background-image:url('https://images.pexels.com/photos/7968189/pexels-photo-7968189.jpeg?auto=compress&cs=tinysrgb&w=600')"></i><b>후쿠오카</b><span>바다 곁 작은 도시</span></a><a href="/40e9fba8-c844-81da-b337-cf516123983a"><i style="background-image:url('https://images.pexels.com/photos/29241287/pexels-photo-29241287.jpeg?auto=compress&cs=tinysrgb&w=600')"></i><b>나고야</b><span>넓은 길과 여유</span></a><a href="/40e9fba8-c844-81fc-b888-c44fadb910d1"><i style="background-image:url('https://images.pexels.com/photos/12884931/pexels-photo-12884931.jpeg?auto=compress&cs=tinysrgb&w=600')"></i><b>삿포로</b><span>눈과 사계절</span></a></div><a class="ml-cta2" href="/40e9fba8-c844-814b-84e9-ef52d13155ad">도시별 생활 안내 전체 보기 →</a></div><div class="ml-fw"><small>FOLLOW</small><h3>어디서든, 아시타모</h3><div>${[['홈페이지','kkakhouse.com','https://kkakhouse.com'],['인스타','@ashitamo.official','https://www.instagram.com/ashitamo.official/'],['블로그','kkakhouse','https://blog.naver.com/kkakhouse'],['유튜브','@kkak_house','https://www.youtube.com/@kkak_house']].map(([a,b,u])=>`<a href="${u}" target="_blank" rel="noopener"><b>${a} →</b><span>${b}</span></a>`).join('')}</div><p>내일도 살고 싶은 일본 집 찾기<small>ASHITAMO</small></p></div>`;
const list=$('#ml-l',root);
const priceHtml=i=>{
const dl=i.rent!=null?`<dl class="ml-dl"><div><dt>월세</dt><dd>${yen(i.rent)}</dd></div><div><dt>관리비</dt><dd>${i.fee?yen(i.fee):'없음'}</dd></div></dl>`:'';
return `${dl}<div class="ml-tot"><small>월 총액</small><b>${yen(i.price)}</b></div>${i.note?`<div class="ml-nt">${esc(i.note)}</div>`:''}`};
const rowHtml=i=>{
const zero=i.siki=='없음'&&i.rei=='없음',wc=i.fac.includes('화장실 별도');
const spec=[i.size&&i.size+'㎡',i.floorText,i.age!=null&&'축 '+i.age+'년',i.st].filter(Boolean);
return `<a class="ml-r" href="/${i.id}"><div class="ml-ph" data-id="${i.id}"></div>
<div><div class="ml-loc">${esc(i.gu)}${i.type?`<span class="ml-ty">${esc(i.type)}</span>`:''}</div><h3>${esc(i.title)}</h3><p class="ml-st">${esc(i.sta)}</p>
<div class="ml-sp">${spec.map(x=>`<span>${esc(x)}</span>`).join('')}</div><div class="ml-no">No. ${esc(i.no)}</div></div>
<div class="ml-pr">${priceHtml(i)}<div class="ml-tg">${zero?'<span class="z">시키킹·레이킹 0엔</span>':`<span>시키킹 ${esc(i.siki)}</span><span>레이킹 ${esc(i.rei)}</span>`}<span>${when(i)}</span>${wc?'<span>화장실 분리</span>':''}</div></div></a>`};
/* 사진: 매물 페이지에서 두 번째 사진(없으면 첫 번째)을 한 건씩 가져온다. 첫 사진은 평면도인 경우가 많다 */
let cache={};try{cache=JSON.parse(localStorage.getItem('ml-img3')||'{}')}catch(e){}
const saveC=()=>{try{localStorage.setItem('ml-img3',JSON.stringify(cache))}catch(e){}};
const byId=Object.fromEntries(items.map(i=>[i.id,i]));
const q=[];let busy=0;
const firstImage=async id=>{
if(id in cache)return cache[id];
const h=await fetch('/'+id).then(r=>r.text());
const m=h.match(/<script id="__NEXT_DATA__"[^>]*>([\s\S]*?)<\/script>/);
let url='';
if(m){const bl=JSON.parse(m[1]).props.pageProps.recordMap.block;
const im=byId[id].content.filter(c=>{const b=unwrap(bl[c]);return b&&b.type=='image'&&b.properties&&b.properties.source});const c=im[1]||im[0];if(c){const s=unwrap(bl[c]).properties.source[0][0];url=s.startsWith('http')?s:API+'image?src='+encodeURIComponent(s)+'&blockId='+c}}
cache[id]=url;saveC();
return url};
const imgUrl=(b,c)=>{const s=b.properties.source[0][0];return s.startsWith('http')?s:API+'image?src='+encodeURIComponent(s)+'&blockId='+c};
const show=(el,u)=>{if(!el.isConnected)return;if(u){const im=new Image();im.alt='';im.onload=()=>{el.textContent='';el.append(im);requestAnimationFrame(()=>im.classList.add('on'))};im.onerror=()=>{el.textContent='사진은 상담 때 보내 드려요'};im.src=u}else el.textContent='사진은 상담 때 보내 드려요'};
/* 사진 빠르게: 화면에 들어온 매물들의 본문 12~35번째 블록만 한 번에 묶어 받는다(우피 syncRecordValues). 사진은 보통 20~28번째에 있다. 못 찾으면 예전처럼 매물 페이지를 받아 찾는다 */
let wait=[],tmr=0;
const flush=async()=>{tmr=0;const els=wait.splice(0,16);if(!els.length)return;if(wait.length)tmr=setTimeout(flush,0);
els.filter(el=>el.dataset.id in cache).forEach(el=>show(el,cache[el.dataset.id]));
const need=els.filter(el=>!(el.dataset.id in cache));if(!need.length)return;
const seg=id=>(byId[id].content||[]).slice(12,36);
let bl={};try{const r=await fetch(API+'syncRecordValues?pageId='+pageId,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({requests:need.flatMap(el=>seg(el.dataset.id)).map(id=>({pointer:{table:'block',id},version:-1}))})});bl=(await r.json()).recordMap.block||{}}catch(e){}
need.forEach(el=>{const id=el.dataset.id,im=seg(id).filter(c=>{const b=unwrap(bl[c]);return b&&b.type=='image'&&b.properties&&b.properties.source});const c=im[1]||im[0];
if(c){cache[id]=imgUrl(unwrap(bl[c]),c);show(el,cache[id])}else firstImage(id).then(u=>show(el,u)).catch(()=>show(el,''))});
saveC()};
const io=new IntersectionObserver(es=>{es.forEach(e=>{if(e.isIntersecting){io.unobserve(e.target);wait.push(e.target);if(!tmr)tmr=setTimeout(flush,40)}})},{rootMargin:'300px'});
const sorts={date:null,low:(a,b)=>a.price-b.price,high:(a,b)=>b.price-a.price,big:(a,b)=>b.size-a.size,near:(a,b)=>(a.walk??99)-(b.walk??99),new:(a,b)=>b.year-a.year};
const EV=`<a class="ml-ev" href="/40f9fba8-c844-8124-97b8-f859f57950b9"><img src="https://images.unsplash.com/photo-1610333684078-c89bd57f2e46?w=900&q=70&auto=format&fit=crop" alt="" loading="lazy"><div><small>EVENT</small><b>아시타모 이벤트</b><p>입주하는 날 필요한 생활용품을 한 상자에 담아 드려요.</p><span>자세히 보기 →</span></div></a>`;const render=()=>{
const r=match();if(sorts[S.sort])r.sort(sorts[S.sort]);
$('#ml-c',root).textContent=r.length;
const show=r.slice(0,S.n);
list.innerHTML=show.length?show.map((i,k)=>(k==4?EV:'')+rowHtml(i)).join(''):'<div class="ml-em">조건에 맞는 집이 없어요. 키워드를 줄여 보세요.</div>';
if(r.length>show.length){const b=document.createElement('button');b.type='button';b.className='ml-more';b.textContent=`더 보기 (${show.length} / ${r.length})`;b.onclick=()=>{S.n+=20;render()};list.append(b)}
$$('.ml-ph',list).forEach(e=>io.observe(e));
};
const paint=()=>{
$$('button[data-g]',root).forEach(b=>{
const g=G.find(x=>x.k==b.dataset.g),x=+b.dataset.x,on=sel[g.k].has(x),c=facet(g,x);
b.setAttribute('aria-pressed',on);$('em',b).textContent=c;b.disabled=!on&&c==0});
paintMap();
const gs=[...sel.gu].map(x=>G[0].opts[x].l);
$('#ml-gs',root).textContent=gs.length?(gs.length>2?gs.slice(0,2).join(', ')+' 외 '+(gs.length-2)+'곳':gs.join(', ')):'전체';
$('#ml-se',root).innerHTML=G.flatMap(g=>[...sel[g.k]].map(x=>`<button type="button" data-rg="${g.k}" data-rx="${x}">${esc(g.opts[x].l)} ×</button>`)).join('');
};
{const pg=new URLSearchParams(location.search).get('gu'),x=G[0].opts.findIndex(o=>o.l==pg);if(x>=0)sel.gu.add(x)}const change=()=>{S.n=20;paint();render()};
root.addEventListener('click',e=>{
const b=e.target.closest('[data-g]'),t=e.target.closest('[data-rg]');
if(t){sel[t.dataset.rg].delete(+t.dataset.rx);return change()}
if(!b||b.classList.contains('off'))return;
const g=G.find(x=>x.k==b.dataset.g),x=+b.dataset.x,s=sel[g.k];
if(s.has(x))s.delete(x);else{if(g.mode=='one')s.clear();s.add(x)}
change()});
$('#ml-so',root).onchange=e=>{S.sort=e.target.value;change()};const qi=$('#ml-q',root);let qt;qi.oninput=()=>{clearTimeout(qt);qt=setTimeout(()=>{S.q=norm(qi.value);change()},150)};
$('#ml-x',root).onclick=()=>{G.forEach(g=>sel[g.k].clear());qi.value='';S.q='';change()};
root.addEventListener('click',e=>{const tb=e.target.closest('.ml-mtab button');if(!tb)return;$$('.ml-mtab button',root).forEach(b=>b.setAttribute('aria-selected',b==tb));$$('.ml-mbox svg[data-mt]',root).forEach(s=>s.toggleAttribute('hidden',s.dataset.mt!=tb.dataset.mt));mCenter()});
root.addEventListener('keydown',e=>{const t=e.target.closest('.ml-mbox .t[data-x]');if(t&&(e.key=='Enter'||e.key==' ')){e.preventDefault();t.dispatchEvent(new MouseEvent('click',{bubbles:true}))}});
$('.ml-rgn',root).addEventListener('toggle',mCenter);
paint();render();requestAnimationFrame(mCenter);
const fit=()=>{const vw=document.documentElement.clientWidth,w=Math.min(1080,vw-32);root.style.setProperty('--w',w+'px');root.style.marginLeft='0';root.style.marginLeft=((vw-w)/2-root.getBoundingClientRect().left)+'px'};
fit();addEventListener('resize',fit);
/* 우피가 화면을 다시 그리면(하이드레이션) 만든 화면이 지워진다. 같은 페이지면 바로 다시 붙이고, 다른 페이지로 가면 멈춘다 */
const mo=new MutationObserver(()=>{if(root.isConnected)return;if(document.getElementById('ml')){mo.disconnect();return}const h=document.querySelector('.notion-page-content'),c=h&&[...h.querySelectorAll('.notion-code-block')].find(x=>x.textContent.includes('ml-hero'));if(location.pathname.split('/').pop()!==pageId){mo.disconnect();return}if(!c)return;[c,...h.querySelectorAll('.notion-collection_view-block,.notion-text-block')].forEach(e=>e.style.display='none');const t=[...document.querySelectorAll('h1,[class*=title]')].find(e=>e.textContent.trim()==document.title.trim()&&!e.closest('.notion-topbar'));if(t)t.style.display='none';h.prepend(root);fit()});
mo.observe(document.body,{childList:true,subtree:true});
})();
JavaScript
복사
