[{"data":1,"prerenderedAt":1167},["ShallowReactive",2],{"writing":3,"components":19,"work":53,"\u002Fcomponents\u002Fkhqr":210},[4,13],{"title":5,"path":6,"description":7,"date":8,"book":9},"The book I wish I read sooner","\u002Fwriting\u002Fthe-book-i-wish-i-read-sooner","Atomic Habits, and why the smallest steps are the ones that change you.","2025-09-10",{"title":10,"author":11,"url":12},"Atomic Habits","James Clear","https:\u002F\u002Fjamesclear.com\u002Fatomic-habits",{"title":14,"path":15,"description":16,"date":17,"book":18},"Hello, world","\u002Fwriting\u002Fhello-world","A new home for the things I build and the small details I care about.","2025-09-09",null,[20,29,38,45],{"title":21,"path":22,"description":23,"tag":24,"icon":25,"new":26,"stem":27,"order":28},"Khmer Keyboard","\u002Fcomponents\u002Fkhmer-keyboard","An on-screen Khmer keyboard that lights up the next key.","input","i-f7-keyboard",true,"components\u002Fkhmer-keyboard",1,{"title":30,"path":31,"description":32,"tag":33,"icon":34,"new":35,"stem":36,"order":37},"Swipe Actions","\u002Fcomponents\u002Fswipe-actions","Swipe a row to reveal actions, like in a phone's mail app.","gesture","i-f7-hand-draw",false,"components\u002Fswipe-actions",2,{"title":39,"path":40,"description":41,"tag":33,"icon":42,"new":35,"stem":43,"order":44},"Card Carousel","\u002Fcomponents\u002Fcard-carousel","Swipe through cards, then open one into a full page.","i-f7-rectangle-stack","components\u002Fcard-carousel",3,{"title":46,"path":47,"description":48,"tag":49,"icon":50,"new":35,"stem":51,"order":52},"KHQR","\u002Fcomponents\u002Fkhqr","A payment card for Cambodia's KHQR, with paid, expired and failed states.","payment","i-f7-qrcode","components\u002Fkhqr",4,[54,86,102,124,142,157,175,192],{"title":55,"path":56,"description":57,"kind":58,"order":28,"status":59,"logo":60,"icon":18,"url":61,"features":62},"Aksar","\u002Fwork\u002Faksar","Free Khmer fonts for the web, with a keyboard and a poster maker.","product","live","\u002Flogos\u002Faksar.svg","https:\u002F\u002Faksar.sothearo.dev",[63,67,70,74,78,82],{"title":64,"text":65,"icon":66},"Every free Khmer font","34 fonts from Google Fonts, Inter Khmer, Khmer Digital, Busra and more, each with its license in plain words.","i-f7-textformat",{"title":68,"text":69,"icon":25},"Try your own words","Type in the font you're looking at, with an on-screen Khmer keyboard that has the coeng key.",{"title":71,"text":72,"icon":73},"Keep the ones you like","Fonts you keep become stickers on a board, so comparing them feels like a desk, not a list.","i-f7-square-stack",{"title":75,"text":76,"icon":77},"Checks that matter","Each font page measures real Khmer lines, suggests a line height and shows how big the web files are.","i-f7-checkmark-seal",{"title":79,"text":80,"icon":81},"Code to copy","HTML, CSS, Tailwind and Nuxt snippets for any font, with pairs that work together.","i-f7-chevron-left-slash-chevron-right",{"title":83,"text":84,"icon":85},"Posters","Turn your words into a poster with frames, stickers and patterns, then save it.","i-f7-photo",{"title":87,"path":88,"description":89,"kind":90,"order":28,"status":59,"logo":18,"icon":91,"url":92,"features":93},"Form Engine","\u002Fwork\u002Fform-engine","Forms written once in TypeScript.","side","i-f7-checkmark-square","https:\u002F\u002Fform.sothearo.dev",[94,98],{"title":95,"text":96,"icon":97},"One schema","Describe a form once and get a step by step wizard with checks built in.","i-f7-doc-text",{"title":99,"text":100,"icon":101},"A playground","Learn by writing real forms in the browser, with no backend to set up.","i-f7-play-rectangle",{"title":103,"path":104,"description":105,"kind":58,"order":37,"status":106,"logo":107,"icon":18,"url":18,"features":108},"Mitai","\u002Fwork\u002Fmitai","Follow anime, K-drama and TV in one list, and see where each one streams.","building","\u002Flogos\u002Fmitai.svg",[109,113,117,121],{"title":110,"text":111,"icon":112},"This week, at a glance","A schedule of what airs each day for everything you follow.","i-f7-calendar",{"title":114,"text":115,"icon":116},"One watching list","Anime, K-drama and TV together, with each episode ticked off as you go.","i-f7-checkmark-alt-circle",{"title":118,"text":119,"icon":120},"Where to watch","See which legal service has a show in Cambodia before you go looking.","i-f7-tv",{"title":122,"text":123,"icon":101},"Your own files","Later, play the episodes you own in a quiet player of its own.",{"title":125,"path":126,"description":127,"kind":90,"order":37,"status":59,"logo":18,"icon":25,"url":128,"features":129},"Quickkeys","\u002Fwork\u002Fquickkeys","Typing practice with rhythm.","https:\u002F\u002Fwpm.sothearo.dev",[130,134,138],{"title":131,"text":132,"icon":133},"Live speed","Words per minute and accuracy as you type, with charts after each test.","i-f7-speedometer",{"title":135,"text":136,"icon":137},"Race friends","Rooms where everyone types the same text at once.","i-f7-person-2",{"title":139,"text":140,"icon":141},"Themes","Make your own colors with a few lines of CSS.","i-f7-paintbrush",{"title":143,"path":144,"description":145,"kind":90,"order":44,"status":59,"logo":18,"icon":146,"url":147,"features":148},"Mint","\u002Fwork\u002Fmint","A quiet expense tracker.","i-f7-chart-pie","https:\u002F\u002Fmint.sothearo.dev",[149,153],{"title":150,"text":151,"icon":152},"Quick to add","Log a spend in a few taps and get back to your day.","i-f7-plus-circle",{"title":154,"text":155,"icon":156},"See where it goes","Simple charts by category and month.","i-f7-chart-bar",{"title":158,"path":159,"description":160,"kind":58,"order":44,"status":106,"logo":161,"icon":18,"url":18,"features":162},"Stage","\u002Fwork\u002Fstage","Slides and your live app on one stage, for demos that feel live.","\u002Flogos\u002Fstage.svg",[163,167,171],{"title":164,"text":165,"icon":166},"Slides and app together","Your live app sits inside a device frame on the slide, so a demo never means switching windows.","i-f7-device-laptop",{"title":168,"text":169,"icon":170},"Magic move","Shared pieces glide from one scene to the next, like Keynote.","i-f7-wand-stars",{"title":172,"text":173,"icon":174},"Present mode","A clean full screen for the room, with notes and what comes next for you.","i-f7-play-circle",{"title":176,"path":177,"description":178,"kind":58,"order":52,"status":106,"logo":179,"icon":18,"url":18,"features":180},"Reel","\u002Fwork\u002Freel","Videos made from code. Write scenes and render them in the browser.","\u002Flogos\u002Freel.svg",[181,184,188],{"title":182,"text":183,"icon":81},"Scenes in code","Write each scene in Vue, React or Markdown on one timeline.",{"title":185,"text":186,"icon":187},"Real motion","Springs and easing from a small frame clock, so every frame is exact.","i-f7-waveform-path",{"title":189,"text":190,"icon":191},"Render in the browser","Export a video right in the tab, or from the command line with ffmpeg.","i-f7-film",{"title":193,"path":194,"description":195,"kind":90,"order":52,"status":59,"logo":18,"icon":196,"url":197,"features":198},"Unmarkdown","\u002Fwork\u002Funmarkdown","A markdown editor in your browser.","i-f7-doc-plaintext","https:\u002F\u002Funmarkdown.sothearo.dev",[199,203,206],{"title":200,"text":201,"icon":202},"Live preview","Rendered markdown beside your text as you type, with code and diagrams.","i-f7-square-split-2x1",{"title":204,"text":205,"icon":25},"Vim and formatting","Toggle Vim keys and tidy a note with one shortcut.",{"title":207,"text":208,"icon":209},"Share by link","The note lives in the link itself, so nothing is stored on a server.","i-f7-link",{"id":211,"title":46,"body":212,"description":48,"extension":1162,"icon":50,"meta":1163,"navigation":26,"new":35,"order":52,"path":47,"rawbody":1164,"seo":1165,"stem":51,"tag":49,"__hash__":1166},"components\u002Fcomponents\u002Fkhqr.md",{"type":213,"value":214,"toc":1153},"minimark",[215,220,224,228,232,235,239,247,599,809,813,961,965,1011,1052,1056,1125,1132,1136,1149],[216,217,219],"h2",{"id":218},"preview","Preview",[221,222,223],"p",{},"Try each outcome, or wait a minute for the code to expire. The code in this demo is not a real payment.",[225,226],"prose-demo",{"name":227},"khqr",[216,229,231],{"id":230},"install","Install",[233,234],"prose-install",{"name":227},[216,236,238],{"id":237},"usage","Usage",[221,240,241,242,246],{},"The card only shows a payment. Your server makes the KHQR payload, for example with the official ",[243,244,245],"code",{},"bakong-khqr"," package, and tells the page when the payment lands. Pass the payload and the current status.",[248,249,251],"prose-framework",{"name":250},"vue",[252,253,258],"pre",{"className":254,"code":255,"filename":256,"language":250,"meta":257,"style":257},"language-vue shiki shiki-themes sothearo-ink-light sothearo-ink-light sothearo-ink-dark","\u003Cscript setup lang=\"ts\">\nimport KhqrCard from \"@\u002Fcomponents\u002Fkhqr\u002FKhqrCard.vue\";\n\nconst { payload, expiresAt } = await $fetch(\"\u002Fapi\u002Fpayments\", { method: \"POST\" });\nconst status = ref(\"waiting\");\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003CKhqrCard\n    :payload=\"payload\"\n    merchant=\"Sothearo Coffee\"\n    :amount=\"4.5\"\n    currency=\"USD\"\n    :status=\"status\"\n    :expires-at=\"expiresAt\"\n    @expire=\"status = 'expired'\"\n    @refresh=\"createPayment\"\n  \u002F>\n\u003C\u002Ftemplate>\n","Checkout.vue","",[243,259,260,294,318,323,383,408,418,423,433,442,460,475,492,507,523,540,567,584,590],{"__ignoreMap":257},[261,262,264,268,272,276,279,282,285,289,291],"span",{"class":263,"line":28},"line",[261,265,267],{"class":266},"skAxj","\u003C",[261,269,271],{"class":270},"s5gRC","script",[261,273,275],{"class":274},"sWLoX"," setup",[261,277,278],{"class":274}," lang",[261,280,281],{"class":266},"=",[261,283,284],{"class":266},"\"",[261,286,288],{"class":287},"s0vWP","ts",[261,290,284],{"class":266},[261,292,293],{"class":266},">\n",[261,295,296,300,304,307,310,313,315],{"class":263,"line":37},[261,297,299],{"class":298},"s1EZa","import",[261,301,303],{"class":302},"sfWAO"," KhqrCard ",[261,305,306],{"class":298},"from",[261,308,309],{"class":266}," \"",[261,311,312],{"class":287},"@\u002Fcomponents\u002Fkhqr\u002FKhqrCard.vue",[261,314,284],{"class":266},[261,316,317],{"class":266},";\n",[261,319,320],{"class":263,"line":44},[261,321,322],{"emptyLinePlaceholder":26},"\n",[261,324,325,328,331,335,338,341,344,347,350,353,356,358,361,363,365,367,370,373,375,378,380],{"class":263,"line":52},[261,326,327],{"class":298},"const",[261,329,330],{"class":266}," {",[261,332,334],{"class":333},"si8qm"," payload",[261,336,337],{"class":266},",",[261,339,340],{"class":333}," expiresAt",[261,342,343],{"class":266}," }",[261,345,346],{"class":266}," =",[261,348,349],{"class":298}," await",[261,351,352],{"class":270}," $fetch",[261,354,355],{"class":266},"(",[261,357,284],{"class":266},[261,359,360],{"class":287},"\u002Fapi\u002Fpayments",[261,362,284],{"class":266},[261,364,337],{"class":266},[261,366,330],{"class":266},[261,368,369],{"class":274}," method",[261,371,372],{"class":266},":",[261,374,309],{"class":266},[261,376,377],{"class":287},"POST",[261,379,284],{"class":266},[261,381,382],{"class":266}," });\n",[261,384,386,388,391,393,396,398,400,403,405],{"class":263,"line":385},5,[261,387,327],{"class":298},[261,389,390],{"class":333}," status",[261,392,346],{"class":266},[261,394,395],{"class":270}," ref",[261,397,355],{"class":266},[261,399,284],{"class":266},[261,401,402],{"class":287},"waiting",[261,404,284],{"class":266},[261,406,407],{"class":266},");\n",[261,409,411,414,416],{"class":263,"line":410},6,[261,412,413],{"class":266},"\u003C\u002F",[261,415,271],{"class":270},[261,417,293],{"class":266},[261,419,421],{"class":263,"line":420},7,[261,422,322],{"emptyLinePlaceholder":26},[261,424,426,428,431],{"class":263,"line":425},8,[261,427,267],{"class":266},[261,429,430],{"class":270},"template",[261,432,293],{"class":266},[261,434,436,439],{"class":263,"line":435},9,[261,437,438],{"class":266},"  \u003C",[261,440,441],{"class":270},"KhqrCard\n",[261,443,445,448,451,453,455,457],{"class":263,"line":444},10,[261,446,447],{"class":266},"    :",[261,449,450],{"class":274},"payload",[261,452,281],{"class":266},[261,454,284],{"class":266},[261,456,450],{"class":302},[261,458,459],{"class":266},"\"\n",[261,461,463,466,468,470,473],{"class":263,"line":462},11,[261,464,465],{"class":274},"    merchant",[261,467,281],{"class":266},[261,469,284],{"class":266},[261,471,472],{"class":287},"Sothearo Coffee",[261,474,459],{"class":266},[261,476,478,480,483,485,487,490],{"class":263,"line":477},12,[261,479,447],{"class":266},[261,481,482],{"class":274},"amount",[261,484,281],{"class":266},[261,486,284],{"class":266},[261,488,489],{"class":333},"4.5",[261,491,459],{"class":266},[261,493,495,498,500,502,505],{"class":263,"line":494},13,[261,496,497],{"class":274},"    currency",[261,499,281],{"class":266},[261,501,284],{"class":266},[261,503,504],{"class":287},"USD",[261,506,459],{"class":266},[261,508,510,512,515,517,519,521],{"class":263,"line":509},14,[261,511,447],{"class":266},[261,513,514],{"class":274},"status",[261,516,281],{"class":266},[261,518,284],{"class":266},[261,520,514],{"class":302},[261,522,459],{"class":266},[261,524,526,528,531,533,535,538],{"class":263,"line":525},15,[261,527,447],{"class":266},[261,529,530],{"class":274},"expires-at",[261,532,281],{"class":266},[261,534,284],{"class":266},[261,536,537],{"class":302},"expiresAt",[261,539,459],{"class":266},[261,541,543,546,549,551,553,556,558,561,564],{"class":263,"line":542},16,[261,544,545],{"class":266},"    @",[261,547,548],{"class":274},"expire",[261,550,281],{"class":266},[261,552,284],{"class":266},[261,554,555],{"class":302},"status ",[261,557,281],{"class":266},[261,559,560],{"class":266}," '",[261,562,563],{"class":287},"expired",[261,565,566],{"class":266},"'\"\n",[261,568,570,572,575,577,579,582],{"class":263,"line":569},17,[261,571,545],{"class":266},[261,573,574],{"class":274},"refresh",[261,576,281],{"class":266},[261,578,284],{"class":266},[261,580,581],{"class":302},"createPayment",[261,583,459],{"class":266},[261,585,587],{"class":263,"line":586},18,[261,588,589],{"class":266},"  \u002F>\n",[261,591,593,595,597],{"class":263,"line":592},19,[261,594,413],{"class":266},[261,596,430],{"class":270},[261,598,293],{"class":266},[248,600,602],{"name":601},"react",[252,603,608],{"className":604,"code":605,"filename":606,"language":607,"meta":257,"style":257},"language-tsx shiki shiki-themes sothearo-ink-light sothearo-ink-light sothearo-ink-dark","import { KhqrCard } from \"@\u002Fcomponents\u002Fkhqr\u002FKhqrCard\";\n\nexport function Checkout({ payload, expiresAt, status, createPayment }) {\n  return (\n    \u003CKhqrCard\n      payload={payload}\n      merchant=\"Sothearo Coffee\"\n      amount={4.5}\n      currency=\"USD\"\n      status={status}\n      expiresAt={expiresAt}\n      onExpire={() => setStatus(\"expired\")}\n      onRefresh={createPayment}\n    \u002F>\n  );\n}\n","Checkout.tsx","tsx",[243,609,610,633,637,672,680,687,700,713,724,737,748,759,784,795,800,805],{"__ignoreMap":257},[261,611,612,614,616,618,621,624,626,629,631],{"class":263,"line":28},[261,613,299],{"class":298},[261,615,330],{"class":266},[261,617,303],{"class":302},[261,619,620],{"class":266},"}",[261,622,623],{"class":298}," from",[261,625,309],{"class":266},[261,627,628],{"class":287},"@\u002Fcomponents\u002Fkhqr\u002FKhqrCard",[261,630,284],{"class":266},[261,632,317],{"class":266},[261,634,635],{"class":263,"line":37},[261,636,322],{"emptyLinePlaceholder":26},[261,638,639,642,645,648,651,653,655,657,659,661,663,666,669],{"class":263,"line":44},[261,640,641],{"class":298},"export",[261,643,644],{"class":298}," function",[261,646,647],{"class":270}," Checkout",[261,649,650],{"class":266},"({",[261,652,334],{"class":302},[261,654,337],{"class":266},[261,656,340],{"class":302},[261,658,337],{"class":266},[261,660,390],{"class":302},[261,662,337],{"class":266},[261,664,665],{"class":302}," createPayment ",[261,667,668],{"class":266},"})",[261,670,671],{"class":266}," {\n",[261,673,674,677],{"class":263,"line":52},[261,675,676],{"class":298},"  return",[261,678,679],{"class":266}," (\n",[261,681,682,685],{"class":263,"line":385},[261,683,684],{"class":266},"    \u003C",[261,686,441],{"class":270},[261,688,689,692,695,697],{"class":263,"line":410},[261,690,691],{"class":274},"      payload",[261,693,694],{"class":266},"={",[261,696,450],{"class":302},[261,698,699],{"class":266},"}\n",[261,701,702,705,707,709,711],{"class":263,"line":420},[261,703,704],{"class":274},"      merchant",[261,706,281],{"class":266},[261,708,284],{"class":266},[261,710,472],{"class":287},[261,712,459],{"class":266},[261,714,715,718,720,722],{"class":263,"line":425},[261,716,717],{"class":274},"      amount",[261,719,694],{"class":266},[261,721,489],{"class":333},[261,723,699],{"class":266},[261,725,726,729,731,733,735],{"class":263,"line":435},[261,727,728],{"class":274},"      currency",[261,730,281],{"class":266},[261,732,284],{"class":266},[261,734,504],{"class":287},[261,736,459],{"class":266},[261,738,739,742,744,746],{"class":263,"line":444},[261,740,741],{"class":274},"      status",[261,743,694],{"class":266},[261,745,514],{"class":302},[261,747,699],{"class":266},[261,749,750,753,755,757],{"class":263,"line":462},[261,751,752],{"class":274},"      expiresAt",[261,754,694],{"class":266},[261,756,537],{"class":302},[261,758,699],{"class":266},[261,760,761,764,767,770,773,775,777,779,781],{"class":263,"line":477},[261,762,763],{"class":274},"      onExpire",[261,765,766],{"class":266},"={()",[261,768,769],{"class":298}," =>",[261,771,772],{"class":270}," setStatus",[261,774,355],{"class":266},[261,776,284],{"class":266},[261,778,563],{"class":287},[261,780,284],{"class":266},[261,782,783],{"class":266},")}\n",[261,785,786,789,791,793],{"class":263,"line":494},[261,787,788],{"class":274},"      onRefresh",[261,790,694],{"class":266},[261,792,581],{"class":302},[261,794,699],{"class":266},[261,796,797],{"class":263,"line":509},[261,798,799],{"class":266},"    \u002F>\n",[261,801,802],{"class":263,"line":525},[261,803,804],{"class":266},"  );\n",[261,806,807],{"class":263,"line":542},[261,808,699],{"class":266},[216,810,812],{"id":811},"props","Props",[814,815,816,835],"table",{},[817,818,819],"thead",{},[820,821,822,826,829,832],"tr",{},[823,824,825],"th",{},"Prop",[823,827,828],{},"Type",[823,830,831],{},"Default",[823,833,834],{},"What it does",[836,837,838,855,874,890,906,926,945],"tbody",{},[820,839,840,845,850,852],{},[841,842,843],"td",{},[243,844,450],{},[841,846,847],{},[243,848,849],{},"string",[841,851],{},[841,853,854],{},"The KHQR string from your server.",[820,856,857,862,866,868],{},[841,858,859],{},[243,860,861],{},"image",[841,863,864],{},[243,865,849],{},[841,867],{},[841,869,870,871,873],{},"A code your server already drew, as a data URL or link. Use it in place of ",[243,872,450],{},".",[820,875,876,881,885,887],{},[841,877,878],{},[243,879,880],{},"merchant",[841,882,883],{},[243,884,849],{},[841,886],{},[841,888,889],{},"Name shown above the amount.",[820,891,892,896,901,903],{},[841,893,894],{},[243,895,482],{},[841,897,898],{},[243,899,900],{},"number",[841,902],{},[841,904,905],{},"Leave it out for a code that takes any amount.",[820,907,908,913,918,923],{},[841,909,910],{},[243,911,912],{},"currency",[841,914,915],{},[243,916,917],{},"\"USD\" | \"KHR\"",[841,919,920],{},[243,921,922],{},"\"USD\"",[841,924,925],{},"Sets the format and the sign in the middle of the code.",[820,927,928,932,937,942],{},[841,929,930],{},[243,931,514],{},[841,933,934],{},[243,935,936],{},"\"waiting\" | \"paid\" | \"expired\" | \"failed\"",[841,938,939],{},[243,940,941],{},"\"waiting\"",[841,943,944],{},"What the card shows.",[820,946,947,951,956,958],{},[841,948,949],{},[243,950,530],{},[841,952,953],{},[243,954,955],{},"Date | number",[841,957],{},[841,959,960],{},"Shows a countdown and a bar that runs out.",[216,962,964],{"id":963},"events","Events",[248,966,967],{"name":250},[814,968,969,979],{},[817,970,971],{},[820,972,973,976],{},[823,974,975],{},"Name",[823,977,978],{},"When",[836,980,981,991,1001],{},[820,982,983,988],{},[841,984,985],{},[243,986,987],{},"@expire",[841,989,990],{},"The countdown reaches zero while waiting.",[820,992,993,998],{},[841,994,995],{},[243,996,997],{},"@refresh",[841,999,1000],{},"The person asks for a new code after it expires.",[820,1002,1003,1008],{},[841,1004,1005],{},[243,1006,1007],{},"@retry",[841,1009,1010],{},"The person tries again after a failure.",[248,1012,1013],{"name":601},[814,1014,1015,1023],{},[817,1016,1017],{},[820,1018,1019,1021],{},[823,1020,975],{},[823,1022,978],{},[836,1024,1025,1034,1043],{},[820,1026,1027,1032],{},[841,1028,1029],{},[243,1030,1031],{},"onExpire",[841,1033,990],{},[820,1035,1036,1041],{},[841,1037,1038],{},[243,1039,1040],{},"onRefresh",[841,1042,1000],{},[820,1044,1045,1050],{},[841,1046,1047],{},[243,1048,1049],{},"onRetry",[841,1051,1010],{},[216,1053,1055],{"id":1054},"customise","Customise",[252,1057,1062],{"className":1058,"code":1059,"filename":1060,"language":1061,"meta":257,"style":257},"language-css shiki shiki-themes sothearo-ink-light sothearo-ink-light sothearo-ink-dark","[data-khqr] {\n  --khqr-width: 320px;\n  --khqr-radius: 24px;\n  --khqr-success: #0f9d58;\n}\n","khqr.css","css",[243,1063,1064,1077,1092,1106,1121],{"__ignoreMap":257},[261,1065,1066,1069,1072,1075],{"class":263,"line":28},[261,1067,1068],{"class":266},"[",[261,1070,1071],{"class":274},"data-khqr",[261,1073,1074],{"class":266},"]",[261,1076,671],{"class":266},[261,1078,1079,1082,1084,1087,1090],{"class":263,"line":37},[261,1080,1081],{"class":302},"  --khqr-width",[261,1083,372],{"class":266},[261,1085,1086],{"class":333}," 320",[261,1088,1089],{"class":298},"px",[261,1091,317],{"class":266},[261,1093,1094,1097,1099,1102,1104],{"class":263,"line":44},[261,1095,1096],{"class":302},"  --khqr-radius",[261,1098,372],{"class":266},[261,1100,1101],{"class":333}," 24",[261,1103,1089],{"class":298},[261,1105,317],{"class":266},[261,1107,1108,1111,1113,1116,1119],{"class":263,"line":52},[261,1109,1110],{"class":302},"  --khqr-success",[261,1112,372],{"class":266},[261,1114,1115],{"class":266}," #",[261,1117,1118],{"class":302},"0f9d58",[261,1120,317],{"class":266},[261,1122,1123],{"class":263,"line":385},[261,1124,699],{"class":266},[221,1126,1127,1128,1131],{},"The card carries ",[243,1129,1130],{},"data-status",", so you can style each state.",[216,1133,1135],{"id":1134},"accessibility","Accessibility",[1137,1138,1139,1143,1146],"ul",{},[1140,1141,1142],"li",{},"The code has a label naming who you pay.",[1140,1144,1145],{},"Paid and expired are announced as status, failed as an alert.",[1140,1147,1148],{},"The code stays black on white in dark mode, so it always scans.",[1150,1151,1152],"style",{},"html pre.shiki code .skAxj, html code.shiki .skAxj{--shiki-light:#8A8A8A;--shiki-default:#8A8A8A;--shiki-dark:#7A7A7A}html pre.shiki code .s5gRC, html code.shiki .s5gRC{--shiki-light:#7A4FD1;--shiki-default:#7A4FD1;--shiki-dark:#C3A3FF}html pre.shiki code .sWLoX, html code.shiki .sWLoX{--shiki-light:#B3611C;--shiki-default:#B3611C;--shiki-dark:#F2B36B}html pre.shiki code .s0vWP, html code.shiki .s0vWP{--shiki-light:#2F8A5B;--shiki-default:#2F8A5B;--shiki-dark:#7FD1A3}html pre.shiki code .s1EZa, html code.shiki .s1EZa{--shiki-light:#C4336A;--shiki-default:#C4336A;--shiki-dark:#FF7AB2}html pre.shiki code .sfWAO, html code.shiki .sfWAO{--shiki-light:#2C2C2C;--shiki-default:#2C2C2C;--shiki-dark:#D4D4D4}html pre.shiki code .si8qm, html code.shiki .si8qm{--shiki-light:#2F6FD1;--shiki-default:#2F6FD1;--shiki-dark:#7AB8FF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":257,"searchDepth":37,"depth":37,"links":1154},[1155,1156,1157,1158,1159,1160,1161],{"id":218,"depth":37,"text":219},{"id":230,"depth":37,"text":231},{"id":237,"depth":37,"text":238},{"id":811,"depth":37,"text":812},{"id":963,"depth":37,"text":964},{"id":1054,"depth":37,"text":1055},{"id":1134,"depth":37,"text":1135},"md",{},"---\ntitle: KHQR\ndescription: A payment card for Cambodia's KHQR, with paid, expired and failed states.\norder: 4\nicon: i-f7-qrcode\ntag: payment\n---\n\n## Preview\n\nTry each outcome, or wait a minute for the code to expire. The code in this demo is not a real payment.\n\n::prose-demo{name=\"khqr\"}\n::\n\n## Install\n\n::prose-install{name=\"khqr\"}\n::\n\n## Usage\n\nThe card only shows a payment. Your server makes the KHQR payload, for example with the official `bakong-khqr` package, and tells the page when the payment lands. Pass the payload and the current status.\n\n::prose-framework{name=\"vue\"}\n\n```vue [Checkout.vue]\n\u003Cscript setup lang=\"ts\">\nimport KhqrCard from \"@\u002Fcomponents\u002Fkhqr\u002FKhqrCard.vue\";\n\nconst { payload, expiresAt } = await $fetch(\"\u002Fapi\u002Fpayments\", { method: \"POST\" });\nconst status = ref(\"waiting\");\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003CKhqrCard\n    :payload=\"payload\"\n    merchant=\"Sothearo Coffee\"\n    :amount=\"4.5\"\n    currency=\"USD\"\n    :status=\"status\"\n    :expires-at=\"expiresAt\"\n    @expire=\"status = 'expired'\"\n    @refresh=\"createPayment\"\n  \u002F>\n\u003C\u002Ftemplate>\n```\n\n::\n\n::prose-framework{name=\"react\"}\n\n```tsx [Checkout.tsx]\nimport { KhqrCard } from \"@\u002Fcomponents\u002Fkhqr\u002FKhqrCard\";\n\nexport function Checkout({ payload, expiresAt, status, createPayment }) {\n  return (\n    \u003CKhqrCard\n      payload={payload}\n      merchant=\"Sothearo Coffee\"\n      amount={4.5}\n      currency=\"USD\"\n      status={status}\n      expiresAt={expiresAt}\n      onExpire={() => setStatus(\"expired\")}\n      onRefresh={createPayment}\n    \u002F>\n  );\n}\n```\n\n::\n\n## Props\n\n| Prop         | Type                                           | Default     | What it does                                                                          |\n| ------------ | ---------------------------------------------- | ----------- | ------------------------------------------------------------------------------------- |\n| `payload`    | `string`                                       |             | The KHQR string from your server.                                                     |\n| `image`      | `string`                                       |             | A code your server already drew, as a data URL or link. Use it in place of `payload`. |\n| `merchant`   | `string`                                       |             | Name shown above the amount.                                                          |\n| `amount`     | `number`                                       |             | Leave it out for a code that takes any amount.                                        |\n| `currency`   | `\"USD\" \\| \"KHR\"`                               | `\"USD\"`     | Sets the format and the sign in the middle of the code.                               |\n| `status`     | `\"waiting\" \\| \"paid\" \\| \"expired\" \\| \"failed\"` | `\"waiting\"` | What the card shows.                                                                  |\n| `expires-at` | `Date \\| number`                               |             | Shows a countdown and a bar that runs out.                                            |\n\n## Events\n\n::prose-framework{name=\"vue\"}\n\n| Name       | When                                             |\n| ---------- | ------------------------------------------------ |\n| `@expire`  | The countdown reaches zero while waiting.        |\n| `@refresh` | The person asks for a new code after it expires. |\n| `@retry`   | The person tries again after a failure.          |\n\n::\n\n::prose-framework{name=\"react\"}\n\n| Name        | When                                             |\n| ----------- | ------------------------------------------------ |\n| `onExpire`  | The countdown reaches zero while waiting.        |\n| `onRefresh` | The person asks for a new code after it expires. |\n| `onRetry`   | The person tries again after a failure.          |\n\n::\n\n## Customise\n\n```css [khqr.css]\n[data-khqr] {\n  --khqr-width: 320px;\n  --khqr-radius: 24px;\n  --khqr-success: #0f9d58;\n}\n```\n\nThe card carries `data-status`, so you can style each state.\n\n## Accessibility\n\n- The code has a label naming who you pay.\n- Paid and expired are announced as status, failed as an alert.\n- The code stays black on white in dark mode, so it always scans.\n",{"title":46,"description":48},"rnAPg8_qY34ZUAuBJB3KJrkIQtHdTwMRyrDk-m9JEr4",1795439722928]