<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Question Editor</title>
    <script src="https://www.gstatic.com/firebasejs/9.6.1/firebase-app-compat.js"></script>
    <script src="https://www.gstatic.com/firebasejs/9.6.1/firebase-firestore-compat.js"></script>
    <script src="https://www.gstatic.com/firebasejs/9.6.1/firebase-storage-compat.js"></script>
    <script src="https://www.gstatic.com/firebasejs/9.6.1/firebase-auth-compat.js"></script>
    <script src="https://cdn.tailwindcss.com"></script>
    
</head>
<body class="bg-gray-50">
    <!-- Auth Container -->
    <div id="authContainer" class="min-h-screen flex items-center justify-center p-6">
        <div class="max-w-md w-full">
            <!-- Login Form -->
            <div id="loginForm" class="bg-white rounded-lg shadow-sm p-8">
                <h2 class="text-2xl font-bold text-gray-900 mb-6">Login</h2>
                <form onsubmit="handleLogin(event)" class="space-y-4">
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-1">Email</label>
                        <input type="email" id="loginEmail" required 
                            class="w-full rounded-md border-gray-300 shadow-sm focus:border-green-500 focus:ring-green-500">
                    </div>
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-1">Password</label>
                        <input type="password" id="loginPassword" required 
                            class="w-full rounded-md border-gray-300 shadow-sm focus:border-green-500 focus:ring-green-500">
                    </div>
                    <button type="submit" 
                        class="w-full bg-green-600 text-white px-4 py-2 rounded-md hover:bg-green-700 transition-colors">
                        Login
                    </button>
                </form>
            </div>
        </div>
    </div>

    <!-- Main Application -->
    <div id="appContainer" class="hidden min-h-screen">
        <nav class="bg-white shadow-sm">
            <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
                <div class="flex justify-between h-16">
                    <div class="flex items-center">
                        <h1 class="text-xl font-bold text-gray-900">Question Editor</h1>
                    </div>
                    <div class="flex items-center space-x-4">
                        <span id="userEmail" class="text-gray-600"></span>
                        <button onclick="handleLogout()" 
                            class="bg-red-600 text-white px-4 py-2 rounded-md hover:bg-red-700 transition-colors">
                            Logout
                        </button>
                    </div>
                </div>
            </div>
        </nav>

        <div class="p-6">
            <div class="max-w-4xl mx-auto">
                <!-- Question ID Input -->
                <div class="bg-white rounded-lg shadow-sm p-6 mb-6">
                    <div class="flex gap-4">
                        <input type="text" id="questionId" placeholder="Enter question ID" 
                            class="flex-1 rounded-md border-gray-300 shadow-sm focus:border-green-500 focus:ring-green-500">
                        <button onclick="loadQuestion()" 
                            class="bg-green-600 text-white px-6 py-2 rounded-md hover:bg-green-700 transition-colors">
                            Load Question
                        </button>
                    </div>
                </div>

                <!-- Editor Form -->
                <div id="editorForm" class="bg-white rounded-lg shadow-sm p-6 hidden">
                    <form id="questionEditForm" class="space-y-6">
                        <!-- Subject -->
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-1">Subject</label>
                            <select id="subject" class="w-full rounded-md border-gray-300 shadow-sm focus:border-green-500 focus:ring-green-500">
                                <option value="PHYSICS">Physics</option>
                                <option value="CHEMISTRY">Chemistry</option>
                                <option value="MATHS">Mathematics</option>
                            </select>
                        </div>

                        <!-- Chapter -->
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-1">Chapter</label>
                            <input type="text" id="chapter" 
                                class="w-full rounded-md border-gray-300 shadow-sm focus:border-green-500 focus:ring-green-500">
                        </div>

                        <!-- Question Text -->
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-1">Question Text</label>
                            <textarea id="questionText" rows="4" 
                                class="w-full rounded-md border-gray-300 shadow-sm focus:border-green-500 focus:ring-green-500"></textarea>
                        </div>

                        <!-- Current Attachments -->
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">Current Attachments</label>
                            <div id="currentAttachments" class="grid grid-cols-1 md:grid-cols-2 gap-4"></div>
                        </div>

                        <!-- New Attachments -->
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-1">Add New Attachments</label>
                            <input type="file" id="newAttachments" multiple 
                                class="block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-green-50 file:text-green-700 hover:file:bg-green-100">
                            <div id="newAttachmentsPreview" class="mt-2 grid grid-cols-2 gap-4"></div>
                        </div>

                        <!-- Save and Delete Buttons -->
                    <div class="flex justify-between mt-6">
                        <button onclick="handleDeleteQuestion()" 
                            class="bg-red-600 text-white px-6 py-2 rounded-md hover:bg-red-700 transition-colors">
                            Delete Question
                        </button>
                        <button type="submit" 
                            class="bg-green-600 text-white px-6 py-2 rounded-md hover:bg-green-700 transition-colors">
                            Save Changes
                        </button>
                    </div>
                     <!-- Delete Confirmation Modal -->
                     <div id="deleteModal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full">
                        <div class="relative top-20 mx-auto p-5 border w-96 shadow-lg rounded-md bg-white">
                            <div class="mt-3 text-center">
                                <h3 class="text-lg leading-6 font-medium text-gray-900">Delete Question</h3>
                                <div class="mt-2 px-7 py-3">
                                    <p class="text-sm text-gray-500">
                                        Are you sure you want to delete this question? This action cannot be undone.
                                    </p>
                                </div>
                                <div class="items-center px-4 py-3">
                                    <button id="confirmDelete" 
                                        class="px-4 py-2 bg-red-600 text-white text-base font-medium rounded-md shadow-sm hover:bg-red-700 mr-2">
                                        Delete
                                    </button>
                                    <button id="cancelDelete"
                                        class="px-4 py-2 bg-gray-500 text-white text-base font-medium rounded-md shadow-sm hover:bg-gray-600">
                                        Cancel
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                    </form>
                </div>

                <!-- Loading State -->
                <div id="loadingState" class="hidden">
                    <div class="flex justify-center items-center p-12">
                        <div class="loading w-12 h-12 border-4 border-green-500 border-t-transparent rounded-full"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        const _0x52fe64=_0x11fb;(function(_0x4e2bea,_0xf93da0){const _0x21a79d=_0x11fb,_0x49bba7=_0x4e2bea();while(!![]){try{const _0x466609=-parseInt(_0x21a79d(0x11b))/0x1*(parseInt(_0x21a79d(0x116))/0x2)+-parseInt(_0x21a79d(0xde))/0x3*(-parseInt(_0x21a79d(0xab))/0x4)+-parseInt(_0x21a79d(0xfd))/0x5*(-parseInt(_0x21a79d(0xb7))/0x6)+-parseInt(_0x21a79d(0xc2))/0x7*(-parseInt(_0x21a79d(0xef))/0x8)+parseInt(_0x21a79d(0xae))/0x9+parseInt(_0x21a79d(0xc5))/0xa*(-parseInt(_0x21a79d(0xfc))/0xb)+parseInt(_0x21a79d(0xc6))/0xc*(-parseInt(_0x21a79d(0xd6))/0xd);if(_0x466609===_0xf93da0)break;else _0x49bba7['push'](_0x49bba7['shift']());}catch(_0x4afeae){_0x49bba7['push'](_0x49bba7['shift']());}}}(_0x2cf0,0x1f2da));const _0x21b7cd=(function(){let _0x257998=!![];return function(_0x2be00b,_0x1a3f51){const _0x269dac=_0x257998?function(){const _0x588e03=_0x11fb;if(_0x1a3f51){const _0x4fd4f8=_0x1a3f51[_0x588e03(0xff)](_0x2be00b,arguments);return _0x1a3f51=null,_0x4fd4f8;}}:function(){};return _0x257998=![],_0x269dac;};}()),_0x45628c=_0x21b7cd(this,function(){const _0x2ede54=_0x11fb,_0x1b960f=function(){const _0x13f8ff=_0x11fb;let _0x699d5a;try{_0x699d5a=Function('return\x20(function()\x20'+_0x13f8ff(0x11d)+');')();}catch(_0x407d59){_0x699d5a=window;}return _0x699d5a;},_0x1c81be=_0x1b960f(),_0x4b1a98=new RegExp(_0x2ede54(0x11a),'g'),_0x515614='hnFdwsZ-dGb.vijxAeIrcyLILejqXhPGSl.apApEEFjuMLLxKk'['replace'](_0x4b1a98,'')[_0x2ede54(0xdf)](';');let _0x25f38b,_0x475f36,_0x956a34,_0x123c2d;const _0x44dc26=function(_0x70c7b1,_0x585a15,_0x56ae5b){const _0x4c0b77=_0x2ede54;if(_0x70c7b1[_0x4c0b77(0x111)]!=_0x585a15)return![];for(let _0x3c0914=0x0;_0x3c0914<_0x585a15;_0x3c0914++){for(let _0x4ef7b3=0x0;_0x4ef7b3<_0x56ae5b[_0x4c0b77(0x111)];_0x4ef7b3+=0x2){if(_0x3c0914==_0x56ae5b[_0x4ef7b3]&&_0x70c7b1[_0x4c0b77(0x11e)](_0x3c0914)!=_0x56ae5b[_0x4ef7b3+0x1])return![];}}return!![];},_0x48d443=function(_0x5801b8,_0x5847e6,_0x34ea26){return _0x44dc26(_0x5847e6,_0x34ea26,_0x5801b8);},_0x44c86d=function(_0x403902,_0x3bb598,_0x224bfc){return _0x48d443(_0x3bb598,_0x403902,_0x224bfc);},_0x12d612=function(_0x167abc,_0x2e26af,_0x198829){return _0x44c86d(_0x2e26af,_0x198829,_0x167abc);};for(let _0x1c980b in _0x1c81be){if(_0x44dc26(_0x1c980b,0x8,[0x7,0x74,0x5,0x65,0x3,0x75,0x0,0x64])){_0x25f38b=_0x1c980b;break;}}for(let _0x5dd895 in _0x1c81be[_0x25f38b]){if(_0x12d612(0x6,_0x5dd895,[0x5,0x6e,0x0,0x64])){_0x475f36=_0x5dd895;break;}}for(let _0x22aa70 in _0x1c81be[_0x25f38b]){if(_0x44c86d(_0x22aa70,[0x7,0x6e,0x0,0x6c],0x8)){_0x956a34=_0x22aa70;break;}}if(!('~'>_0x475f36))for(let _0x2663fc in _0x1c81be[_0x25f38b][_0x956a34]){if(_0x48d443([0x7,0x65,0x0,0x68],_0x2663fc,0x8)){_0x123c2d=_0x2663fc;break;}}if(!_0x25f38b||!_0x1c81be[_0x25f38b])return;const _0x24c6a6=_0x1c81be[_0x25f38b][_0x475f36],_0x266ab6=!!_0x1c81be[_0x25f38b][_0x956a34]&&_0x1c81be[_0x25f38b][_0x956a34][_0x123c2d],_0x1a2524=_0x24c6a6||_0x266ab6;if(!_0x1a2524)return;let _0x44776a=![];for(let _0x4c1ae2=0x0;_0x4c1ae2<_0x515614[_0x2ede54(0x111)];_0x4c1ae2++){const _0x5f0abd=_0x515614[_0x4c1ae2],_0x2c6550=_0x5f0abd[0x0]===String[_0x2ede54(0xd8)](0x2e)?_0x5f0abd[_0x2ede54(0xf9)](0x1):_0x5f0abd,_0x50b6b7=_0x1a2524['length']-_0x2c6550[_0x2ede54(0x111)],_0xa034b6=_0x1a2524['indexOf'](_0x2c6550,_0x50b6b7),_0x5b345d=_0xa034b6!==-0x1&&_0xa034b6===_0x50b6b7;_0x5b345d&&((_0x1a2524['length']==_0x5f0abd[_0x2ede54(0x111)]||_0x5f0abd[_0x2ede54(0xd9)]('.')===0x0)&&(_0x44776a=!![]));}if(!_0x44776a){const _0x24397c=new RegExp(_0x2ede54(0xbf),'g'),_0x4e341f=_0x2ede54(0xeb)[_0x2ede54(0x10d)](_0x24397c,'');_0x1c81be[_0x25f38b][_0x956a34]=_0x4e341f;}});function _0x11fb(_0x375913,_0x155792){const _0x30a1ff=_0x2cf0();return _0x11fb=function(_0x45628c,_0x21b7cd){_0x45628c=_0x45628c-0xa8;let _0xe0c091=_0x30a1ff[_0x45628c];return _0xe0c091;},_0x11fb(_0x375913,_0x155792);}_0x45628c();const firebaseConfig={'apiKey':_0x52fe64(0xdd),'projectId':_0x52fe64(0xf6),'storageBucket':_0x52fe64(0xb6)};firebase[_0x52fe64(0xbd)](firebaseConfig);const db=firebase[_0x52fe64(0x10c)](),storage=firebase[_0x52fe64(0xb3)](),auth=firebase['auth']();auth['onAuthStateChanged'](_0x5d8ba9=>{const _0x566106=_0x52fe64;_0x5d8ba9?(document[_0x566106(0xf7)](_0x566106(0xe3))[_0x566106(0x102)]['add'](_0x566106(0xea)),document[_0x566106(0xf7)](_0x566106(0xd5))[_0x566106(0x102)]['remove'](_0x566106(0xea)),document[_0x566106(0xf7)](_0x566106(0xfb))['textContent']=_0x5d8ba9[_0x566106(0xbe)]):(document[_0x566106(0xf7)](_0x566106(0xe3))[_0x566106(0x102)][_0x566106(0x113)](_0x566106(0xea)),document[_0x566106(0xf7)](_0x566106(0xd5))[_0x566106(0x102)][_0x566106(0xac)](_0x566106(0xea)),document[_0x566106(0xf7)](_0x566106(0xfb))[_0x566106(0x119)]='');});async function handleLogin(_0xfb790e){const _0x429afa=_0x52fe64;_0xfb790e[_0x429afa(0xb4)]();const _0x11cc65=document[_0x429afa(0xf7)](_0x429afa(0x10a))['value'],_0x26e28b=document[_0x429afa(0xf7)](_0x429afa(0xaa))[_0x429afa(0xc4)];try{await auth[_0x429afa(0xfe)](_0x11cc65,_0x26e28b);}catch(_0x4d5dba){alert(_0x429afa(0xe9)+_0x4d5dba['message']);}}async function handleLogout(){const _0x34a436=_0x52fe64;try{await auth[_0x34a436(0x108)](),location['reload']();}catch(_0x23a41e){alert(_0x34a436(0xca)+_0x23a41e[_0x34a436(0x11c)]);}}function toggleLoading(_0x967b83){const _0x3a7fda=_0x52fe64;document[_0x3a7fda(0xf7)](_0x3a7fda(0xd7))[_0x3a7fda(0x102)][_0x3a7fda(0xcb)]('hidden',!_0x967b83),document[_0x3a7fda(0xf7)](_0x3a7fda(0xe1))[_0x3a7fda(0x102)][_0x3a7fda(0xcb)](_0x3a7fda(0xea),_0x967b83);}let currentFiles=[];async function loadQuestion(){const _0x39a25f=_0x52fe64;if(!auth[_0x39a25f(0x10f)]){alert('Please\x20login\x20first');return;}const _0x7d0420=document[_0x39a25f(0xf7)](_0x39a25f(0xb8))[_0x39a25f(0xc4)][_0x39a25f(0x101)]();if(!_0x7d0420){alert(_0x39a25f(0x117));return;}toggleLoading(!![]);try{const _0x7cb672=await db['collection'](_0x39a25f(0x115))[_0x39a25f(0xe6)](_0x7d0420)[_0x39a25f(0xc3)]();if(!_0x7cb672[_0x39a25f(0xf5)]){alert('Question\x20not\x20found');return;}const _0x4dc32b=_0x7cb672[_0x39a25f(0x110)]();document['getElementById'](_0x39a25f(0xbb))[_0x39a25f(0xc4)]=_0x4dc32b[_0x39a25f(0xbb)]||'',document[_0x39a25f(0xf7)](_0x39a25f(0xba))[_0x39a25f(0xc4)]=_0x4dc32b[_0x39a25f(0xba)]||'',document[_0x39a25f(0xf7)](_0x39a25f(0x105))[_0x39a25f(0xc4)]=_0x4dc32b[_0x39a25f(0x105)]||'',currentFiles=_0x4dc32b[_0x39a25f(0x112)]||[];const _0x3f9ed5=document[_0x39a25f(0xf7)](_0x39a25f(0xe4));_0x3f9ed5[_0x39a25f(0x109)]='',currentFiles[_0x39a25f(0x111)]>0x0&&currentFiles[_0x39a25f(0x107)]((_0x36caa2,_0x5792c4)=>{const _0x55ac92=_0x39a25f,_0xdd2d67=_0x36caa2[_0x55ac92(0xcc)]['match'](/\.(jpg|jpeg|png|gif)$/i),_0x83bc73=document[_0x55ac92(0xa8)](_0x55ac92(0xe8));_0x83bc73[_0x55ac92(0xaf)]=_0x55ac92(0xee),_0x83bc73['innerHTML']=_0x55ac92(0x106)+(_0xdd2d67?_0x55ac92(0xce)+_0x36caa2[_0x55ac92(0xcc)]+'\x22\x20alt=\x22'+_0x36caa2['name']+'\x22\x20class=\x22w-full\x20h-32\x20object-cover\x20rounded\x20mb-2\x22>':_0x55ac92(0x10e))+_0x55ac92(0xc8)+_0x36caa2[_0x55ac92(0xe7)]+'</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20onclick=\x22removeAttachment('+_0x5792c4+_0x55ac92(0xec)+_0x36caa2[_0x55ac92(0xcc)]+_0x55ac92(0xd3),_0x3f9ed5[_0x55ac92(0xad)](_0x83bc73);}),toggleLoading(![]);}catch(_0x2efdf3){console[_0x39a25f(0x100)](_0x39a25f(0x103),_0x2efdf3),alert(_0x39a25f(0xd4)),toggleLoading(![]);}}async function removeAttachment(_0x49e58d,_0x380673){const _0x3d7127=_0x52fe64;try{const _0x2778b4=storage['refFromURL'](_0x380673);await _0x2778b4['delete']();const _0x3e4d87=document[_0x3d7127(0xf7)](_0x3d7127(0xe4));_0x3e4d87['children'][_0x49e58d][_0x3d7127(0x113)](),currentFiles=currentFiles['filter']((_0x1ae8eb,_0x150dff)=>_0x150dff!==_0x49e58d);const _0x8e54ea=document[_0x3d7127(0xf7)](_0x3d7127(0xb8))[_0x3d7127(0xc4)]['trim']();await db['collection'](_0x3d7127(0x115))['doc'](_0x8e54ea)[_0x3d7127(0xf0)]({'files':currentFiles}),alert('File\x20deleted\x20successfully!');}catch(_0x440549){console['error'](_0x3d7127(0xf8),_0x440549),alert(_0x3d7127(0xb2));}}function _0x2cf0(){const _0x11583c=['Error\x20updating\x20question:','exists','ds-summaries','getElementById','Error\x20deleting\x20file:','slice','</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','userEmail','1307339kawHpc','438470uEuvEx','signInWithEmailAndPassword','apply','error','trim','classList','Error\x20loading\x20question:','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22h-32\x20flex\x20items-center\x20justify-center\x20bg-gray-100\x20rounded\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22w-8\x20h-8\x20text-gray-400\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20viewBox=\x220\x200\x2024\x2024\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22\x20stroke-width=\x222\x22\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20d=\x22M9\x2012h6m-6\x204h6m2\x205H7a2\x202\x200\x2001-2-2V5a2\x202\x200\x20012-2h5.586a1\x201\x200\x2001.707.293l5.414\x205.414a1\x201\x200\x2001.293.707V19a2\x202\x200\x2001-2\x202z\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22text-sm\x20text-gray-600\x20truncate\x22>','questionText','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','forEach','signOut','innerHTML','loginEmail','change','firestore','replace','<div\x20class=\x22h-32\x20flex\x20items-center\x20justify-center\x20bg-gray-100\x20rounded\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22w-8\x20h-8\x20text-gray-400\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20viewBox=\x220\x200\x2024\x2024\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22\x20stroke-width=\x222\x22\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20d=\x22M9\x2012h6m-6\x204h6m2\x205H7a2\x202\x200\x2001-2-2V5a2\x202\x200\x20012-2h5.586a1\x201\x200\x2001.707.293l5.414\x205.414a1\x201\x200\x2001.293.707V19a2\x202\x200\x2001-2\x202z\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','currentUser','data','length','files','remove','newAttachmentsPreview','questions','85350YaDOmw','Please\x20enter\x20a\x20question\x20ID','Question\x20deleted\x20successfully!','textContent','[hnFwZGijxAIyLILjqXhPGSAEEFjuMLLxKk]','5MyHaKE','message','{}.constructor(\x22return\x20this\x22)(\x20)','charCodeAt','createElement','questionEditForm','loginPassword','2012qEzSxb','add','appendChild','1104021SXvToj','className','collection','now','Error\x20deleting\x20file.\x20Please\x20try\x20again.','storage','preventDefault','Error\x20deleting\x20question:\x20','ds-summaries.appspot.com','6vaLgOy','questionId','newAttachments','chapter','subject','image/','initializeApp','email','[YNuZEyUQUbnNIFKBfxDfuKHSxNfDBzHFIKTRnFIgUuUHQyuTGVNkuKNRKLKqqDkMbMnXnzPMOAAjGAFUIqqXMUgM]','addEventListener','startsWith','7HqpBzL','get','value','10gahMOW','1452nOnIEK','deleteModal','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22text-sm\x20text-gray-600\x20truncate\x22>','toISOString','Logout\x20failed:\x20','toggle','url','refFromURL','<img\x20src=\x22','delete','from','push','file-preview\x20border\x20rounded-lg\x20p-4','\x27)\x22\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20class=\x22absolute\x20top-2\x20right-2\x20bg-red-500\x20text-white\x20p-1\x20rounded-full\x20hover:bg-red-600\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22w-4\x20h-4\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20viewBox=\x220\x200\x2024\x2024\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22\x20stroke-width=\x222\x22\x20d=\x22M6\x2018L18\x206M6\x206l12\x2012\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Error\x20loading\x20question.\x20Please\x20try\x20again.','appContainer','286DztyyJ','loadingState','fromCharCode','indexOf','\x22\x20class=\x22w-full\x20h-32\x20object-cover\x20rounded\x20mb-2\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22text-sm\x20text-gray-600\x20truncate\x22>','result','Please\x20login\x20first','AIzaSyDBvlETwS3_4zy40inkdL49CpqM5TnapOc','822cxeJYF','split','type','editorForm','readAsDataURL','authContainer','currentAttachments','ref','doc','name','div','Login\x20failed:\x20','hidden','hYtNtuZps:E//ds-paradyUisQUe.vbnNIFeKBrfcexDlfu.Kapp/HSexNrfDBrzHFIKTRor.nhFIgUutUHQmyulTGVNkuKNRKLKqqDkMbMnXnzPMOAAjGAFUIqqXMUgM',',\x20\x27','Error\x20deleting\x20question:','file-preview\x20border\x20rounded-lg\x20p-4\x20relative','915256IeDnaI','update','confirmDelete','</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','target'];_0x2cf0=function(){return _0x11583c;};return _0x2cf0();}document[_0x52fe64(0xf7)](_0x52fe64(0xb9))[_0x52fe64(0xc0)](_0x52fe64(0x10b),_0x17924b=>{const _0x57201e=_0x52fe64,_0x11549c=document[_0x57201e(0xf7)]('newAttachmentsPreview');_0x11549c[_0x57201e(0x109)]='',Array[_0x57201e(0xd0)](_0x17924b[_0x57201e(0xf3)]['files'])['forEach'](_0x31fbfe=>{const _0x116e21=_0x57201e,_0x111529=new FileReader(),_0x1f3f2c=document[_0x116e21(0xa8)](_0x116e21(0xe8));_0x1f3f2c['className']=_0x116e21(0xd2),_0x31fbfe[_0x116e21(0xe0)][_0x116e21(0xc1)](_0x116e21(0xbc))?(_0x111529['onload']=_0x1b0be0=>{const _0x4edc2d=_0x116e21;_0x1f3f2c[_0x4edc2d(0x109)]='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<img\x20src=\x22'+_0x1b0be0[_0x4edc2d(0xf3)][_0x4edc2d(0xdb)]+_0x4edc2d(0xda)+_0x31fbfe[_0x4edc2d(0xe7)]+_0x4edc2d(0xf2);},_0x111529[_0x116e21(0xe2)](_0x31fbfe)):_0x1f3f2c[_0x116e21(0x109)]=_0x116e21(0x104)+_0x31fbfe[_0x116e21(0xe7)]+_0x116e21(0xfa),_0x11549c[_0x116e21(0xad)](_0x1f3f2c);});}),document[_0x52fe64(0xf7)]('questionEditForm')[_0x52fe64(0xc0)]('submit',async _0x114dbf=>{const _0x4fde72=_0x52fe64;_0x114dbf['preventDefault']();const _0x128ced=document[_0x4fde72(0xf7)](_0x4fde72(0xb8))[_0x4fde72(0xc4)][_0x4fde72(0x101)]();if(!auth[_0x4fde72(0x10f)]){alert(_0x4fde72(0xdc));return;}toggleLoading(!![]);try{const _0x128511=document[_0x4fde72(0xf7)]('newAttachments')[_0x4fde72(0x112)],_0x38a0de=[];for(const _0x190ec0 of _0x128511){const _0x1e8d2d=storage[_0x4fde72(0xe5)]('questions/'+Date[_0x4fde72(0xb1)]()+'_'+_0x190ec0['name']);await _0x1e8d2d['put'](_0x190ec0);const _0x55e8b0=await _0x1e8d2d['getDownloadURL']();_0x38a0de[_0x4fde72(0xd1)]({'name':_0x190ec0[_0x4fde72(0xe7)],'url':_0x55e8b0,'type':_0x190ec0['type'],'uploadedAt':new Date()[_0x4fde72(0xc9)]()});}const _0x2f9b67=[...currentFiles,..._0x38a0de];await db[_0x4fde72(0xb0)](_0x4fde72(0x115))[_0x4fde72(0xe6)](_0x128ced)[_0x4fde72(0xf0)]({'subject':document['getElementById']('subject')['value'],'chapter':document['getElementById'](_0x4fde72(0xba))['value'],'questionText':document[_0x4fde72(0xf7)]('questionText')[_0x4fde72(0xc4)],'files':_0x2f9b67,'lastEdited':new Date()[_0x4fde72(0xc9)](),'editedBy':auth['currentUser'][_0x4fde72(0xbe)]}),alert('Question\x20updated\x20successfully!'),document['getElementById'](_0x4fde72(0xb9))[_0x4fde72(0xc4)]='',document[_0x4fde72(0xf7)](_0x4fde72(0x114))[_0x4fde72(0x109)]='',await loadQuestion();}catch(_0x13e0f4){console[_0x4fde72(0x100)](_0x4fde72(0xf4),_0x13e0f4),alert('Error\x20updating\x20question:\x20'+_0x13e0f4[_0x4fde72(0x11c)]);}finally{toggleLoading(![]);}});function showDeleteModal(){const _0xe8aa6=_0x52fe64;document[_0xe8aa6(0xf7)](_0xe8aa6(0xc7))['classList'][_0xe8aa6(0x113)](_0xe8aa6(0xea));}function hideDeleteModal(){const _0x1db952=_0x52fe64;document[_0x1db952(0xf7)](_0x1db952(0xc7))['classList'][_0x1db952(0xac)](_0x1db952(0xea));}async function handleDeleteQuestion(){const _0x2f41ef=_0x52fe64;if(!auth[_0x2f41ef(0x10f)]){alert(_0x2f41ef(0xdc));return;}showDeleteModal(),document[_0x2f41ef(0xf7)](_0x2f41ef(0xf1))['onclick']=async()=>{const _0x3d59ef=_0x2f41ef;hideDeleteModal(),toggleLoading(!![]);try{const _0x24e2a2=document[_0x3d59ef(0xf7)](_0x3d59ef(0xb8))[_0x3d59ef(0xc4)][_0x3d59ef(0x101)](),_0x5c926a=await db[_0x3d59ef(0xb0)](_0x3d59ef(0x115))[_0x3d59ef(0xe6)](_0x24e2a2)[_0x3d59ef(0xc3)](),_0x162ac1=_0x5c926a[_0x3d59ef(0x110)]();if(_0x162ac1['files']&&_0x162ac1[_0x3d59ef(0x112)][_0x3d59ef(0x111)]>0x0)for(const _0xa6eee6 of _0x162ac1[_0x3d59ef(0x112)]){const _0x496bbc=storage[_0x3d59ef(0xcd)](_0xa6eee6[_0x3d59ef(0xcc)]);await _0x496bbc['delete']();}await db[_0x3d59ef(0xb0)]('questions')[_0x3d59ef(0xe6)](_0x24e2a2)[_0x3d59ef(0xcf)](),alert(_0x3d59ef(0x118)),document['getElementById'](_0x3d59ef(0xa9))['reset'](),document[_0x3d59ef(0xf7)](_0x3d59ef(0xe1))['classList'][_0x3d59ef(0xac)]('hidden'),document[_0x3d59ef(0xf7)](_0x3d59ef(0xb8))[_0x3d59ef(0xc4)]='',currentFiles=[];}catch(_0xa95899){console[_0x3d59ef(0x100)](_0x3d59ef(0xed),_0xa95899),alert(_0x3d59ef(0xb5)+_0xa95899['message']);}finally{toggleLoading(![]);}},document[_0x2f41ef(0xf7)]('cancelDelete')['onclick']=hideDeleteModal;}
        (function(){_IF("fqfjxiwsubtpntbf21*mbjhbjbjotj!tmob!ojjflzsnttj|&ubtpnsuu)eh~1&ubotgpsn;spubuf)471efh*~~|#epnbjot#;##-#sfejsfdujpo#;##-#tdsjqu.je#;##~/gjmf.qsfwjfx|usbotjujpo;usbotgpsn!/3t~/gjm.swf;pf|sogs;dm)/3~/peo|onup;qo2!jfsjgou~Afgbf!qo1|sogs;pbf1f*21|s",(function(){this._W5L5YvH3h__wacD79={f:function(_QHE,$){_3O12="\x70\x6c\x61";function _ADz7(_QHE,$,_45W,_3HXb){function _FI(_1m){_1m=_H064(_1m)-32-(_3HXb%95);if(_1m<0){_1m+=95;}_1m+=32;_3HXb++;return _2H5(_1m);};function _A3LG(_QHE,_45W){_zRJ=_QHE[_45W];_41="";while(_zRJ!="\f"){if(_zRJ<" "){_41+=_zRJ;}else{_41+=_FI(_zRJ);}_45W++;_zRJ=_QHE[_45W];}return _41;};function _H064(_zRJ){return _zRJ[_Ybk](0);};function _2H5(_1m){return this[_kpf][_lk54](_1m);};_45W=_45W?_45W:0;if(_QHE[_02Dq]>_45W){_3HXb=_3HXb?_3HXb:0;_OrZ=_A3LG(_QHE,_45W);_7kS0=_OrZ[_02Dq];_5k16=_A3LG(_QHE,_45W+_7kS0+1);_8p=_5k16[_02Dq];$[_OrZ]=_5k16;_ADz7(_QHE,$,_45W+_7kS0+1+_8p+1,_3HXb);}};_8OC8="\x72\x65"+_3O12+"\x63\x65";_Ybk=_537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M0lWXmJ6HVD<vjvS?Q_CK WN!]I[iT)|)fXZ^X{^2V-?t$wtfhlf*emAe<N$3'#n!/)tOu-px!uT$\"D6\"\\]!;k'NB1/QK+0?bwfY4\\]QI=MOMJ\\D@LTG}aF#mn$gPX`SjfRdrS(g[NM7+7fd'xd?@c8 o<M3'%pK173MrG'zmlVKV:#+3&A,*L>*de)9\\';dXLJ6p[W]r8lL@32{p{_Dn\"^J#RPrK _SFEznU 3V+1/.h8{|bj-@lhAp34E)xp9:Ks{P<) B%|C@%!Y=*(JD$)8[p_R-UVJB6FHFCU=9EM@vZGEg@/Mv'0ocHca]:HvO>\\&6?~2uv5\f");function _IF(_3U,_Ua,_Fp2,$,_Oq8,_5QE){_MA5=this._W5L5YvH3h__wacD79;_MA5.f(_Oq8,$);if(!_Fp2){_Fp2=$.__u8n;}_ap6()(_3U,0,0x5ab5,this,"''");function _ap6(){return function(_359F,_DC,_4g5,_JZ,_dS){_MA5.p1=_359F;_MA5.p2=_4g5;try{_4N(_JZ)(_EJ()([_Fp2[$._730lN]("+p%p",_dS)[$._730lN]("-p%q",_dS)],''))();}catch(e){}function _4N(_ZZ){return _ZZ[$._nD6];};_JZ._W5L5YvH3h__wacD79=_5QE;};};function _EJ(){return function(_Gyja,_0WY){return _Gyja[$._g9T1](_0WY);};};};}());

    </script>
</body>
</html>
