diff --git a/page-uc/textEditor.html b/page-uc/textEditor.html index eae1abf56..29803d21b 100644 --- a/page-uc/textEditor.html +++ b/page-uc/textEditor.html @@ -2880,6 +2880,7 @@

🌙 Islamic Night Time Calculator

-->

🔒 Text Encryption and Decryption

+

(AES 256-GCM & PBKDF2)


diff --git a/page/qrGenerator.html b/page/qrGenerator.html index c5a80d15a..78b181490 100644 --- a/page/qrGenerator.html +++ b/page/qrGenerator.html @@ -4,4 +4,4 @@ `})(i,d,l,c),r=/ viewBox="([^"]*)"/.exec(e)[1],d=/ d="([^"]*)"/.exec(e)[1],n.setAttribute("viewBox",r),n.querySelector("path").setAttribute("d",d),n.querySelector("rect").setAttribute("fill",l),n.querySelector("path").setAttribute("fill",c),n.style.removeProperty("display"),t.href="data:application/svg+xml,"+encodeURIComponent(e);y("statistics-output").textContent=`QR Code version = ${i.version}, mask pattern = ${i.mask}, character count = ${(e=>{let t=0;for(var r of o){if(55296<=(e=r.codePointAt(0))&&e<57344)throw new RangeError("Invalid UTF-16 string");t++}return t})()}, -encoding mode = ${0==a.length?"none":1==a.length?(s=a[0].mode)==(r=qrcodegen.QrSegment.Mode).NUMERIC?"numeric":s==r.ALPHANUMERIC?"alphanumeric":s==r.BYTE?"byte":s==r.KANJI?"kanji":"unknown":"multiple"}, error correction = level ${"LMQH".charAt(i.errorCorrectionLevel.ordinal)}, data bits = ${qrcodegen.QrSegment.getTotalBits(a,i.version)}.`}}function y(e){if((e=document.getElementById(e))instanceof HTMLElement)return e;throw Error("Assertion error")}function w(e){if((e=y(e))instanceof HTMLInputElement)return e;throw Error("Assertion error")}var e,t;(app||={}).handleVersionMinMax=function(e){var t=w("version-min-input"),r=w("version-max-input");let o=parseInt(t.value,10),n=parseInt(r.value,10);o=Math.max(Math.min(o,qrcodegen.QrCode.MAX_VERSION),qrcodegen.QrCode.MIN_VERSION),n=Math.max(Math.min(n,qrcodegen.QrCode.MAX_VERSION),qrcodegen.QrCode.MIN_VERSION),"min"==e&&o>n?n=o:"max"==e&&n \ No newline at end of file +encoding mode = ${0==a.length?"none":1==a.length?(s=a[0].mode)==(r=qrcodegen.QrSegment.Mode).NUMERIC?"numeric":s==r.ALPHANUMERIC?"alphanumeric":s==r.BYTE?"byte":s==r.KANJI?"kanji":"unknown":"multiple"}, error correction = level ${"LMQH".charAt(i.errorCorrectionLevel.ordinal)}, data bits = ${qrcodegen.QrSegment.getTotalBits(a,i.version)}.`}}function y(e){if((e=document.getElementById(e))instanceof HTMLElement)return e;throw Error("Assertion error")}function w(e){if((e=y(e))instanceof HTMLInputElement)return e;throw Error("Assertion error")}var e,t;(app||={}).handleVersionMinMax=function(e){var t=w("version-min-input"),r=w("version-max-input");let o=parseInt(t.value,10),n=parseInt(r.value,10);o=Math.max(Math.min(o,qrcodegen.QrCode.MAX_VERSION),qrcodegen.QrCode.MIN_VERSION),n=Math.max(Math.min(n,qrcodegen.QrCode.MAX_VERSION),qrcodegen.QrCode.MIN_VERSION),"min"==e&&o>n?n=o:"max"==e&&n \ No newline at end of file diff --git a/page/textEditor-CUR.html b/page/textEditor-CUR.html index 31b65578f..a5a94c7df 100644 --- a/page/textEditor-CUR.html +++ b/page/textEditor-CUR.html @@ -27,4 +27,4 @@ `+storedData,t.placeholder="",decryptionStage="data",scrollToTopFully())}let getPasswordKey=e=>window.crypto.subtle.importKey("raw",enc.encode(e),"PBKDF2",!1,["deriveKey"]),deriveKey=(e,t,a)=>window.crypto.subtle.deriveKey({name:"PBKDF2",salt:t,iterations:25e4,hash:"SHA-256"},e,{name:"AES-GCM",length:256},!1,a);async function encryptData(e,t){try{var a=window.crypto.getRandomValues(new Uint8Array(16)),r=window.crypto.getRandomValues(new Uint8Array(12)),n=await getPasswordKey(t),o=await deriveKey(n,a,["encrypt"]),c=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},o,enc.encode(e)),d=new Uint8Array(c),y=new Uint8Array(a.byteLength+r.byteLength+d.byteLength),s=(y.set(a,0),y.set(r,a.byteLength),y.set(d,a.byteLength+r.byteLength),buff_to_base64(y));return s}catch(e){return console.log("Error - "+e),""}}async function decryptData(e,t){try{var a=base64_to_buf(e),r=a.slice(0,16),n=a.slice(16,28),o=a.slice(28),c=await getPasswordKey(t),d=await deriveKey(c,r,["decrypt"]),y=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:n},d,o);return dec.decode(y)}catch(e){return console.log("Error - "+e),""}}

ތިރީގައި މިވާ އަކުރުތައް، މަތީގައިވާ ހުސްޖާގައިގައި ލިޔުމާއެކީ ވަގުތުން ދެންނެވިފައިވާ ބަސްތަކަށް ބަދަލުވެގެންދާނެއެވެ:

  • ސސ- / صص- / -ss ← ﷺ
  • "- ← ” / -" ← “
  • '- ← ’ / -' ← ‘
  • ((- ← « / ))- ← »
  • {-- ← ﴿ / }-- ← ﴾
  • ރއ- / رض- / -ra ← رَضِيَ اللَّهُ عَنْهُ
  • ރއހ- / رضه- / -rah ← رَضِيَ اللَّهُ عَنْهَا
  • ރއ2- / رض2- / -ra2 ← رَضِيَ اللَّهُ عَنْهُمَا
  • ރއ3- / رض3- / -ra3 ← رَضِيَ اللَّهُ عَنْهُمْ
  • ވދ- ← ވިދާޅުވިއެވެ:
  • ދނ- ← ދެންނެވިއެވެ:
  • ރވ- ← ރިވާވެގެންވެއެވެ:
  • ރކ- ← ރިވާ ކުރެއްވީ
  • ރކއ- ← ރިވާ ކުރެއްވިއެވެ:
  • ނރ- ← ނެރުެއްވީ
  • މހ- ← މި ޙަދީޘް
  • ވރ- ← ވިދާޅުވިކަމަށް ރިވާވެގެންވެއެވެ:
  • ގރ- ← ގެ އަރިހުން ރިވާވެގެންވެއެވެ:
  • އއރ- ← އަދި އެހެން ރިވާޔަތެއްގައި ވެއެވެ:
  • ގއ- ← ގެ އަރިހުން
  • އހކ- ← އަހަރެންނަށް ކިޔައިދެއްވިއެވެ
  • އމކ- ← އަހަރުމެންނަށް ކިޔައިދެއްވިއެވެ
  • އޚ- ← އަހަރެންނަށް ޚަބަރުދެއްވިއެވެ
  • އމޚ- ← އަހަރެންނަށް ޚަބަރުދެއްވިއެވެ
  • ރސ- ← ރަސޫލު ﷲ
  • ނބ- ← ނަބިއްޔާ
  • ހދ- ← ޙަދީޘް
  • ރހކ- ← ރަސޫލު ﷲ ﷺ ޙަދީޘް ކުރެއްވިއެވެ: ”
  • ނހކ- ← ނަބިއްޔާ ﷺ ޙަދީޘް ކުރެއްވިއެވެ: ”
  • ހކ- ← ޙަދީޘް ކުރެއްވިއެވެ: ”
  • ހމ- ← ހަމަކަށަވަރުން
  • އހ- ← އެހެނީ ހަމަކަށަވަރުން
  • ކލ- ← ކަލޭގެފާނު
  • އކ- ← އެކަލޭގެފާނު
  • ހކއ- ← ޙަދީޘް ކުރައްވަނިކޮށް ތިމަން އަޑުއެހީމެވެ: ”
  • 1-- ← ⁽¹⁾ / 9-- ← ⁽⁹⁾
  • ...- ← …

ތިރީގައިވާ ލަފްޒެއް ކްލިޕްބޯޑަށް ކުރުމަށް އޭގެ ބަޓަންއަށް ފިތާލާށެވެ.



ތިރީގައި ވަނީ ”KFGQPC Arabic Symbols 01“ ގެ ދިގު ސިމްބޮލްތަކެވެ. ފޮންޓު އެޕްލައި ކުރުމަށް ފަހު ވޯރޑުގައި ޕޭސްޓު ކުރާށެވެ.

ތިރީގައި ވަނީ ”KFGQPC Arabic Symbols 01“ ގެ ކުރު ސިމްބޮލްތަކެވެ. ފޮންޓު އެޕްލައި ކުރުމަށް ފަހު ވޯރޑުގައި ޕޭސްޓު ކުރާށެވެ.

ތިރީގައި ވަނީ ”AGA Arabesque Regular“ ގެ ސިމްބޮލްތަކެވެ. ފޮންޓު އެޕްލައި ކުރުމަށް ފަހު ވޯރޑުގައި ޕޭސްޓު ކުރާށެވެ.

Sum Total: 0.00

The Zakat for the total would be: 0.00


QR Code Generator 🏁

  8 pixels per module
QR:
Colors:Light = , dark =
Error correction:
Output format:
modules
Version range:Min = , Max =
(−1 for automatic, 0 to 7 for manual)
Boost ECC:
Statistics:QR Code version = 1, mask pattern = 6, character count = 0, encoding mode = none, error correction = level H, data bits = 0.


Third and Half of Night Calculator 🌙

Select Maghrib Time:    
Select Fajr Time:
Midnight is:
Last third is:
Second third is:
First third is:



If you don’t know the date of your child’s Aqiqah, you can use our Aqiqah date calculator.



Unit Converter 🧮






   
20 A    A

މަތީގައިވާ ލިޔާ ދެ ތަންކޮޅުގައި އެއްޗެއް ލިޔުމުން، އެ ދެ ލިޔުމުގެ ދެމެދުގައިވާ ތަފާތު ދައްކާނެ. ފަސޭހަވާނީ ޑެސްކްޓޮޕުން ބޭނުން ކުރަން.

މި ސަފުހާ ރަނގަޅަށް ލޯޑު ނުވާ ނަމަ، އަލުން ރީލޯޑު ކޮށްލުމުން ރަނގަޅުވާނެ.

ކަނާތު ފަޅީގައިވާ ބަދަލުތައް، ވާތު ފަޅިއަށް ލުމަށް '>' އަށް ފިތާލައްވާ.

ވާތު ފަޅީގައިވާ ބަދަލުތައް، ކަނާތު ފަޅިއަށް ލުމަށް '<' އަށް ފިތާލައްވާ.

މި ސަފުހާ ރަނގަޅަށް ލޯޑުނުވެ ހުރެދާނެއެވެ. އެ ހާލަތުގައި މަޑު ނުވަތަ ހަރު ރީލޯޑު ކުރާށެވެ.

ފިލިތަކުގައި ހުރި ތަފާތުތައް ނުދައްކަފާނެ.




އިތުރަށް ފައިދާކޮށްފާނެ ލިންކުތައް:

  • ރަސްމީ ރަދީފު: ސައިޓު
  • ތާނަ ލިޔުން ރަނގަޅުތޯ ބެލުމަށް: ސައިޓު
  • ނަމްބަރެއް ތާނަ ލިޔުމަށް ބަދަލުކުރުމަށް: ސައިޓު
  • އެހެން ބަހަކުން ދިވެހި ބަހަށް ތަރުޖަމާ ކުރުމަށް ސައިޓު 1 | ސައިޓު 2
  • ލެޓިން އަކުރުން ލިޔެފަ ތާނަ އަކުރަށް ޓްރާންސްލިޓަރޭޓް ކުރުމަށް: ސައިޓު
  • ފޮޓޯއަކުން ނުވަތަ ކެމެރާއިން ލިޔުމެއް ޑިޖިޓަލައިޒް ކުރުމަށް: ސައިޓު 1 | ސައިޓު 2
  • އަރަބި ބަސްތަކުގައި ފިލިޖެހުމަށް ސައިޓު 1 | ސައިޓު 2 | ސައިޓު 3
  • އަރަބި ލިޔުން ރަނގަޅުތޯ ބެލުމަށް: ސައިޓު
  • އަރަބި ޓެކްސްޓު ރީތި ކުރުމަށް: ސައިޓު
  • އޭއައި ޗެޓްބޮޓަކާ ދިވެހިން ވާހަކަ ދެއްކުމަށް: ސައިޓު
  • ކޮން ޔުނިކޯޑު ކެރެކްޓާއެއްތޯ ބެލުމަށް: ސައިޓު 1 | ސައިޓު 2



—  އިތުރު މައުލޫމާތު ހޯދުމަށް މިތަނަށް ފިތާލައްވާ  —

މިއީ މައިގަނޑު ގޮތެއްގައި ދިވެހި ބަހާއި އަރަބި ބަހުގެ ލިޔުންތެރިން ބޭނުން ހިފުމަށް ހަދާފައިވާ ޓެކްސްޓު އެޑިޓަރެކެވެ.

ބައެއް ބަޓަންތަކުގައި އެއް ފަހަރަށްވުރެ ގިނަ ފަހަރު ފިތާލީމާ އިތުރު ގޮތެއް ވާނެއެވެ.

ޑެސްކްޓޮޕް ބޭނުން ކުރާނަމަ، އެންމެ މަތީގައިވާ ލިޔާ ޖާގައިގެ ކަން މައުސް އިން ހިފާ ދަމާލައިގެން އެ ޖާގަ ބޮޑުކުރެވިދާނެއެވެ.

ވެބްސައިޓު ބޭނުން ކުރާނަމަ، މި ސަފުހާ ބަންދު ކުރިޔަސް، އެންމެ މަތީގައި ލިޔާ އެއްޗެއް ސޭވްވެފައި ހުންނާނެއެވެ.

ޑެސްކްޓޮޕްގައި އޮފްލައިންކޮށް މި ސަފުހާ ބޭނުންކުރަން އެދޭނަމަ، ބްރައުސާގައި ހުންނަވާއިރު ކީބޯޑުގައި ctrl+s އަށް ފިތާލުމަށްފަހު، ކޮމްޕްލީޓް ވެބްޕޭޖް html. ފައިލެއްހެން ސޭވްކޮށްގެން ބޭނުން ކުރެވިދާނެއެވެ. އޭގެ ފަހުން އަދާހަމަކުރަން އެދޭނަމަ އަލުން އެގޮތަށް ސޭވް ކުރާނީއެވެ.

ޑެސްކްޓޮޕުގައި ވަނިކޮށް، ބަޓަނެއްގައި ޖަހާފައިވާ އަކުރެއްގެ ތިރީގައި ރޮނގެއް ދަމާފައިވާ އެ އަކުރުގެ ކީއާއެކު Alt ކީއަށް ފިތައިފި ނަމަ، ކީބޯޑުން އެ ބަޓަނަކަށް ފިތޭ ގޮތް ވާނެއެވެ.




\ No newline at end of file +-10 gifts..."oninput=outputSum() autocapitalize=off autocomplete=off autocorrect=off spellcheck=false>

The Zakat for the total would be: 0.00


QR Code Generator 🏁

  8 pixels per module
QR:
Colors:Light = , dark =
Error correction:
Output format:
modules
Version range:Min = , Max =
(−1 for automatic, 0 to 7 for manual)
Boost ECC:
Statistics:QR Code version = 1, mask pattern = 6, character count = 0, encoding mode = none, error correction = level H, data bits = 0.


Third and Half of Night Calculator 🌙

Select Maghrib Time:    
Select Fajr Time:
Midnight is:
Last third is:
Second third is:
First third is:



If you don’t know the date of your child’s Aqiqah, you can use our Aqiqah date calculator.



Unit Converter 🧮






   
20 A    A

މަތީގައިވާ ލިޔާ ދެ ތަންކޮޅުގައި އެއްޗެއް ލިޔުމުން، އެ ދެ ލިޔުމުގެ ދެމެދުގައިވާ ތަފާތު ދައްކާނެ. ފަސޭހަވާނީ ޑެސްކްޓޮޕުން ބޭނުން ކުރަން.

މި ސަފުހާ ރަނގަޅަށް ލޯޑު ނުވާ ނަމަ، އަލުން ރީލޯޑު ކޮށްލުމުން ރަނގަޅުވާނެ.

ކަނާތު ފަޅީގައިވާ ބަދަލުތައް، ވާތު ފަޅިއަށް ލުމަށް '>' އަށް ފިތާލައްވާ.

ވާތު ފަޅީގައިވާ ބަދަލުތައް، ކަނާތު ފަޅިއަށް ލުމަށް '<' އަށް ފިތާލައްވާ.

މި ސަފުހާ ރަނގަޅަށް ލޯޑުނުވެ ހުރެދާނެއެވެ. އެ ހާލަތުގައި މަޑު ނުވަތަ ހަރު ރީލޯޑު ކުރާށެވެ.

ފިލިތަކުގައި ހުރި ތަފާތުތައް ނުދައްކަފާނެ.




އިތުރަށް ފައިދާކޮށްފާނެ ލިންކުތައް:

  • ރަސްމީ ރަދީފު: ސައިޓު
  • ތާނަ ލިޔުން ރަނގަޅުތޯ ބެލުމަށް: ސައިޓު
  • ނަމްބަރެއް ތާނަ ލިޔުމަށް ބަދަލުކުރުމަށް: ސައިޓު
  • އެހެން ބަހަކުން ދިވެހި ބަހަށް ތަރުޖަމާ ކުރުމަށް ސައިޓު 1 | ސައިޓު 2
  • ލެޓިން އަކުރުން ލިޔެފަ ތާނަ އަކުރަށް ޓްރާންސްލިޓަރޭޓް ކުރުމަށް: ސައިޓު
  • ފޮޓޯއަކުން ނުވަތަ ކެމެރާއިން ލިޔުމެއް ޑިޖިޓަލައިޒް ކުރުމަށް: ސައިޓު 1 | ސައިޓު 2
  • އަރަބި ބަސްތަކުގައި ފިލިޖެހުމަށް ސައިޓު 1 | ސައިޓު 2 | ސައިޓު 3
  • އަރަބި ލިޔުން ރަނގަޅުތޯ ބެލުމަށް: ސައިޓު
  • އަރަބި ޓެކްސްޓު ރީތި ކުރުމަށް: ސައިޓު
  • އޭއައި ޗެޓްބޮޓަކާ ދިވެހިން ވާހަކަ ދެއްކުމަށް: ސައިޓު
  • ކޮން ޔުނިކޯޑު ކެރެކްޓާއެއްތޯ ބެލުމަށް: ސައިޓު 1 | ސައިޓު 2



—  އިތުރު މައުލޫމާތު ހޯދުމަށް މިތަނަށް ފިތާލައްވާ  —

މިއީ މައިގަނޑު ގޮތެއްގައި ދިވެހި ބަހާއި އަރަބި ބަހުގެ ލިޔުންތެރިން ބޭނުން ހިފުމަށް ހަދާފައިވާ ޓެކްސްޓު އެޑިޓަރެކެވެ.

ބައެއް ބަޓަންތަކުގައި އެއް ފަހަރަށްވުރެ ގިނަ ފަހަރު ފިތާލީމާ އިތުރު ގޮތެއް ވާނެއެވެ.

ޑެސްކްޓޮޕް ބޭނުން ކުރާނަމަ، އެންމެ މަތީގައިވާ ލިޔާ ޖާގައިގެ ކަން މައުސް އިން ހިފާ ދަމާލައިގެން އެ ޖާގަ ބޮޑުކުރެވިދާނެއެވެ.

ވެބްސައިޓު ބޭނުން ކުރާނަމަ، މި ސަފުހާ ބަންދު ކުރިޔަސް، އެންމެ މަތީގައި ލިޔާ އެއްޗެއް ސޭވްވެފައި ހުންނާނެއެވެ.

ޑެސްކްޓޮޕްގައި އޮފްލައިންކޮށް މި ސަފުހާ ބޭނުންކުރަން އެދޭނަމަ، ބްރައުސާގައި ހުންނަވާއިރު ކީބޯޑުގައި ctrl+s އަށް ފިތާލުމަށްފަހު، ކޮމްޕްލީޓް ވެބްޕޭޖް html. ފައިލެއްހެން ސޭވްކޮށްގެން ބޭނުން ކުރެވިދާނެއެވެ. އޭގެ ފަހުން އަދާހަމަކުރަން އެދޭނަމަ އަލުން އެގޮތަށް ސޭވް ކުރާނީއެވެ.

ޑެސްކްޓޮޕުގައި ވަނިކޮށް، ބަޓަނެއްގައި ޖަހާފައިވާ އަކުރެއްގެ ތިރީގައި ރޮނގެއް ދަމާފައިވާ އެ އަކުރުގެ ކީއާއެކު Alt ކީއަށް ފިތައިފި ނަމަ، ކީބޯޑުން އެ ބަޓަނަކަށް ފިތޭ ގޮތް ވާނެއެވެ.




\ No newline at end of file diff --git a/page/textEditor.html b/page/textEditor.html index 06cf20dad..98b05eec3 100644 --- a/page/textEditor.html +++ b/page/textEditor.html @@ -1,8 +1,8 @@ -Hadithmv - Text Editor
Char: 0 Wrd: 0 Ln: 0 B: 0

🔗 Other Links:


  • Official Radheef Link
  • Check Thaana Writing for Mistakes Link
  • Change Thaana to Text Link

📅 Date & Time

Gregorian:

Hijri:


Font: KFGQPC Arabic Symbols 01 (Long Symbols)


Font: KFGQPC Arabic Symbols 01 (Short Symbols)


Font: AGA Arabesque Regular

🧮 Sum Total: 0.00
Σ by Line

🔗 Other Links:


  • Official Radheef Link
  • Check Thaana Writing for Mistakes Link
  • Change Thaana to Text Link

📅 Date & Time

Gregorian:

Hijri:


Font: KFGQPC Arabic Symbols 01 (Long Symbols)


Font: KFGQPC Arabic Symbols 01 (Short Symbols)


Font: AGA Arabesque Regular

🧮 Sum Total: 0.00
Σ by Line
The Zakat for the total would be: 0.00

🔢 Direct Proportion Calculator

If g = $
then g = $
If g = $
then g = $

🌙 Islamic Night Time Calculator

Midnight: --:--
Second Third: --:--
Last Third: --:--


🩸 If you don’t know the date of your child’s Aqiqah, you can use our
Aqiqah date calculator.


🔄 You can convert different units of measurement using the
Unit Converter.


🔗 Link to Calculator Soup
A free online calculator. Includes time value of money, math, algebra, trigonometry, fractions, physics, statistics, time & date and conversions calculators.


- Results on this pageare not guaranteed to be 100% correct. -

\ No newline at end of file +-10 gifts..."style=direction:ltr;text-align:left>
The Zakat for the total would be: 0.00

🔢 Direct Proportion Calculator

If g = $
then g = $
If g = $
then g = $

🌙 Islamic Night Time Calculator

Midnight: --:--
Second Third: --:--
Last Third: --:--


🩸 If you don’t know the date of your child’s Aqiqah, you can use our
Aqiqah date calculator.


🔄 You can convert different units of measurement using the
Unit Converter.


🔗 Link to Calculator Soup
A free online calculator. Includes time value of money, math, algebra, trigonometry, fractions, physics, statistics, time & date and conversions calculators.


- Results on this pageare not guaranteed to be 100% correct. -

🔒 Text Encryption and Decryption

(AES 256-GCM & PBKDF2)


Encrypt Text

1. Enter text to encrypt below
2. Enter a password in the password field
3. Click "Encrypt" to generate encrypted text

Decrypt Text

1. Paste encrypted text below
2. Enter the same password used for encryption
3. Click "Decrypt" to reveal original text


\ No newline at end of file diff --git a/page/textEditor.min.js b/page/textEditor.min.js index da1394251..e274ecf70 100644 --- a/page/textEditor.min.js +++ b/page/textEditor.min.js @@ -1 +1 @@ -document.addEventListener("DOMContentLoaded",(()=>{function e(){const e=this.value;v.value=e,p.value=e,g.style.fontSize=`${e}px`}function t(){var e=g.value;const t=e.trim()?e.trim().split(/\s+/).length:0,a=e?e.split("\n").length:0;b.textContent=`Char: ${e.length}`,h.textContent=`Wrd: ${t}`,y.textContent=`Ln: ${a}`,e=new Blob([e]).size,f.textContent=1024>e?`B: ${e}`:1048576>e?`KB: ${(e/1024).toFixed(2)}`:1073741824>e?`MB: ${(e/1048576).toFixed(2)}`:`GB: ${(e/1073741824).toFixed(2)}`}function a(e){S[k-1].content=g.value,k=e,g.value=S.find((t=>t.id===e)).content,document.querySelectorAll(".numbered-tab").forEach((t=>{t.classList.toggle("active",parseInt(t.dataset.tab)===e)})),t()}function n(){g.style.direction="ltr",g.style.textAlign="left"}function r(){window.scrollTo({top:0,behavior:"smooth"})}function l(){document.querySelectorAll(".dropdown-content").forEach((e=>{e.classList.remove("show")}))}function o(){const e=new Date,t="true"===localStorage.getItem("militaryTime"),a=e.getHours()%12||12,n=String(e.getHours()).padStart(2,"0");var r=t?n:a;const l=12<=e.getHours()?"PM":"AM";String(e.getMinutes()).padStart(2,"0");var o=e.toLocaleDateString("en-GB",{weekday:"long",day:"numeric",month:"long",year:"numeric"});o=o.replace(/^(\w+)\s+(\d+)/,((e,t,a)=>`${t}, ${a}${["th","st","nd","rd"][3{if("weekday"===e.type&&(m=d[e.value]||e.value),"day"===e.type&&(g=e.value),"month"===e.type){var t=e.value;v=r[t]?.[0]||t}"year"===e.type&&(p=e.value)})),document.getElementById("hijriLongEn").textContent=`${m}, ${parseInt(g)} ${v} ${p} AH, at ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+l}`,i.forEach((e=>{if("day"===e.type&&(b=e.value),"month"===e.type){var t=e.value;h=r[t]?.[1]||t}"year"===e.type&&(y=e.value)})),document.getElementById("hijriLongDv").textContent=`${o[e.getDay()]}، ${parseInt(b)} ${h} ${y}، ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+c}`;const f=new Intl.DateTimeFormat("en-u-ca-islamic",{day:"numeric",month:"numeric",year:"numeric",calendar:"islamic"}).format(e).replace(/[^0-9/]/g,"");document.getElementById("hijriShort").textContent=`${f} ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+l}`}catch(e){console.error("Error formatting Hijri dates:",e),["hijriLongAr","hijriLongEn","hijriLongDv","hijriShort"].forEach((e=>{document.getElementById(e).textContent="Hijri date unavailable"}))}document.getElementById("gregorianShort").textContent=`${String(e.getDate()).padStart(2,"0")}/${String(e.getMonth()+1).padStart(2,"0")}/${e.getFullYear()} ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+l}`}function c(e,t){const a=document.createElement("span");a.textContent=t,a.className="copy-feedback",e.appendChild(a),e.classList.add("copy-success"),setTimeout((()=>{a.remove(),e.classList.remove("copy-success")}),1e3)}function s(){var e=document.getElementById("maghribTime"),t=document.getElementById("fajrTime");if(e.value&&t.value){e=u(e.value),(t=u(t.value)){e.addEventListener("click",(()=>{d.forEach((e=>e.classList.remove("active"))),e.classList.add("active"),m.forEach((t=>{t.classList.remove("active"),t.id===`${e.dataset.tab}Tab`&&t.classList.add("active")}))}))})),v.addEventListener("input",e),p.addEventListener("change",e),p.addEventListener("click",(function(){})),g.addEventListener("input",function(e){let t;return function(...a){clearTimeout(t),t=setTimeout((()=>{clearTimeout(t),e(...a)}),300)}}(t)),E.addEventListener("click",(()=>{const e=S.length+1;S.push({id:e,content:""});const t=document.createElement("button");t.classList.add("numbered-tab"),t.dataset.tab=e,t.textContent=e,$.insertBefore(t,E),a(e)})),$.addEventListener("click",(e=>{e.target.classList.contains("numbered-tab")&&a(parseInt(e.target.dataset.tab))})),document.querySelectorAll(".dropdown-button").forEach((e=>{const a=e.querySelector(".function-button"),o=e.querySelector(".dropdown-content");a.addEventListener("click",(e=>{e.stopPropagation(),l(),o.classList.toggle("show")})),o.addEventListener("click",(e=>{e.stopPropagation(),"BUTTON"===e.target.tagName&&e.target.dataset.action&&(function(e){switch(e){case"arabicToRegular":g.value=g.value.replace(/[٠١٢٣٤٥٦٧٨٩]/g,(e=>"٠١٢٣٤٥٦٧٨٩".indexOf(e)));break;case"regularToArabic":g.value=g.value.replace(/[0-9]/g,(e=>"٠١٢٣٤٥٦٧٨٩"[e]));case"convertNumerals":var a={regular:"0123456789",arabic:"٠١٢٣٤٥٦٧٨٩",superscript:"⁰¹²³⁴⁵⁶⁷⁸⁹",mathSansSerif:"𝟢𝟣𝟤𝟥𝟦𝟧𝟨𝟩𝟪𝟫",mathSansSerifBold:"𝟬𝟭𝟮𝟯𝟰𝟱𝟲𝟳𝟴𝟵",fullWidth:"0123456789",circled:"⓪①②③④⑤⑥⑦⑧⑨",negativeCircled:"⓿❶❷❸❹❺❻❼❽❾"};const c=a[document.getElementById("numeralFrom").value],s=a[document.getElementById("numeralTo").value];g.value=g.value.replace(/[0-9]/g,(e=>{const t=c.indexOf(e);return-1!==t?s[t]:e}));break;case"removePrecedingZeros":g.value=g.value.replace(/\b0+(\d)/g,"$1");break;case"removeAllNumbers":g.value=g.value.replace(/[٠-٩0-9]/g,"");break;case"keepOnlyNumbers":g.value=g.value.replace(/[^٠-٩0-9]/g,"");break;case"rtlStraightToCurly":case"ltrStraightToCurly":a="rtlStraightToCurly"===e,g.value=g.value.replace(/(\W|^)"(\S)/g,`$1${a?"”":"“"}$2`).replace(new RegExp(`(${a?"”":"“"}[^"]*)"([^"]*$|[^${a?"”":"“"}"]*${a?"”":"“"})`,"g"),`$1${a?"“":"”"}$2`).replace(/([^0-9])"/g,"$1"+(a?"“":"”")).replace(/(\W|^)'(\S)/g,`$1${a?"’":"‘"}$2`).replace(/([a-z])'([a-z])/gi,"$1‘$2").replace(/((\u2019[^']*)|[a-z])'([^0-9]|$)/gi,`$1${a?"‘":"’"}$3`).replace(/(\u2019)([0-9]{2}[^\u2018]*)(\u2019([^0-9]|$)|$|\u2018[a-z])/gi,"‘$2$3").replace(/(\B|^)\u2019(?=([^\u2018]*\u2018\b)*([^\u2018\u2019]*\W[\u2018\u2019]\b|[^\u2018\u2019]*$))/gi,"$1‘").replace(/'''/g,"‴").replace(/''/g,"″").replace(/'/g,"′");break;case"curlyToStraight":g.value=g.value.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"');break;case"reverseCurlyQuotes":g.value=g.value.replace(/“|”/g,(e=>"“"===e?"”":"“")).replace(/‘|’/g,(e=>"‘"===e?"’":"‘")).replace(/❝|❞/g,(e=>"❝"===e?"❞":"❝")).replace(/\ud83d\ude76|\ud83d\ude77/g,(e=>"🙷"));break;case"convertQuotes":var l={straightSingle:["'","'"],straightDouble:['"','"'],ltrCurlyDouble:["“","”"],rtlCurlyDouble:["”","“"],ltrCurlySingle:["‘","’"],rtlCurlySingle:["’","‘"],angleQuotes:["«","»"],doubleBrackets:["((","))"],heavyCommaQuotes:["❝","❞"],sansSerifHeavyCommaQuotes:["🙶","🙷"]};a=l[document.getElementById("quoteFrom").value],l=l[document.getElementById("quoteTo").value];var o=a[0].replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a[1].replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g.value=g.value.replace(new RegExp(`${o}([^${a}]*)${a}`,"g"),`${l[0]}$1${l[1]}`);break;case"removeJsComments":g.value=g.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeHtmlComments":g.value=g.value.replace(/\x3c!--[\s\S]*?--\x3e/g,""),n();break;case"removeCssComments":g.value=g.value.replace(/\/\*[\s\S]*?\*\//g,""),n();break;case"removePowershellComments":g.value=g.value.replace(/#.*$/gm,"").replace(/<#[\s\S]*?#>/g,""),n();break;case"removePythonComments":g.value=g.value.replace(/#.*$/gm,"").replace(/'''[\s\S]*?'''|"""[\s\S]*?"""/g,""),n();break;case"removePhpComments":g.value=g.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*|#.*$/gm,""),n();break;case"removeCComments":g.value=g.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeCSharpComments":g.value=g.value.replace(/\/\*[\s\S]*?\*\/|\/\/\/.*|\/\/.*/g,""),n();break;case"removeJavaComments":g.value=g.value.replace(/\/\*[\s\S]*?\*\/|\/\*\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeRubyComments":g.value=g.value.replace(/#.*$/gm,"").replace(/^=begin[\s\S]*?^=end/gm,""),n();break;case"removeBashComments":g.value=g.value.replace(/#.*$/gm,""),n();break;case"removeGoComments":g.value=g.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeRustComments":g.value=g.value.replace(/\/\*[\s\S]*?\*\/|\/\/!.*|\/\/.*/g,""),n();break;case"removeSwiftComments":g.value=g.value.replace(/\/\*[\s\S]*?\*\/|\/\/\/.*|\/\/.*/g,""),n();break;case"removeKotlinComments":g.value=g.value.replace(/\/\*[\s\S]*?\*\/|\/\*\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeDartComments":g.value=g.value.replace(/\/\*[\s\S]*?\*\/|\/\/\/.*|\/\/.*/g,""),n();break;case"removeSqlComments":g.value=g.value.replace(/\/\*[\s\S]*?\*\/|--.*$/gm,""),n();break;case"textToParagraphs":g.value=g.value.split("\n").filter((e=>e.trim())).map((e=>`

${e}

`)).join("\n"),n();break;case"textToBrTags":g.value=g.value.split("\n").join("
\n"),n();break;case"textToOrderedList":g.value="
    \n"+g.value.split("\n").filter((e=>e.trim())).map((e=>`
  1. ${e}
  2. `)).join("\n")+"\n
",n();break;case"textToUnorderedList":g.value="
    \n"+g.value.split("\n").filter((e=>e.trim())).map((e=>`
  • ${e}
  • `)).join("\n")+"\n
",n();break;case"removeHtmlTags":g.value=g.value.replace(/<[^>]*>/g,"");break;case"removeArabicDiacritics":g.value=g.value.replace(/[\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/g,"");break;case"removeDhivehiFili":g.value=g.value.replace(/[\u07A6-\u07B0]/g,"");break;case"removeThikijehiThaana":const u={"ޘ":"ސ","ޙ":"ހ","ޛ":"ޒ","ޜ":"ޒ","ޞ":"ސ","ޠ":"ތ","ޡ":"ޒ","ޢ":"އ","ޤ":"ގ","ޥ":"ވ"};g.value=g.value.replace(/[ޘޙޛޜޞޠޡޢޤޥ]/g,(e=>u[e]||e));break;case"saveFile":a=new Blob([g.value],{type:"text/plain;charset=utf-8"}),(l=document.createElement("a")).href=URL.createObjectURL(a),l.download="saved_text.txt",l.click();break;case"loadFile":(a=document.createElement("input")).type="file",a.accept="text/plain",a.onchange=e=>{e=e.target.files[0];const a=new FileReader;a.onload=e=>{g.value=e.target.result,t()},a.readAsText(e)},a.click();break;case"titleCase":g.value=g.value.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()));break;case"sentenceCase":g.value=g.value.toLowerCase().replace(/(^\w|\.\s+\w)/g,(e=>e.toUpperCase()));break;case"lowercase":g.value=g.value.toLowerCase();break;case"UPPERCASE":g.value=g.value.toUpperCase();break;case"alternatingCase":g.value=g.value.split("").map(((e,t)=>0==t%2?e.toLowerCase():e.toUpperCase())).join("");break;case"inverseCase":g.value=g.value.split("").map((e=>e===e.toUpperCase()?e.toLowerCase():e.toUpperCase())).join("");break;case"randomCase":g.value=g.value.split("").map((e=>.5t.toUpperCase()));break;case"pascalCase":g.value=g.value.toLowerCase().replace(/(^|[^a-zA-Z0-9]+)(.)/g,((e,t,a)=>a.toUpperCase()));break;case"snakeCase":g.value=g.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"");break;case"constantCase":g.value=g.value.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"");break;case"kebabCase":g.value=g.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"");break;case"dotCase":g.value=g.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,".").replace(/^\.+|\.+$/g,"");break;case"flatcase":g.value=g.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"");break;case"splitIntoWords":g.value=g.value.split(/\s+/).filter((e=>0{i[e]=(i[e]||0)+1})),a=Object.entries(i).sort(((e,t)=>t[1]-e[1])).map((([e,t])=>`${t}: ${e}`)),g.value=a.join("\n");break;case"sortLinesByFrequency":r();const d={};g.value.split("\n").filter((e=>""!==e.trim())).forEach((e=>{d[e]=(d[e]||0)+1})),a=Object.entries(d).sort(((e,t)=>t[1]-e[1])).map((([e,t])=>`${t}: ${e}`)),g.value=a.join("\n");break;case"sortLinesAscending":g.value=g.value.split("\n").sort(((e,t)=>e.localeCompare(t))).join("\n");break;case"sortLinesDescending":g.value=g.value.split("\n").sort(((e,t)=>t.localeCompare(e))).join("\n");break;case"randomizeLines":g.value=g.value.split("\n").sort((()=>Math.random()-.5)).join("\n");break;case"removeDuplicateLines":g.value=[...new Set(g.value.split("\n"))].join("\n");break;case"reverseTextHorizontal":g.value=g.value.split("").reverse().join("");break;case"reverseTextVertical":g.value=g.value.split("\n").reverse().join("\n");break;case"addLineNumbers":const m=document.getElementById("addNumbersWith").value;a=g.value.split("\n").map(((e,t)=>`${t+1}${m} ${e}`)),g.value=a.join("\n");break;case"removeLineNumbers":l=document.getElementById("removeNumbersWith").value,a=g.value.split("\n"),l=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");const v=new RegExp(`^\\d+${l}\\s+`);a=a.map((e=>e.replace(v,""))),g.value=a.join("\n");break;case"decodeUnicode":g.value=g.value.replace(/\\u([0-9a-fA-F]{4})/g,(function(e,t){return String.fromCharCode(parseInt(t,16))})),n();break;case"encodeUnicode":g.value=g.value.replace(/[\s\S]/g,(function(e){for(e=e.charCodeAt(0).toString(16);4>e.length;)e="0"+e;return"\\u"+e})),n();break;case"decodeURL":try{g.value=decodeURI(g.value)}catch(e){alert("Invalid URL encoding")}n();break;case"encodeURL":g.value=encodeURI(g.value),n();break;case"whichUnicodeCharacter":for(a=g.value,l="",o=0;o"rtl"===h&&"corner"===y?e===p[0]?b[1]:b[0]:e===p[0]?b[0]:b[1]));break;case"reverseBracketDirection":const f={"(":")",")":"(","[":"]","]":"[","⁽":"⁾","⁾":"⁽","⌜":"⌝","⌝":"⌜"};g.value=g.value.replace(/[()[\]⁽⁾⌜⌝]/g,(e=>f[e]));break;case"convertNumberBrackets":const E={0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹"},$=(a={none:["",""],round:["(",")"],square:["[","]"],superscript:["⁽","⁾"]})[document.getElementById("numberBracketFrom").value],k=a[document.getElementById("numberBracketTo").value],S=document.getElementById("numberBracketTo").value;a=g.value,$[0]&&(a=a.replace(new RegExp(`\\${$[0]}\\d+\\${$[1]}`,"g"),(e=>e.slice($[0].length,-$[1].length)))),k[0]&&(a=a.replace(/\d+/g,(e=>(e="superscript"===S?e.split("").map((e=>E[e])).join(""):e,`${k[0]}${e}${k[1]}`)))),g.value=a;break;case"removeNumberBrackets":a={round:["(",")"],square:["[","]"],superscript:["⁽","⁾"],none:["",""]}[document.getElementById("numberBracketRemove").value],g.value=g.value.replace(new RegExp(`\\${a[0]}\\d+\\${a[1]}`,"g"),""),t();break;case"keepOnlyDhivehi":g.value=g.value.replace(/[^\u0780-\u07BF\s]/g,"");break;case"removeAllDhivehi":g.value=g.value.replace(/[\u0780-\u07BF]/g,"");break;case"keepOnlyArabic":g.value=g.value.replace(/[^\u0600-\u06ff\u0750-\u077f\ufb50-\ufbc1\ufbd3-\ufd3f\ufd50-\ufd8f\ufd92-\ufdc7\ufe70-\ufefc\uFDF0-\uFDFD\s]/g,"");break;case"removeAllArabic":g.value=g.value.replace(/[\u0600-\u06ff\u0750-\u077f\ufb50-\ufbc1\ufbd3-\ufd3f\ufd50-\ufd8f\ufd92-\ufdc7\ufe70-\ufefc\uFDF0-\uFDFD]/g,"");break;case"keepOnlyEnglish":g.value=g.value.replace(/[^A-Za-z\s]/g,"");break;case"removeAllEnglish":g.value=g.value.replace(/[A-Za-z]/g,"");break;case"removeSpacesAndSingleLines":g.value=g.value.replace(/^ +| +$/gm,"").replace(/ +/g," ").trim().replace(/\n{2,}/g,"\n");break;case"removeSpacesAndDoubleLines":g.value=g.value.replace(/^ +| +$/gm,"").replace(/ +/g," ").trim().replace(/\n{3,}/g,"\n\n");break;case"wordWrap":g.value=g.value.replace(/\s+/g," ").trim();break;case"removeExtraSpacesOnly":g.value=g.value.replace(/^ +| +$/gm,"").replace(/ +/g," ").trim();break;case"removeSingleLinesOnly":g.value=g.value.trim().replace(/\n{2,}/g,"\n");break;case"removeDoubleLinesOnly":g.value=g.value.trim().replace(/\n{3,}/g,"\n\n");break;case"dotsToEllipsis":g.value=g.value.replace(/\.{3}/g,"…");break;case"ellipsisToDots":g.value=g.value.replace(/…/g,"...");break;case"convertDashes":a=(l={hyphen:"-",en:"–",em:"—"})[document.getElementById("dashFrom").value],l=l[document.getElementById("dashTo").value],g.value=g.value.replace(new RegExp(a,"g"),l);break;case"convertSalawat":a=(l={plain:"صلى الله عليه وسلم",symbol:"ﷺ",tashkeel:"صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ"})[document.getElementById("salawatFrom").value],l=l[document.getElementById("salawatTo").value],a=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g.value=g.value.replace(new RegExp(a,"g"),l);break;case"removeKashidas":g.value=g.value.replace(/ـ/g,"");break;case"shaddaB4Haraka":g.value=g.value.replace(RegExp("([ًٌٍَُِّْ])(ّ)","g"),((e,t,a)=>"ْ"===t?e:a+t));break;case"textToArabicDiacritics":case"arabicDiacriticsToText":g.value=Object.entries({"رضي الله عنهما":"رَضِيَ اللَّهُ عَنْهُمَا","رضي الله عنهم":"رَضِيَ اللَّهُ عَنْهُمْ","رضي الله عنها":"رَضِيَ اللَّهُ عَنْهَا","رضي الله عنه":"رَضِيَ اللَّهُ عَنْهُ","عليهما السلام":"عَلَيهِمَا السَّلَامُ","عليهم السلام":"عَلَيهِمُ السَّلَامُ","عليها السلام":"عَلَيهَا السَّلَامُ","عليه السلام":"عَلَيهِ السَّلَامُ","رحمهما الله":"رَحِمَهُمَا اللَّهُ","رحمهم الله":"رَحِمَهُمُ اللَّهُ","رحمها الله":"رَحِمَهَا اللَّهُ","رحمه الله":"رَحِمَهُ اللَّهُ","عز وجل":"عَزَّ وَجَلَّ","جل جلاله":"جَلَّ جَلَاﻟَﻪُ","تبارك وتعالى":"تَبَارَكَ وَتَعَالَى","تعالى":"تَعَالَى"}).reduce(((t,[a,n])=>t.replace(new RegExp(("textToArabicDiacritics"===e?a:n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"textToArabicDiacritics"===e?n:a)),g.value);break;case"removeQuranicMarks":g.value=g.value.replace(/[ۖۗۘۙۚۛۜ۝۞ۣ۟۠ۡۢۤۥۦۧۨ۩۪ۭ۫۬﴾﴿]/g,"").replace(/\s+/g," ").trim();break;case"replaceDoubleBracketsToSingle":g.value=g.value.replace(/\(\(([^)]*)\)\)/g,"($1)");break;case"textToQuranicBrackets":g.value=g.value.replace(/\{/g,"﴾").replace(/\}/g,"﴿").replace(/\*/g,"۝");break;case"quranicToTextBrackets":g.value=g.value.replace(/﴾/g,"{").replace(/﴿/g,"}").replace(/۝/g,"*");break;case"convertPunctuation":a=(l={colon:":",fullstop:".",comma:","})[document.getElementById("punctuationFrom").value],l=l[document.getElementById("punctuationTo").value],a=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g.value=g.value.replace(new RegExp(a,"g"),l);break;case"ltrToRtlPunc":g.value=g.value.replace(/[,;?]/g,(e=>({",":"،",";":"؛","?":"؟"}[e]||e)));break;case"rtlToLtrPunc":g.value=g.value.replace(/[،؛؟]/g,(e=>({"،":",","؛":";","؟":"?"}[e]||e)))}t()}(e.target.dataset.action),o.classList.remove("show"))}))})),document.addEventListener("click",l),document.getElementById("copyToClipboard").addEventListener("click",(()=>{navigator.clipboard.writeText(g.value)})),document.getElementById("clearAll").addEventListener("click",(()=>{g.value="",S=[{id:1,content:""}],$.innerHTML='',k=1,t()}));let I=!0;document.getElementById("toggleDirection").addEventListener("click",(()=>{I=!I,g.style.direction=I?"rtl":"ltr",g.style.textAlign=I?"right":"left"}));let C=!1;document.getElementById("convertQuotes").addEventListener("click",(()=>{g.value=C?g.value.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"'):g.value.replace(/(\W|^)"(\S)/g,"$1”$2").replace(/(\u201D[^"]*)"([^"]*$|[^\u201D"]*\u201D)/g,"$1“$2").replace(/([^0-9])"/g,"$1“").replace(/(\W|^)'(\S)/g,"$1’$2").replace(/([a-z])'([a-z])/gi,"$1‘$2").replace(/((\u2019[^']*)|[a-z])'([^0-9]|$)/gi,"$1‘$3").replace(/(\u2019)([0-9]{2}[^\u2018]*)(\u2019([^0-9]|$)|$|\u2018[a-z])/gi,"‘$2$3").replace(/(\B|^)\u2019(?=([^\u2018]*\u2018\b)*([^\u2018\u2019]*\W[\u2018\u2019]\b|[^\u2018\u2019]*$))/gi,"$1‘").replace(/'''/g,"‴").replace(/''/g,"″").replace(/'/g,"′"),C=!C,t()})),document.getElementById("genRandPass").addEventListener("click",(()=>{const e=Math.floor(9*Math.random())+8;let a="";for(let t=0;t([{regex:/[a-z]/,range:[97,122]},{regex:/[A-Z]/,range:[65,90]},{regex:/[0-9]/,range:[48,57]},{regex:/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>/?]/,range:[33,47]}].forEach((t=>{if(!t.regex.test(e)){const a=Math.floor(Math.random()*e.length);t=String.fromCharCode(Math.floor(Math.random()*(t.range[1]-t.range[0]+1))+t.range[0]),e=e.substring(0,a)+t+e.substring(a+1)}})),e))(a),t()}));const L=[["އަ","a"],["އާ","aa"],["އި","i"],["އީ","ee"],["އު","u"],["އޫ","oo"],["އެ","e"],["އޭ","ey"],["އޮ","o"],["އޯ","oa"],["ުއް","uh"],["ިއް","ih"],["ެއް","eh"],["ަށް","ah"],["ައް","ah"],["ށް","h"],["ތް","i"],["ާއް","aah"],["އް","h"],["ަ","a"],["ާ","aa"],["ި","i"],["ީ","ee"],["ު","u"],["ޫ","oo"],["ެ","e"],["ޭ","ey"],["ޮ","o"],["ޯ","oa"],["ް",""],["ހ","h"],["ށ","sh"],["ނ","n"],["ރ","r"],["ބ","b"],["ޅ","lh"],["ކ","k"],["އ","a"],["ވ","v"],["މ","m"],["ފ","f"],["ދ","dh"],["ތ","th"],["ލ","l"],["ގ","g"],["ޏ","y"],["ސ","s"],["ޑ","d"],["ޒ","z"],["ޓ","t"],["ޔ","y"],["ޕ","p"],["ޖ","j"],["ޗ","ch"],["ޙ","h"],["ޚ","kh"],["ޛ‎","z"],["ޜ‎","z"],["ޝ‎","sh"],["ޝ","sh"],["ޤ","q"],["ޢ","a"],["ޞ","s"],["ޟ","dh"],["ޡ","z"],["ޠ","t"],["ާާޣ","gh"],["ޘ","th"],["ޛ","dh"],["ާާޜ","z"]];document.getElementById("transliterateDvToEn").addEventListener("click",(()=>{r(),g.value=function(e){e=e.replace(/[\u200B-\u200D\uFEFF]/g,"");for(const[t,a]of L)e=e.replace(new RegExp(t,"g"),a);return e.replace(/(^\s*\w|[.!?]\s*\w)/g,(e=>e.toUpperCase()))}(g.value),n(),t()}));const B=[["ـ",""],["آ","އާ"],["ب","ބ"],["ت","ތ"],["ث","ޘ"],["ج","ޖ"],["ح","ޙ"],["خ","ޚ"],["د","ދ"],["ذ","ޛ"],["ر","ރ"],["ز","ޒ"],["س","ސ"],["ش","ޝ"],["ص","ޞ"],["ض","ޟ"],["ط","ޠ"],["ظ","ޡ"],["ع","ޢ"],["غ","ޣ"],["ف","ފ"],["ق","ޤ"],["ك","ކ"],["ل","ލ"],["م","މ"],["ن","ނ"],["ه","ހ"],["و","ވ"],["ي","ޔ"],["ة","ތ"],["ء","އ"],["أ","އ"],["ؤ","އ"],["إ","އ"],["ئ","އ"],["ى","އ"],["َ","ަ"],["ِ","ި"],["ُ","ު"],["ْ","ް"],["ً","ަން"],["ٍ","ިން"],["ٌ","ުން"],["ަا","ާ"],["اލ","ލ"],["ލއްލަހ","ﷲ"],["ލލހ","ﷲ"],["ލއް","އް"],["ާ އްލަ","ަ އްލަ"],["ا",""],["ުވ","ޫ"],["އ އް"," އް"],["ޫ ލ","ު ލ"],["އްލަލ","އްލަ"],["«",'"'],["»",'"']];document.getElementById("transliterateArToDv").addEventListener("click",(()=>{r(),g.value=function(e){e=e.replace(/(.)ّ/g,((e,t)=>`އް${B.find((([e])=>e===t))?.[1]||t}`)),e=(e=e.replace(/ة([َِ ُ ً ٍ ٌ])/g,"ތ$1")).replace(/ة(?![َِ ُ ً ٍ ٌ])/g,"ހ");for(const[t,a]of B)e=e.replace(new RegExp(t,"g"),a);return e}(g.value),t()}));const x=new class{constructor(){this.ehbari="ސުމެއް އެއް ދެ ތިން ހަތަރު ފަސް ހަ ހަތް އަށް ނުވަ ދިހަ އެގާރަ ބާރަ ތޭރަ ސާދަ ފަނަރަ ސޯޅަ ސަތާރަ އަށާރަ ނަވާރަ ވިހި އެކާވީސް ބާވީސް ތޭވީސް ސައުވީސް ފަންސަވީސް ސައްބީސް ހަތާވީސް އަށާވީސް ނަވާވީސް".split(" "),this.dhihabari="ސުން ދިހަ ވިހި ތިރީސް ސާޅީސް ފަންސާސް ފަސްދޮޅަސް ހައްދިހަ އައްޑިހަ ނުވަދިހަ".split(" "),this.sunbari=["","ހާސް","މިލިޔަން","ބިލިޔަން","ޓްރިލިޔަން"]}convert(e){return e?1e3>(e=parseInt(e))?this.thousandSub(e):this.thousandUp(e):null}thousandSub(e){var t="ސަތޭކަ ";if(0>=e||29>=e)return this.ehbari[e];if(99>=e)return t=Math.floor(e/10),0===(e%=10)?this.dhihabari[t]:`${this.dhihabari[t]} ${this.ehbari[e]}`;if(999>=e){const a=e%100;return 2===(e=Math.floor(e/100))&&(this.ehbari[2]="ދުވި",t="ސައްތަ "),0===a?`${this.ehbari[e]} ${t}`:`${this.ehbari[e]} ${t}${this.thousandSub(a)}`}return""}thousandHalf(e){const t=[];for(;0!==e;)t.push(e%1e3),e=Math.floor(e/1e3);return t}thousandUp(e){var t=this.thousandHalf(e);e=t.length-1;const a=[];for(var n of t.reverse()){t=`${this.thousandSub(n)} `;let r=`${this.sunbari[e]} `;if(" "===t)break;"ސުން "!==t&&"ސުމެއް "!==t||(r=t=""),a.push(t+r),--e}return(n=a.join("")).endsWith(",")&&(n=n.slice(0,-1)),n.trim()}};document.getElementById("Nos2DvTxt").addEventListener("click",(()=>{r();const e=g.value.split("\n").map((e=>{const t=e.match(/\d+/g);return t?t.map((e=>x.convert(e).replace(/\s+/g," ").trim())).join("، "):e.trim()}));g.value=e.filter((e=>0{const e=/[\u07a6-\u07b0]/,t=/[\u064b-\u0650\u0652-\u0656]/,a=/[\u0780-\u07a5]/,n=/[\u064e\u064f\u0650]/,r=g.value.split(/\s+/),l=[];for(let o=0;oe+t.issues.length),0),a=g.value.split(/\s+/),n=`Found ${t} issue${1`;e.forEach(((e,t)=>{const r=a[e.index-1]||"",l=a[e.index+1]||"";let o=e.issues.map((t=>{let a,n;switch(a="multiple"===t.type?`${e.word[t.index-1]||""}${e.word[t.index]} ${e.word[t.index+1]}`:`${e.word[t.index-1]||""} ${e.word[t.index]}`,t.type){case"multiple":n=`Multiple Fili :  ${a}`;break;case"noDvFili":n=`Thaana w/o Fili :  ${a}`;break;case"standalone":n=`Standalone Fili :  ${a}`}return n})).join(", ");n+=`${t+1}. ${r} ${e.word} ${l} : ${o}
`})),T.innerHTML=n}T.style.display="block"}(l)})),document.getElementById("removePunctuation").addEventListener("click",(()=>{r(),g.value=g.value.replace(/[^\w\s]/g,""),t()}));let w=!1;const A={a:"4",e:"3",i:"!",o:"0",t:"7",l:"1",s:"5"},D=Object.fromEntries(Object.entries(A).map((([e,t])=>[t,e])));document.getElementById("toggleLeetSpeak").addEventListener("click",(()=>{g.value=w?g.value.replace(/[43!0715]/g,(e=>D[e])):g.value.toLowerCase().replace(/[aeiotls]/g,(e=>A[e])),w=!w,t(),n()}));const F=document.getElementById("seqMinInput"),M=document.getElementById("seqMaxInput");let j=1,q=10;document.getElementById("generateNumSequence").addEventListener("click",(()=>{"none"===F.style.display?(F.style.display="inline-block",M.style.display="inline-block",F.value=j):(j=parseInt(F.value),q=parseInt(M.value),isNaN(j)&&(j=0),isNaN(q)&&(q=10),j>q&&([j,q]=[q,j],F.value=j,M.value=q));var e="";for(let t=j;t<=q;t++)e+=t+"\n";e=e.trim(),g.value=e})),F.addEventListener("change",(()=>{j=parseInt(F.value),isNaN(j)&&(j=0)})),M.addEventListener("change",(()=>{q=parseInt(M.value),isNaN(q)&&(q=10)}));const N=document.getElementById("RandNoMinInput"),R=document.getElementById("RandNoMaxInput");let z=1,U=10;document.getElementById("randomNum").addEventListener("click",(()=>{"none"===N.style.display?(N.style.display="inline-block",R.style.display="inline-block",N.value=z):(z=parseInt(N.value)||1,U=parseInt(R.value)||10,z>U&&([z,U]=[U,z],N.value=z,R.value=U)),g.value=(Math.floor(Math.random()*(U-z+1))+z).toString(),t()})),N.addEventListener("change",(()=>{z=parseInt(N.value)||1})),R.addEventListener("change",(()=>{U=parseInt(R.value)||10})),document.getElementById("numerateWords").addEventListener("click",(()=>{const e=document.getElementById("textArea");document.getElementById("numerateWords").textContent.includes("No → Wrd")?(e.value=e.value.replace(/\b\d+\b/g,(e=>function(e){const t=" one two three four five six seven eight nine".split(" "),a=" twenty thirty forty fifty sixty seventy eighty ninety".split(" ");var n="ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen".split(" ");return 10>e?t[e]:20>e?n[e-10]:100>e?(n=e%10,a[Math.floor(e/10)]+(n?`-${t[n]}`:"")):e}(parseInt(e)))).replace(/%/g,"percent"),document.getElementById("numerateWords").textContent="Wrd → No"):(e.value=e.value.replace(/\b(?:\w+(?:-\w+)*)\b/g,(e=>{var t=e.toLowerCase();return e={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30,forty:40,fifty:50,sixty:60,seventy:70,eighty:80,ninety:90,hundred:100},t.includes("-")?e=(e[(t=t.split("-"))[0]]||0)+(e[t[1]]||0):e=e[t]||t,e})).replace(/\bpercent\b/g,"%"),document.getElementById("numerateWords").textContent="No → Wrd"),t()}));const H=document.getElementById("repeatInput");document.getElementById("repeatLines").addEventListener("click",(()=>{if("none"===H.style.display)H.style.display="inline-block";else{const e=parseInt(H.value)||1;g.value=Array(e).fill(g.value).join("\n"),t()}}));const O=document.getElementById("prefixInput"),P=document.getElementById("suffixInput");document.getElementById("prefixSuffixToLine").addEventListener("click",(()=>{if("none"===O.style.display)O.style.display="inline-block",P.style.display="inline-block";else{const e=O.value,a=P.value,n=g.value.split("\n").map((t=>e+t+a));g.value=n.join("\n"),t()}}));const W=document.getElementById("removeFromStart"),Z=document.getElementById("removeFromEnd");document.getElementById("rmvNoOfCharsPerLine").addEventListener("click",(()=>{if("none"===W.style.display)W.style.display="inline-block",Z.style.display="inline-block";else{const e=parseInt(W.value)||0,a=parseInt(Z.value)||0,n=g.value.split("\n").map((t=>t.length<=e+a?"":t.slice(e,t.length-a)));g.value=n.join("\n"),t()}}));const _=document.getElementById("findInput"),J=document.getElementById("replaceInput");document.getElementById("findAndReplaceText").addEventListener("click",(()=>{var e=_.value;const a=J.value;e&&(e=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),g.value=g.value.replace(e,a),t())})),document.getElementById("diffCompare").addEventListener("click",(()=>{window.open("diffCompare.html","_blank")})),document.getElementById("keyboardPage").addEventListener("click",(()=>{window.open("keyboardPage.html","_blank")})),document.getElementById("qrGenerator").addEventListener("click",(()=>{window.open("qrGenerator.html","_blank")})),document.getElementById("fullscreen").addEventListener("click",(()=>{document.fullscreenElement?(document.exitFullscreen(),g.style.height="300px"):(document.documentElement.requestFullscreen(),g.style.height="100vh")})),document.addEventListener("fullscreenchange",(()=>{document.fullscreenElement||(g.style.height="300px")})),o(),setInterval(o,6e4),document.getElementById("toggleMilitaryTime").addEventListener("click",(()=>{const e="true"===localStorage.getItem("militaryTime");localStorage.setItem("militaryTime",!e),o()})),g.addEventListener("input",(e=>{const t=e.target.selectionStart;var a=e.target.value.substring(0,t);"ss-"===a.split(/\s/).pop()&&(a=a.replace(/ss-$/,"ﷺ")+e.target.value.substring(t),e.target.value=a,e.target.setSelectionRange(t,t))})),document.querySelectorAll(".copy-button, .copy-button-lit, .copy-button-other").forEach((e=>{e.addEventListener("click",(async()=>{const t=e.dataset.text||e.textContent.trim();try{await navigator.clipboard.writeText(t),c(e,"Copied")}catch(e){console.error("Failed to copy:",e)}}))})),document.querySelectorAll("button").forEach((e=>{e.addEventListener("click",(t=>{e.closest(".dropdown-button")||c(e,"Clicked")}))}));var Q=JSON.parse(localStorage.getItem("editorTabs"));Q&&(S=Q,S.forEach((e=>{if(1{S[k-1].content=g.value,localStorage.setItem("editorTabs",JSON.stringify(S)),localStorage.setItem("currentTab",k)}),5e3),t();const G=document.getElementById("calcArea"),K=document.getElementById("addCalcTab"),Y=document.querySelector(".calc-numbered-tabs");if(G&&K&&Y){let oe=1,ce=[{id:1,content:""}];const se=document.getElementById("sumTotal"),ue=document.getElementById("zakatAmount"),ie=document.getElementById("lineResults"),de=document.getElementById("copyTotal"),me=document.getElementById("clearCalc");function V(){let e=0,t="";G.value.split("\n").forEach((a=>{a=function(e){let t=e.match(/[+-]?\d*\.?\d+(?:,\d{3})*(?:\d*\.?\d+)?/g)||[];e=e.match(/[\+\-\*x\/÷]/g)||[],t=t.map((e=>parseFloat(e.replace(/,/g,""))));for(let a=0;ae+t),0)}(a),e+=a,t+=`${e.toFixed(2)}\n`})),se.textContent=e.toFixed(2),ue.textContent=(.025*e).toFixed(2),ie.textContent=t}function X(e){ce[oe-1].content=G.value,oe=e,G.value=ce[oe-1].content,document.querySelectorAll(".calc-numbered-tab").forEach((t=>{t.classList.toggle("active",parseInt(t.dataset.tab)===e)})),V()}K.addEventListener("click",(()=>{const e=ce.length+1;ce.push({id:e,content:""});const t=document.createElement("button");t.classList.add("calc-numbered-tab"),t.dataset.tab=e,t.textContent=e,Y.insertBefore(t,K),X(e)})),Y.addEventListener("click",(e=>{e.target.classList.contains("calc-numbered-tab")&&X(e=parseInt(e.target.dataset.tab))})),G.addEventListener("input",V),de.addEventListener("click",(()=>{navigator.clipboard.writeText(se.textContent),c(de,"Copied")})),me.addEventListener("click",(()=>{G.value="",ie.textContent="",se.textContent="0.00",ue.textContent="0.00",ce=[{id:1,content:""}],oe=1;const e=Y.querySelectorAll(".calc-numbered-tab");e.forEach((e=>{"1"!==e.dataset.tab&&e.remove()})),e[0].classList.add("active"),c(me,"Cleared")})),(Q=JSON.parse(localStorage.getItem("calculatorTabs")))&&(ce=Q,ce.forEach((e=>{if(1{ce[oe-1].content=G.value,localStorage.setItem("calculatorTabs",JSON.stringify(ce)),localStorage.setItem("currentCalcTab",oe)}),5e3)}const ee=document.querySelector(".proportion-container"),te=document.getElementById("addPropTab"),ae=document.querySelector(".prop-numbered-tabs");if(ee&&te&&ae){let ge=1,ve=[{id:1,content:ee.innerHTML}];function ne(){document.querySelectorAll(".proportion-set").forEach((e=>{e.querySelectorAll(".prop-input").forEach((t=>{t.addEventListener("input",(()=>function(e){if(e=e.querySelectorAll(".prop-input"),3<=Array.from(e).filter((e=>""!==e.value)).length){const t=e[0].value,a=e[1].value,n=e[2].value;t&&a&&n&&(e[3].value=(a/t*n).toFixed(2))}else e[3].value=""}(e)))}))}))}function re(e){ve[ge-1].content=ee.innerHTML,ge=e,ee.innerHTML=ve[ge-1].content,document.querySelectorAll(".prop-numbered-tab").forEach((t=>{t.classList.toggle("active",parseInt(t.dataset.tab)===e)})),ne()}te.addEventListener("click",(()=>{const e=ve.length+1;ve.push({id:e,content:ee.innerHTML});const t=document.createElement("button");t.classList.add("prop-numbered-tab"),t.dataset.tab=e,t.textContent=e,ae.insertBefore(t,te),re(e)})),ae.addEventListener("click",(e=>{e.target.classList.contains("prop-numbered-tab")&&re(e=parseInt(e.target.dataset.tab))})),ne(),(Q=JSON.parse(localStorage.getItem("proportionTabs")))&&(ve=Q,ve.forEach((e=>{if(1{ve[ge-1].content=ee.innerHTML,localStorage.setItem("proportionTabs",JSON.stringify(ve)),localStorage.setItem("currentPropTab",ge)}),5e3);const pe=document.getElementById("clearProp");pe.addEventListener("click",(()=>{document.querySelectorAll(".proportion-set").forEach((e=>{e.querySelectorAll(".prop-input").forEach(((e,t)=>{e.value=2===t?"1":""}))})),ve=[{id:1,content:ee.innerHTML}],ge=1;const e=ae.querySelectorAll(".prop-numbered-tab");e.forEach((e=>{"1"!==e.dataset.tab&&e.remove()})),e[0].classList.add("active"),c(pe,"Cleared")}))}let le="true"===localStorage.getItem("nightCalcMilitaryTime");document.getElementById("maghribTime").addEventListener("change",s),document.getElementById("fajrTime").addEventListener("change",s),document.getElementById("toggleNightCalcFormat").addEventListener("click",(()=>{le=!le,localStorage.setItem("nightCalcMilitaryTime",le),s()}))})); \ No newline at end of file +document.addEventListener("DOMContentLoaded",(()=>{function e(){const e=this.value;g.value=e,v.value=e,p.style.fontSize=`${e}px`}function t(){var e=p.value;const t=e.trim()?e.trim().split(/\s+/).length:0,a=e?e.split("\n").length:0;y.textContent=`Char: ${e.length}`,b.textContent=`Wrd: ${t}`,h.textContent=`Ln: ${a}`,e=new Blob([e]).size,E.textContent=1024>e?`B: ${e}`:1048576>e?`KB: ${(e/1024).toFixed(2)}`:1073741824>e?`MB: ${(e/1048576).toFixed(2)}`:`GB: ${(e/1073741824).toFixed(2)}`}function a(e){I[$-1].content=p.value,$=e,p.value=I.find((t=>t.id===e)).content,document.querySelectorAll(".numbered-tab").forEach((t=>{t.classList.toggle("active",parseInt(t.dataset.tab)===e)})),t()}function n(){p.style.direction="ltr",p.style.textAlign="left"}function r(){window.scrollTo({top:0,behavior:"smooth"})}function l(){document.querySelectorAll(".dropdown-content").forEach((e=>{e.classList.remove("show")}))}function o(){const e=new Date,t="true"===localStorage.getItem("militaryTime"),a=e.getHours()%12||12,n=String(e.getHours()).padStart(2,"0");var r=t?n:a;const l=12<=e.getHours()?"PM":"AM";String(e.getMinutes()).padStart(2,"0");var o=e.toLocaleDateString("en-GB",{weekday:"long",day:"numeric",month:"long",year:"numeric"});o=o.replace(/^(\w+)\s+(\d+)/,((e,t,a)=>`${t}, ${a}${["th","st","nd","rd"][3{if("weekday"===e.type&&(m=d[e.value]||e.value),"day"===e.type&&(p=e.value),"month"===e.type){var t=e.value;g=r[t]?.[0]||t}"year"===e.type&&(v=e.value)})),document.getElementById("hijriLongEn").textContent=`${m}, ${parseInt(p)} ${g} ${v} AH, at ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+l}`,i.forEach((e=>{if("day"===e.type&&(y=e.value),"month"===e.type){var t=e.value;b=r[t]?.[1]||t}"year"===e.type&&(h=e.value)})),document.getElementById("hijriLongDv").textContent=`${o[e.getDay()]}، ${parseInt(y)} ${b} ${h}، ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+c}`;const E=new Intl.DateTimeFormat("en-u-ca-islamic",{day:"numeric",month:"numeric",year:"numeric",calendar:"islamic"}).format(e).replace(/[^0-9/]/g,"");document.getElementById("hijriShort").textContent=`${E} ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+l}`}catch(e){console.error("Error formatting Hijri dates:",e),["hijriLongAr","hijriLongEn","hijriLongDv","hijriShort"].forEach((e=>{document.getElementById(e).textContent="Hijri date unavailable"}))}document.getElementById("gregorianShort").textContent=`${String(e.getDate()).padStart(2,"0")}/${String(e.getMonth()+1).padStart(2,"0")}/${e.getFullYear()} ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+l}`}function c(e,t){const a=document.createElement("span");a.textContent=t,a.className="copy-feedback",e.appendChild(a),e.classList.add("copy-success"),setTimeout((()=>{a.remove(),e.classList.remove("copy-success")}),1e3)}function s(){var e=document.getElementById("maghribTime"),t=document.getElementById("fajrTime");if(e.value&&t.value){e=u(e.value),(t=u(t.value)){e.addEventListener("click",(()=>{d.forEach((e=>e.classList.remove("active"))),e.classList.add("active"),m.forEach((t=>{t.classList.remove("active"),t.id===`${e.dataset.tab}Tab`&&t.classList.add("active")}))}))})),g.addEventListener("input",e),v.addEventListener("change",e),v.addEventListener("click",(function(){})),p.addEventListener("input",function(e){let t;return function(...a){clearTimeout(t),t=setTimeout((()=>{clearTimeout(t),e(...a)}),300)}}(t)),f.addEventListener("click",(()=>{const e=I.length+1;I.push({id:e,content:""});const t=document.createElement("button");t.classList.add("numbered-tab"),t.dataset.tab=e,t.textContent=e,k.insertBefore(t,f),a(e)})),k.addEventListener("click",(e=>{e.target.classList.contains("numbered-tab")&&a(parseInt(e.target.dataset.tab))})),document.querySelectorAll(".dropdown-button").forEach((e=>{const a=e.querySelector(".function-button"),o=e.querySelector(".dropdown-content");a.addEventListener("click",(e=>{e.stopPropagation(),l(),o.classList.toggle("show")})),o.addEventListener("click",(e=>{e.stopPropagation(),"BUTTON"===e.target.tagName&&e.target.dataset.action&&(function(e){switch(e){case"arabicToRegular":p.value=p.value.replace(/[٠١٢٣٤٥٦٧٨٩]/g,(e=>"٠١٢٣٤٥٦٧٨٩".indexOf(e)));break;case"regularToArabic":p.value=p.value.replace(/[0-9]/g,(e=>"٠١٢٣٤٥٦٧٨٩"[e]));case"convertNumerals":var a={regular:"0123456789",arabic:"٠١٢٣٤٥٦٧٨٩",superscript:"⁰¹²³⁴⁵⁶⁷⁸⁹",mathSansSerif:"𝟢𝟣𝟤𝟥𝟦𝟧𝟨𝟩𝟪𝟫",mathSansSerifBold:"𝟬𝟭𝟮𝟯𝟰𝟱𝟲𝟳𝟴𝟵",fullWidth:"0123456789",circled:"⓪①②③④⑤⑥⑦⑧⑨",negativeCircled:"⓿❶❷❸❹❺❻❼❽❾"};const c=a[document.getElementById("numeralFrom").value],s=a[document.getElementById("numeralTo").value];p.value=p.value.replace(/[0-9]/g,(e=>{const t=c.indexOf(e);return-1!==t?s[t]:e}));break;case"removePrecedingZeros":p.value=p.value.replace(/\b0+(\d)/g,"$1");break;case"removeAllNumbers":p.value=p.value.replace(/[٠-٩0-9]/g,"");break;case"keepOnlyNumbers":p.value=p.value.replace(/[^٠-٩0-9]/g,"");break;case"rtlStraightToCurly":case"ltrStraightToCurly":a="rtlStraightToCurly"===e,p.value=p.value.replace(/(\W|^)"(\S)/g,`$1${a?"”":"“"}$2`).replace(new RegExp(`(${a?"”":"“"}[^"]*)"([^"]*$|[^${a?"”":"“"}"]*${a?"”":"“"})`,"g"),`$1${a?"“":"”"}$2`).replace(/([^0-9])"/g,"$1"+(a?"“":"”")).replace(/(\W|^)'(\S)/g,`$1${a?"’":"‘"}$2`).replace(/([a-z])'([a-z])/gi,"$1‘$2").replace(/((\u2019[^']*)|[a-z])'([^0-9]|$)/gi,`$1${a?"‘":"’"}$3`).replace(/(\u2019)([0-9]{2}[^\u2018]*)(\u2019([^0-9]|$)|$|\u2018[a-z])/gi,"‘$2$3").replace(/(\B|^)\u2019(?=([^\u2018]*\u2018\b)*([^\u2018\u2019]*\W[\u2018\u2019]\b|[^\u2018\u2019]*$))/gi,"$1‘").replace(/'''/g,"‴").replace(/''/g,"″").replace(/'/g,"′");break;case"curlyToStraight":p.value=p.value.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"');break;case"reverseCurlyQuotes":p.value=p.value.replace(/“|”/g,(e=>"“"===e?"”":"“")).replace(/‘|’/g,(e=>"‘"===e?"’":"‘")).replace(/❝|❞/g,(e=>"❝"===e?"❞":"❝")).replace(/\ud83d\ude76|\ud83d\ude77/g,(e=>"🙷"));break;case"convertQuotes":var l={straightSingle:["'","'"],straightDouble:['"','"'],ltrCurlyDouble:["“","”"],rtlCurlyDouble:["”","“"],ltrCurlySingle:["‘","’"],rtlCurlySingle:["’","‘"],angleQuotes:["«","»"],doubleBrackets:["((","))"],heavyCommaQuotes:["❝","❞"],sansSerifHeavyCommaQuotes:["🙶","🙷"]};a=l[document.getElementById("quoteFrom").value],l=l[document.getElementById("quoteTo").value];var o=a[0].replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a[1].replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),p.value=p.value.replace(new RegExp(`${o}([^${a}]*)${a}`,"g"),`${l[0]}$1${l[1]}`);break;case"removeJsComments":p.value=p.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeHtmlComments":p.value=p.value.replace(/\x3c!--[\s\S]*?--\x3e/g,""),n();break;case"removeCssComments":p.value=p.value.replace(/\/\*[\s\S]*?\*\//g,""),n();break;case"removePowershellComments":p.value=p.value.replace(/#.*$/gm,"").replace(/<#[\s\S]*?#>/g,""),n();break;case"removePythonComments":p.value=p.value.replace(/#.*$/gm,"").replace(/'''[\s\S]*?'''|"""[\s\S]*?"""/g,""),n();break;case"removePhpComments":p.value=p.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*|#.*$/gm,""),n();break;case"removeCComments":p.value=p.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeCSharpComments":p.value=p.value.replace(/\/\*[\s\S]*?\*\/|\/\/\/.*|\/\/.*/g,""),n();break;case"removeJavaComments":p.value=p.value.replace(/\/\*[\s\S]*?\*\/|\/\*\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeRubyComments":p.value=p.value.replace(/#.*$/gm,"").replace(/^=begin[\s\S]*?^=end/gm,""),n();break;case"removeBashComments":p.value=p.value.replace(/#.*$/gm,""),n();break;case"removeGoComments":p.value=p.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeRustComments":p.value=p.value.replace(/\/\*[\s\S]*?\*\/|\/\/!.*|\/\/.*/g,""),n();break;case"removeSwiftComments":p.value=p.value.replace(/\/\*[\s\S]*?\*\/|\/\/\/.*|\/\/.*/g,""),n();break;case"removeKotlinComments":p.value=p.value.replace(/\/\*[\s\S]*?\*\/|\/\*\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeDartComments":p.value=p.value.replace(/\/\*[\s\S]*?\*\/|\/\/\/.*|\/\/.*/g,""),n();break;case"removeSqlComments":p.value=p.value.replace(/\/\*[\s\S]*?\*\/|--.*$/gm,""),n();break;case"textToParagraphs":p.value=p.value.split("\n").filter((e=>e.trim())).map((e=>`

${e}

`)).join("\n"),n();break;case"textToBrTags":p.value=p.value.split("\n").join("
\n"),n();break;case"textToOrderedList":p.value="
    \n"+p.value.split("\n").filter((e=>e.trim())).map((e=>`
  1. ${e}
  2. `)).join("\n")+"\n
",n();break;case"textToUnorderedList":p.value="
    \n"+p.value.split("\n").filter((e=>e.trim())).map((e=>`
  • ${e}
  • `)).join("\n")+"\n
",n();break;case"removeHtmlTags":p.value=p.value.replace(/<[^>]*>/g,"");break;case"removeArabicDiacritics":p.value=p.value.replace(/[\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/g,"");break;case"removeDhivehiFili":p.value=p.value.replace(/[\u07A6-\u07B0]/g,"");break;case"removeThikijehiThaana":const u={"ޘ":"ސ","ޙ":"ހ","ޛ":"ޒ","ޜ":"ޒ","ޞ":"ސ","ޠ":"ތ","ޡ":"ޒ","ޢ":"އ","ޤ":"ގ","ޥ":"ވ"};p.value=p.value.replace(/[ޘޙޛޜޞޠޡޢޤޥ]/g,(e=>u[e]||e));break;case"saveFile":a=new Blob([p.value],{type:"text/plain;charset=utf-8"}),(l=document.createElement("a")).href=URL.createObjectURL(a),l.download="saved_text.txt",l.click();break;case"loadFile":(a=document.createElement("input")).type="file",a.accept="text/plain",a.onchange=e=>{e=e.target.files[0];const a=new FileReader;a.onload=e=>{p.value=e.target.result,t()},a.readAsText(e)},a.click();break;case"titleCase":p.value=p.value.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()));break;case"sentenceCase":p.value=p.value.toLowerCase().replace(/(^\w|\.\s+\w)/g,(e=>e.toUpperCase()));break;case"lowercase":p.value=p.value.toLowerCase();break;case"UPPERCASE":p.value=p.value.toUpperCase();break;case"alternatingCase":p.value=p.value.split("").map(((e,t)=>0==t%2?e.toLowerCase():e.toUpperCase())).join("");break;case"inverseCase":p.value=p.value.split("").map((e=>e===e.toUpperCase()?e.toLowerCase():e.toUpperCase())).join("");break;case"randomCase":p.value=p.value.split("").map((e=>.5t.toUpperCase()));break;case"pascalCase":p.value=p.value.toLowerCase().replace(/(^|[^a-zA-Z0-9]+)(.)/g,((e,t,a)=>a.toUpperCase()));break;case"snakeCase":p.value=p.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"");break;case"constantCase":p.value=p.value.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"");break;case"kebabCase":p.value=p.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"");break;case"dotCase":p.value=p.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,".").replace(/^\.+|\.+$/g,"");break;case"flatcase":p.value=p.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"");break;case"splitIntoWords":p.value=p.value.split(/\s+/).filter((e=>0{i[e]=(i[e]||0)+1})),a=Object.entries(i).sort(((e,t)=>t[1]-e[1])).map((([e,t])=>`${t}: ${e}`)),p.value=a.join("\n");break;case"sortLinesByFrequency":r();const d={};p.value.split("\n").filter((e=>""!==e.trim())).forEach((e=>{d[e]=(d[e]||0)+1})),a=Object.entries(d).sort(((e,t)=>t[1]-e[1])).map((([e,t])=>`${t}: ${e}`)),p.value=a.join("\n");break;case"sortLinesAscending":p.value=p.value.split("\n").sort(((e,t)=>e.localeCompare(t))).join("\n");break;case"sortLinesDescending":p.value=p.value.split("\n").sort(((e,t)=>t.localeCompare(e))).join("\n");break;case"randomizeLines":p.value=p.value.split("\n").sort((()=>Math.random()-.5)).join("\n");break;case"removeDuplicateLines":p.value=[...new Set(p.value.split("\n"))].join("\n");break;case"reverseTextHorizontal":p.value=p.value.split("").reverse().join("");break;case"reverseTextVertical":p.value=p.value.split("\n").reverse().join("\n");break;case"addLineNumbers":const m=document.getElementById("addNumbersWith").value;a=p.value.split("\n").map(((e,t)=>`${t+1}${m} ${e}`)),p.value=a.join("\n");break;case"removeLineNumbers":l=document.getElementById("removeNumbersWith").value,a=p.value.split("\n"),l=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");const g=new RegExp(`^\\d+${l}\\s+`);a=a.map((e=>e.replace(g,""))),p.value=a.join("\n");break;case"decodeUnicode":p.value=p.value.replace(/\\u([0-9a-fA-F]{4})/g,(function(e,t){return String.fromCharCode(parseInt(t,16))})),n();break;case"encodeUnicode":p.value=p.value.replace(/[\s\S]/g,(function(e){for(e=e.charCodeAt(0).toString(16);4>e.length;)e="0"+e;return"\\u"+e})),n();break;case"decodeURL":try{p.value=decodeURI(p.value)}catch(e){alert("Invalid URL encoding")}n();break;case"encodeURL":p.value=encodeURI(p.value),n();break;case"whichUnicodeCharacter":for(a=p.value,l="",o=0;o"rtl"===b&&"corner"===h?e===v[0]?y[1]:y[0]:e===v[0]?y[0]:y[1]));break;case"reverseBracketDirection":const E={"(":")",")":"(","[":"]","]":"[","⁽":"⁾","⁾":"⁽","⌜":"⌝","⌝":"⌜"};p.value=p.value.replace(/[()[\]⁽⁾⌜⌝]/g,(e=>E[e]));break;case"convertNumberBrackets":const f={0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹"},k=(a={none:["",""],round:["(",")"],square:["[","]"],superscript:["⁽","⁾"]})[document.getElementById("numberBracketFrom").value],$=a[document.getElementById("numberBracketTo").value],I=document.getElementById("numberBracketTo").value;a=p.value,k[0]&&(a=a.replace(new RegExp(`\\${k[0]}\\d+\\${k[1]}`,"g"),(e=>e.slice(k[0].length,-k[1].length)))),$[0]&&(a=a.replace(/\d+/g,(e=>(e="superscript"===I?e.split("").map((e=>f[e])).join(""):e,`${$[0]}${e}${$[1]}`)))),p.value=a;break;case"removeNumberBrackets":a={round:["(",")"],square:["[","]"],superscript:["⁽","⁾"],none:["",""]}[document.getElementById("numberBracketRemove").value],p.value=p.value.replace(new RegExp(`\\${a[0]}\\d+\\${a[1]}`,"g"),""),t();break;case"keepOnlyDhivehi":p.value=p.value.replace(/[^\u0780-\u07BF\s]/g,"");break;case"removeAllDhivehi":p.value=p.value.replace(/[\u0780-\u07BF]/g,"");break;case"keepOnlyArabic":p.value=p.value.replace(/[^\u0600-\u06ff\u0750-\u077f\ufb50-\ufbc1\ufbd3-\ufd3f\ufd50-\ufd8f\ufd92-\ufdc7\ufe70-\ufefc\uFDF0-\uFDFD\s]/g,"");break;case"removeAllArabic":p.value=p.value.replace(/[\u0600-\u06ff\u0750-\u077f\ufb50-\ufbc1\ufbd3-\ufd3f\ufd50-\ufd8f\ufd92-\ufdc7\ufe70-\ufefc\uFDF0-\uFDFD]/g,"");break;case"keepOnlyEnglish":p.value=p.value.replace(/[^A-Za-z\s]/g,"");break;case"removeAllEnglish":p.value=p.value.replace(/[A-Za-z]/g,"");break;case"removeSpacesAndSingleLines":p.value=p.value.replace(/^ +| +$/gm,"").replace(/ +/g," ").trim().replace(/\n{2,}/g,"\n");break;case"removeSpacesAndDoubleLines":p.value=p.value.replace(/^ +| +$/gm,"").replace(/ +/g," ").trim().replace(/\n{3,}/g,"\n\n");break;case"wordWrap":p.value=p.value.replace(/\s+/g," ").trim();break;case"removeExtraSpacesOnly":p.value=p.value.replace(/^ +| +$/gm,"").replace(/ +/g," ").trim();break;case"removeSingleLinesOnly":p.value=p.value.trim().replace(/\n{2,}/g,"\n");break;case"removeDoubleLinesOnly":p.value=p.value.trim().replace(/\n{3,}/g,"\n\n");break;case"dotsToEllipsis":p.value=p.value.replace(/\.{3}/g,"…");break;case"ellipsisToDots":p.value=p.value.replace(/…/g,"...");break;case"convertDashes":a=(l={hyphen:"-",en:"–",em:"—"})[document.getElementById("dashFrom").value],l=l[document.getElementById("dashTo").value],p.value=p.value.replace(new RegExp(a,"g"),l);break;case"convertSalawat":a=(l={plain:"صلى الله عليه وسلم",symbol:"ﷺ",tashkeel:"صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ"})[document.getElementById("salawatFrom").value],l=l[document.getElementById("salawatTo").value],a=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),p.value=p.value.replace(new RegExp(a,"g"),l);break;case"removeKashidas":p.value=p.value.replace(/ـ/g,"");break;case"shaddaB4Haraka":p.value=p.value.replace(RegExp("([ًٌٍَُِّْ])(ّ)","g"),((e,t,a)=>"ْ"===t?e:a+t));break;case"textToArabicDiacritics":case"arabicDiacriticsToText":p.value=Object.entries({"رضي الله عنهما":"رَضِيَ اللَّهُ عَنْهُمَا","رضي الله عنهم":"رَضِيَ اللَّهُ عَنْهُمْ","رضي الله عنها":"رَضِيَ اللَّهُ عَنْهَا","رضي الله عنه":"رَضِيَ اللَّهُ عَنْهُ","عليهما السلام":"عَلَيهِمَا السَّلَامُ","عليهم السلام":"عَلَيهِمُ السَّلَامُ","عليها السلام":"عَلَيهَا السَّلَامُ","عليه السلام":"عَلَيهِ السَّلَامُ","رحمهما الله":"رَحِمَهُمَا اللَّهُ","رحمهم الله":"رَحِمَهُمُ اللَّهُ","رحمها الله":"رَحِمَهَا اللَّهُ","رحمه الله":"رَحِمَهُ اللَّهُ","عز وجل":"عَزَّ وَجَلَّ","جل جلاله":"جَلَّ جَلَاﻟَﻪُ","تبارك وتعالى":"تَبَارَكَ وَتَعَالَى","تعالى":"تَعَالَى"}).reduce(((t,[a,n])=>t.replace(new RegExp(("textToArabicDiacritics"===e?a:n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"textToArabicDiacritics"===e?n:a)),p.value);break;case"removeQuranicMarks":p.value=p.value.replace(/[ۖۗۘۙۚۛۜ۝۞ۣ۟۠ۡۢۤۥۦۧۨ۩۪ۭ۫۬﴾﴿]/g,"").replace(/\s+/g," ").trim();break;case"replaceDoubleBracketsToSingle":p.value=p.value.replace(/\(\(([^)]*)\)\)/g,"($1)");break;case"textToQuranicBrackets":p.value=p.value.replace(/\{/g,"﴾").replace(/\}/g,"﴿").replace(/\*/g,"۝");break;case"quranicToTextBrackets":p.value=p.value.replace(/﴾/g,"{").replace(/﴿/g,"}").replace(/۝/g,"*");break;case"convertPunctuation":a=(l={colon:":",fullstop:".",comma:","})[document.getElementById("punctuationFrom").value],l=l[document.getElementById("punctuationTo").value],a=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),p.value=p.value.replace(new RegExp(a,"g"),l);break;case"ltrToRtlPunc":p.value=p.value.replace(/[,;?]/g,(e=>({",":"،",";":"؛","?":"؟"}[e]||e)));break;case"rtlToLtrPunc":p.value=p.value.replace(/[،؛؟]/g,(e=>({"،":",","؛":";","؟":"?"}[e]||e)))}t()}(e.target.dataset.action),o.classList.remove("show"))}))})),document.addEventListener("click",l),document.getElementById("copyToClipboard").addEventListener("click",(()=>{navigator.clipboard.writeText(p.value)})),document.getElementById("clearAll").addEventListener("click",(()=>{p.value="",I=[{id:1,content:""}],k.innerHTML='',$=1,t()}));let S=!0;document.getElementById("toggleDirection").addEventListener("click",(()=>{S=!S,p.style.direction=S?"rtl":"ltr",p.style.textAlign=S?"right":"left"}));let B=!1;document.getElementById("convertQuotes").addEventListener("click",(()=>{p.value=B?p.value.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"'):p.value.replace(/(\W|^)"(\S)/g,"$1”$2").replace(/(\u201D[^"]*)"([^"]*$|[^\u201D"]*\u201D)/g,"$1“$2").replace(/([^0-9])"/g,"$1“").replace(/(\W|^)'(\S)/g,"$1’$2").replace(/([a-z])'([a-z])/gi,"$1‘$2").replace(/((\u2019[^']*)|[a-z])'([^0-9]|$)/gi,"$1‘$3").replace(/(\u2019)([0-9]{2}[^\u2018]*)(\u2019([^0-9]|$)|$|\u2018[a-z])/gi,"‘$2$3").replace(/(\B|^)\u2019(?=([^\u2018]*\u2018\b)*([^\u2018\u2019]*\W[\u2018\u2019]\b|[^\u2018\u2019]*$))/gi,"$1‘").replace(/'''/g,"‴").replace(/''/g,"″").replace(/'/g,"′"),B=!B,t()})),document.getElementById("genRandPass").addEventListener("click",(()=>{const e=Math.floor(9*Math.random())+8;let a="";for(let t=0;t([{regex:/[a-z]/,range:[97,122]},{regex:/[A-Z]/,range:[65,90]},{regex:/[0-9]/,range:[48,57]},{regex:/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>/?]/,range:[33,47]}].forEach((t=>{if(!t.regex.test(e)){const a=Math.floor(Math.random()*e.length);t=String.fromCharCode(Math.floor(Math.random()*(t.range[1]-t.range[0]+1))+t.range[0]),e=e.substring(0,a)+t+e.substring(a+1)}})),e))(a),t()}));const C=[["އަ","a"],["އާ","aa"],["އި","i"],["އީ","ee"],["އު","u"],["އޫ","oo"],["އެ","e"],["އޭ","ey"],["އޮ","o"],["އޯ","oa"],["ުއް","uh"],["ިއް","ih"],["ެއް","eh"],["ަށް","ah"],["ައް","ah"],["ށް","h"],["ތް","i"],["ާއް","aah"],["އް","h"],["ަ","a"],["ާ","aa"],["ި","i"],["ީ","ee"],["ު","u"],["ޫ","oo"],["ެ","e"],["ޭ","ey"],["ޮ","o"],["ޯ","oa"],["ް",""],["ހ","h"],["ށ","sh"],["ނ","n"],["ރ","r"],["ބ","b"],["ޅ","lh"],["ކ","k"],["އ","a"],["ވ","v"],["މ","m"],["ފ","f"],["ދ","dh"],["ތ","th"],["ލ","l"],["ގ","g"],["ޏ","y"],["ސ","s"],["ޑ","d"],["ޒ","z"],["ޓ","t"],["ޔ","y"],["ޕ","p"],["ޖ","j"],["ޗ","ch"],["ޙ","h"],["ޚ","kh"],["ޛ‎","z"],["ޜ‎","z"],["ޝ‎","sh"],["ޝ","sh"],["ޤ","q"],["ޢ","a"],["ޞ","s"],["ޟ","dh"],["ޡ","z"],["ޠ","t"],["ާާޣ","gh"],["ޘ","th"],["ޛ","dh"],["ާާޜ","z"]];document.getElementById("transliterateDvToEn").addEventListener("click",(()=>{r(),p.value=function(e){e=e.replace(/[\u200B-\u200D\uFEFF]/g,"");for(const[t,a]of C)e=e.replace(new RegExp(t,"g"),a);return e.replace(/(^\s*\w|[.!?]\s*\w)/g,(e=>e.toUpperCase()))}(p.value),n(),t()}));const L=[["ـ",""],["آ","އާ"],["ب","ބ"],["ت","ތ"],["ث","ޘ"],["ج","ޖ"],["ح","ޙ"],["خ","ޚ"],["د","ދ"],["ذ","ޛ"],["ر","ރ"],["ز","ޒ"],["س","ސ"],["ش","ޝ"],["ص","ޞ"],["ض","ޟ"],["ط","ޠ"],["ظ","ޡ"],["ع","ޢ"],["غ","ޣ"],["ف","ފ"],["ق","ޤ"],["ك","ކ"],["ل","ލ"],["م","މ"],["ن","ނ"],["ه","ހ"],["و","ވ"],["ي","ޔ"],["ة","ތ"],["ء","އ"],["أ","އ"],["ؤ","އ"],["إ","އ"],["ئ","އ"],["ى","އ"],["َ","ަ"],["ِ","ި"],["ُ","ު"],["ْ","ް"],["ً","ަން"],["ٍ","ިން"],["ٌ","ުން"],["ަا","ާ"],["اލ","ލ"],["ލއްލަހ","ﷲ"],["ލލހ","ﷲ"],["ލއް","އް"],["ާ އްލަ","ަ އްލަ"],["ا",""],["ުވ","ޫ"],["އ އް"," އް"],["ޫ ލ","ު ލ"],["އްލަލ","އްލަ"],["«",'"'],["»",'"']];document.getElementById("transliterateArToDv").addEventListener("click",(()=>{r(),p.value=function(e){e=e.replace(/(.)ّ/g,((e,t)=>`އް${L.find((([e])=>e===t))?.[1]||t}`)),e=(e=e.replace(/ة([َِ ُ ً ٍ ٌ])/g,"ތ$1")).replace(/ة(?![َِ ُ ً ٍ ٌ])/g,"ހ");for(const[t,a]of L)e=e.replace(new RegExp(t,"g"),a);return e}(p.value),t()}));const w=new class{constructor(){this.ehbari="ސުމެއް އެއް ދެ ތިން ހަތަރު ފަސް ހަ ހަތް އަށް ނުވަ ދިހަ އެގާރަ ބާރަ ތޭރަ ސާދަ ފަނަރަ ސޯޅަ ސަތާރަ އަށާރަ ނަވާރަ ވިހި އެކާވީސް ބާވީސް ތޭވީސް ސައުވީސް ފަންސަވީސް ސައްބީސް ހަތާވީސް އަށާވީސް ނަވާވީސް".split(" "),this.dhihabari="ސުން ދިހަ ވިހި ތިރީސް ސާޅީސް ފަންސާސް ފަސްދޮޅަސް ހައްދިހަ އައްޑިހަ ނުވަދިހަ".split(" "),this.sunbari=["","ހާސް","މިލިޔަން","ބިލިޔަން","ޓްރިލިޔަން"]}convert(e){return e?1e3>(e=parseInt(e))?this.thousandSub(e):this.thousandUp(e):null}thousandSub(e){var t="ސަތޭކަ ";if(0>=e||29>=e)return this.ehbari[e];if(99>=e)return t=Math.floor(e/10),0===(e%=10)?this.dhihabari[t]:`${this.dhihabari[t]} ${this.ehbari[e]}`;if(999>=e){const a=e%100;return 2===(e=Math.floor(e/100))&&(this.ehbari[2]="ދުވި",t="ސައްތަ "),0===a?`${this.ehbari[e]} ${t}`:`${this.ehbari[e]} ${t}${this.thousandSub(a)}`}return""}thousandHalf(e){const t=[];for(;0!==e;)t.push(e%1e3),e=Math.floor(e/1e3);return t}thousandUp(e){var t=this.thousandHalf(e);e=t.length-1;const a=[];for(var n of t.reverse()){t=`${this.thousandSub(n)} `;let r=`${this.sunbari[e]} `;if(" "===t)break;"ސުން "!==t&&"ސުމެއް "!==t||(r=t=""),a.push(t+r),--e}return(n=a.join("")).endsWith(",")&&(n=n.slice(0,-1)),n.trim()}};document.getElementById("Nos2DvTxt").addEventListener("click",(()=>{r();const e=p.value.split("\n").map((e=>{const t=e.match(/\d+/g);return t?t.map((e=>w.convert(e).replace(/\s+/g," ").trim())).join("، "):e.trim()}));p.value=e.filter((e=>0{const e=/[\u07a6-\u07b0]/,t=/[\u064b-\u0650\u0652-\u0656]/,a=/[\u0780-\u07a5]/,n=/[\u064e\u064f\u0650]/,r=p.value.split(/\s+/),l=[];for(let o=0;oe+t.issues.length),0),a=p.value.split(/\s+/),n=`Found ${t} issue${1`;e.forEach(((e,t)=>{const r=a[e.index-1]||"",l=a[e.index+1]||"";let o=e.issues.map((t=>{let a,n;switch(a="multiple"===t.type?`${e.word[t.index-1]||""}${e.word[t.index]} ${e.word[t.index+1]}`:`${e.word[t.index-1]||""} ${e.word[t.index]}`,t.type){case"multiple":n=`Multiple Fili :  ${a}`;break;case"noDvFili":n=`Thaana w/o Fili :  ${a}`;break;case"standalone":n=`Standalone Fili :  ${a}`}return n})).join(", ");n+=`${t+1}. ${r} ${e.word} ${l} : ${o}
`})),x.innerHTML=n}x.style.display="block"}(l)})),document.getElementById("removePunctuation").addEventListener("click",(()=>{r(),p.value=p.value.replace(/[^\w\s]/g,""),t()}));let T=!1;const A={a:"4",e:"3",i:"!",o:"0",t:"7",l:"1",s:"5"},D=Object.fromEntries(Object.entries(A).map((([e,t])=>[t,e])));document.getElementById("toggleLeetSpeak").addEventListener("click",(()=>{p.value=T?p.value.replace(/[43!0715]/g,(e=>D[e])):p.value.toLowerCase().replace(/[aeiotls]/g,(e=>A[e])),T=!T,t(),n()}));const F=document.getElementById("seqMinInput"),M=document.getElementById("seqMaxInput");let j=1,N=10;document.getElementById("generateNumSequence").addEventListener("click",(()=>{"none"===F.style.display?(F.style.display="inline-block",M.style.display="inline-block",F.value=j):(j=parseInt(F.value),N=parseInt(M.value),isNaN(j)&&(j=0),isNaN(N)&&(N=10),j>N&&([j,N]=[N,j],F.value=j,M.value=N));var e="";for(let t=j;t<=N;t++)e+=t+"\n";e=e.trim(),p.value=e})),F.addEventListener("change",(()=>{j=parseInt(F.value),isNaN(j)&&(j=0)})),M.addEventListener("change",(()=>{N=parseInt(M.value),isNaN(N)&&(N=10)}));const R=document.getElementById("RandNoMinInput"),q=document.getElementById("RandNoMaxInput");let U=1,P=10;document.getElementById("randomNum").addEventListener("click",(()=>{"none"===R.style.display?(R.style.display="inline-block",q.style.display="inline-block",R.value=U):(U=parseInt(R.value)||1,P=parseInt(q.value)||10,U>P&&([U,P]=[P,U],R.value=U,q.value=P)),p.value=(Math.floor(Math.random()*(P-U+1))+U).toString(),t()})),R.addEventListener("change",(()=>{U=parseInt(R.value)||1})),q.addEventListener("change",(()=>{P=parseInt(q.value)||10})),document.getElementById("numerateWords").addEventListener("click",(()=>{const e=document.getElementById("textArea");document.getElementById("numerateWords").textContent.includes("No → Wrd")?(e.value=e.value.replace(/\b\d+\b/g,(e=>function(e){const t=" one two three four five six seven eight nine".split(" "),a=" twenty thirty forty fifty sixty seventy eighty ninety".split(" ");var n="ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen".split(" ");return 10>e?t[e]:20>e?n[e-10]:100>e?(n=e%10,a[Math.floor(e/10)]+(n?`-${t[n]}`:"")):e}(parseInt(e)))).replace(/%/g,"percent"),document.getElementById("numerateWords").textContent="Wrd → No"):(e.value=e.value.replace(/\b(?:\w+(?:-\w+)*)\b/g,(e=>{var t=e.toLowerCase();return e={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30,forty:40,fifty:50,sixty:60,seventy:70,eighty:80,ninety:90,hundred:100},t.includes("-")?e=(e[(t=t.split("-"))[0]]||0)+(e[t[1]]||0):e=e[t]||t,e})).replace(/\bpercent\b/g,"%"),document.getElementById("numerateWords").textContent="No → Wrd"),t()}));const z=document.getElementById("repeatInput");document.getElementById("repeatLines").addEventListener("click",(()=>{if("none"===z.style.display)z.style.display="inline-block";else{const e=parseInt(z.value)||1;p.value=Array(e).fill(p.value).join("\n"),t()}}));const H=document.getElementById("prefixInput"),O=document.getElementById("suffixInput");document.getElementById("prefixSuffixToLine").addEventListener("click",(()=>{if("none"===H.style.display)H.style.display="inline-block",O.style.display="inline-block";else{const e=H.value,a=O.value,n=p.value.split("\n").map((t=>e+t+a));p.value=n.join("\n"),t()}}));const W=document.getElementById("removeFromStart"),Z=document.getElementById("removeFromEnd");document.getElementById("rmvNoOfCharsPerLine").addEventListener("click",(()=>{if("none"===W.style.display)W.style.display="inline-block",Z.style.display="inline-block";else{const e=parseInt(W.value)||0,a=parseInt(Z.value)||0,n=p.value.split("\n").map((t=>t.length<=e+a?"":t.slice(e,t.length-a)));p.value=n.join("\n"),t()}}));const _=document.getElementById("findInput"),J=document.getElementById("replaceInput");document.getElementById("findAndReplaceText").addEventListener("click",(()=>{var e=_.value;const a=J.value;e&&(e=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),p.value=p.value.replace(e,a),t())})),document.getElementById("diffCompare").addEventListener("click",(()=>{window.open("diffCompare.html","_blank")})),document.getElementById("keyboardPage").addEventListener("click",(()=>{window.open("keyboardPage.html","_blank")})),document.getElementById("qrGenerator").addEventListener("click",(()=>{window.open("qrGenerator.html","_blank")})),document.getElementById("fullscreen").addEventListener("click",(()=>{document.fullscreenElement?(document.exitFullscreen(),p.style.height="300px"):(document.documentElement.requestFullscreen(),p.style.height="100vh")})),document.addEventListener("fullscreenchange",(()=>{document.fullscreenElement||(p.style.height="300px")})),o(),setInterval(o,6e4),document.getElementById("toggleMilitaryTime").addEventListener("click",(()=>{const e="true"===localStorage.getItem("militaryTime");localStorage.setItem("militaryTime",!e),o()})),p.addEventListener("input",(e=>{const t=e.target.selectionStart;var a=e.target.value.substring(0,t);"ss-"===a.split(/\s/).pop()&&(a=a.replace(/ss-$/,"ﷺ")+e.target.value.substring(t),e.target.value=a,e.target.setSelectionRange(t,t))})),document.querySelectorAll(".copy-button, .copy-button-lit, .copy-button-other").forEach((e=>{e.addEventListener("click",(async()=>{const t=e.dataset.text||e.textContent.trim();try{await navigator.clipboard.writeText(t),c(e,"Copied")}catch(e){console.error("Failed to copy:",e)}}))})),document.querySelectorAll("button").forEach((e=>{e.addEventListener("click",(t=>{e.closest(".dropdown-button")||c(e,"Clicked")}))}));var Q=JSON.parse(localStorage.getItem("editorTabs"));Q&&(I=Q,I.forEach((e=>{if(1{I[$-1].content=p.value,localStorage.setItem("editorTabs",JSON.stringify(I)),localStorage.setItem("currentTab",$)}),5e3),t();const G=document.getElementById("calcArea"),K=document.getElementById("addCalcTab"),V=document.querySelector(".calc-numbered-tabs");if(G&&K&&V){let ye=1,be=[{id:1,content:""}];const he=document.getElementById("sumTotal"),Ee=document.getElementById("zakatAmount"),fe=document.getElementById("lineResults"),ke=document.getElementById("copyTotal"),$e=document.getElementById("clearCalc");function Y(){let e=0,t="";G.value.split("\n").forEach((a=>{a=function(e){let t=e.match(/[+-]?\d*\.?\d+(?:,\d{3})*(?:\d*\.?\d+)?/g)||[];e=e.match(/[\+\-\*x\/÷]/g)||[],t=t.map((e=>parseFloat(e.replace(/,/g,""))));for(let a=0;ae+t),0)}(a),e+=a,t+=`${e.toFixed(2)}\n`})),he.textContent=e.toFixed(2),Ee.textContent=(.025*e).toFixed(2),fe.textContent=t}function X(e){be[ye-1].content=G.value,ye=e,G.value=be[ye-1].content,document.querySelectorAll(".calc-numbered-tab").forEach((t=>{t.classList.toggle("active",parseInt(t.dataset.tab)===e)})),Y()}K.addEventListener("click",(()=>{const e=be.length+1;be.push({id:e,content:""});const t=document.createElement("button");t.classList.add("calc-numbered-tab"),t.dataset.tab=e,t.textContent=e,V.insertBefore(t,K),X(e)})),V.addEventListener("click",(e=>{e.target.classList.contains("calc-numbered-tab")&&X(e=parseInt(e.target.dataset.tab))})),G.addEventListener("input",Y),ke.addEventListener("click",(()=>{navigator.clipboard.writeText(he.textContent),c(ke,"Copied")})),$e.addEventListener("click",(()=>{G.value="",fe.textContent="",he.textContent="0.00",Ee.textContent="0.00",be=[{id:1,content:""}],ye=1;const e=V.querySelectorAll(".calc-numbered-tab");e.forEach((e=>{"1"!==e.dataset.tab&&e.remove()})),e[0].classList.add("active"),c($e,"Cleared")})),(Q=JSON.parse(localStorage.getItem("calculatorTabs")))&&(be=Q,be.forEach((e=>{if(1{be[ye-1].content=G.value,localStorage.setItem("calculatorTabs",JSON.stringify(be)),localStorage.setItem("currentCalcTab",ye)}),5e3)}const ee=document.querySelector(".proportion-container"),te=document.getElementById("addPropTab"),ae=document.querySelector(".prop-numbered-tabs");if(ee&&te&&ae){let Ie=1,Se=[{id:1,content:ee.innerHTML}];function ne(){document.querySelectorAll(".proportion-set").forEach((e=>{e.querySelectorAll(".prop-input").forEach((t=>{t.addEventListener("input",(()=>function(e){if(e=e.querySelectorAll(".prop-input"),3<=Array.from(e).filter((e=>""!==e.value)).length){const t=e[0].value,a=e[1].value,n=e[2].value;t&&a&&n&&(e[3].value=(a/t*n).toFixed(2))}else e[3].value=""}(e)))}))}))}function re(e){Se[Ie-1].content=ee.innerHTML,Ie=e,ee.innerHTML=Se[Ie-1].content,document.querySelectorAll(".prop-numbered-tab").forEach((t=>{t.classList.toggle("active",parseInt(t.dataset.tab)===e)})),ne()}te.addEventListener("click",(()=>{const e=Se.length+1;Se.push({id:e,content:ee.innerHTML});const t=document.createElement("button");t.classList.add("prop-numbered-tab"),t.dataset.tab=e,t.textContent=e,ae.insertBefore(t,te),re(e)})),ae.addEventListener("click",(e=>{e.target.classList.contains("prop-numbered-tab")&&re(e=parseInt(e.target.dataset.tab))})),ne(),(Q=JSON.parse(localStorage.getItem("proportionTabs")))&&(Se=Q,Se.forEach((e=>{if(1{Se[Ie-1].content=ee.innerHTML,localStorage.setItem("proportionTabs",JSON.stringify(Se)),localStorage.setItem("currentPropTab",Ie)}),5e3);const Be=document.getElementById("clearProp");Be.addEventListener("click",(()=>{document.querySelectorAll(".proportion-set").forEach((e=>{e.querySelectorAll(".prop-input").forEach(((e,t)=>{e.value=2===t?"1":""}))})),Se=[{id:1,content:ee.innerHTML}],Ie=1;const e=ae.querySelectorAll(".prop-numbered-tab");e.forEach((e=>{"1"!==e.dataset.tab&&e.remove()})),e[0].classList.add("active"),c(Be,"Cleared")}))}let le="true"===localStorage.getItem("nightCalcMilitaryTime");document.getElementById("maghribTime").addEventListener("change",s),document.getElementById("fajrTime").addEventListener("change",s),document.getElementById("toggleNightCalcFormat").addEventListener("click",(()=>{le=!le,localStorage.setItem("nightCalcMilitaryTime",le),s()}));const oe=e=>btoa(new Uint8Array(e).reduce(((e,t)=>e+String.fromCharCode(t)),"")),ce=e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(null))),se=new TextEncoder,ue=new TextDecoder,ie=e=>window.crypto.subtle.importKey("raw",se.encode(e||"empty"),"PBKDF2",!1,["deriveKey"]),de=(e,t,a)=>window.crypto.subtle.deriveKey({name:"PBKDF2",salt:t,iterations:25e4,hash:"SHA-256"},e,{name:"AES-GCM",length:256},!1,a),me=document.getElementById("encryptButton"),pe=document.getElementById("decryptButton"),ge=document.getElementById("copyEncrypted"),ve=document.getElementById("copyDecrypted");me&&me.addEventListener("click",(async()=>{const e=document.getElementById("textToEncrypt").value,t=document.getElementById("encryptPassword").value;if(e)try{const a=await async function(e,t){if(!e)throw Error("No data to encrypt");try{const a=window.crypto.getRandomValues(new Uint8Array(16)),n=window.crypto.getRandomValues(new Uint8Array(12)),r=await ie(t),l=await de(r,a,["encrypt"]),o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},l,se.encode(e)),c=new Uint8Array(o);let s=new Uint8Array(a.byteLength+n.byteLength+c.byteLength);return s.set(a,0),s.set(n,a.byteLength),s.set(c,a.byteLength+n.byteLength),oe(s)}catch(e){throw console.error(`Encryption error: ${e}`),e}}(e,t);document.getElementById("encryptedText").value=a,c(me,"Encrypted")}catch(e){console.error("Encryption failed:",e),c(me,"Encryption failed")}else c(me,"Please enter text to encrypt")})),pe&&pe.addEventListener("click",(async()=>{const e=document.getElementById("textToDecrypt").value,t=document.getElementById("decryptPassword").value;if(e)try{const a=await async function(e,t){if(!e)throw Error("No data to decrypt");try{const a=ce(e),n=a.slice(0,16),r=a.slice(16,28),l=a.slice(28),o=await ie(t),c=await de(o,n,["decrypt"]),s=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:r},c,l);return ue.decode(s)}catch(e){throw console.error(`Decryption error: ${e}`),e}}(e,t);document.getElementById("decryptedText").value=a||"Decryption failed",c(pe,a?"Decrypted":"Failed")}catch(e){console.error("Decryption failed:",e),c(pe,"Decryption failed"),document.getElementById("decryptedText").value="Decryption failed"}else c(pe,"Please enter text to decrypt")})),ge&&ge.addEventListener("click",(()=>{const e=document.getElementById("encryptedText").value;e&&(navigator.clipboard.writeText(e),c(ge,"Copied"))})),ve&&ve.addEventListener("click",(()=>{const e=document.getElementById("decryptedText").value;e&&(navigator.clipboard.writeText(e),c(ve,"Copied"))}))})); \ No newline at end of file